• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

flowkeeper-org / fk-desktop / 13108386717

03 Feb 2025 07:19AM UTC coverage: 80.453% (-3.8%) from 84.265%
13108386717

Pull #101

github

co-stig
Resolving SonarQube security warnings
Pull Request #101: Rc 0.10.0

218 of 400 new or added lines in 18 files covered. (54.5%)

35 existing lines in 7 files now uncovered.

3054 of 3796 relevant lines covered (80.45%)

0.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/src/fk/core/interruption.py
1
#  Flowkeeper - Pomodoro timer for power users and teams
2
#  Copyright (c) 2023 Constantine Kulak
3
#
4
#  This program is free software: you can redistribute it and/or modify
5
#  it under the terms of the GNU General Public License as published by
6
#  the Free Software Foundation; either version 3 of the License, or
7
#  (at your option) any later version.
8
#
9
#  This program is distributed in the hope that it will be useful,
10
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
#  GNU General Public License for more details.
13
#
14
#  You should have received a copy of the GNU General Public License
15
#  along with this program.  If not, see <https://www.gnu.org/licenses/>.
16
from __future__ import annotations
1✔
17

18
import datetime
1✔
19
import logging
1✔
20

21
from fk.core.abstract_data_item import AbstractDataItem
1✔
22

23
logger = logging.getLogger(__name__)
1✔
24

25

26
class Interruption(AbstractDataItem['Pomodoro']):
1✔
27
    _reason: str | None
1✔
28
    _duration: datetime.timedelta | None
1✔
29
    _void: bool
1✔
30

31
    def __init__(self,
1✔
32
                 reason: str | None,
33
                 duration: datetime.timedelta | None,
34
                 void: bool,
35
                 uid: str,
36
                 pomodoro: 'Pomodoro',
37
                 create_date: datetime.datetime):
38
        super().__init__(uid=uid, parent=pomodoro, create_date=create_date)
1✔
39
        self._reason = reason
1✔
40
        self._duration = duration
1✔
41
        self._void = void
1✔
42

43
    def __str__(self):
1✔
NEW
44
        if self._reason:
×
NEW
45
            return f"'[{self._reason}]"
×
46
        else:
NEW
47
            return f"'"
×
48

49
    def get_reason(self) -> str | None:
1✔
50
        return self._reason
1✔
51

52
    def get_duration(self) -> datetime.timedelta | None:
1✔
53
        return self._duration
1✔
54

55
    def is_void(self) -> bool:
1✔
56
        return self._void
1✔
57

58
    def get_parent(self) -> 'Pomodoro':
1✔
NEW
59
        return self._parent
×
60

61
    def dump(self, indent: str = '', mask_uid: bool = False) -> str:
1✔
62
        return f'{super().dump(indent, True)}\n' \
1✔
63
               f'{indent}  Reason: {self._reason if self._reason else "<None>"}\n' \
64
               f'{indent}  Void: {self._void}\n' \
65
               f'{indent}  Duration: {self._duration if self._duration else "<None>"}'
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc