-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
31 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,41 @@ | ||
from abc import abstractmethod | ||
|
||
|
||
class ProgressTracker(): | ||
""" | ||
Base class for all ProgressTrackers to inherit from. A ProgressTracker | ||
maintains an integer measure of progress between progress_minimum and | ||
progress_maximum. The progress value can be used by PyQt progress bars | ||
for example. | ||
""" | ||
def __init__(self, progress_minimum: int=0, progress_maximum: int=0): | ||
|
||
def __init__(self, progress_minimum: int = 0, progress_maximum: int = 0): | ||
self._progress_minimum: int = progress_minimum | ||
self._progress_maximum: int = progress_maximum | ||
self._progress: int = progress_minimum | ||
|
||
def get_progress_minimum(self) -> int: | ||
return self._progress_minimum | ||
|
||
def get_progress_maximum(self) -> int: | ||
return self._progress_maximum | ||
|
||
def get_progress(self) -> int: | ||
return self._progress | ||
|
||
def set_progress_minimum(self, progress_minimum: int) -> None: | ||
self._progress_minimum = progress_minimum | ||
|
||
def set_progress_maximum(self, progress_maximum: int) -> None: | ||
self._progress_maximum = progress_maximum | ||
|
||
def set_progress(self, progress: int) -> None: | ||
self._progress = progress if progress >= self._progress_minimum and progress <= self._progress_maximum else self._progress | ||
|
||
@abstractmethod | ||
def start_tracker(self) -> None: | ||
pass | ||
|
||
@abstractmethod | ||
def stop_tracker(self) -> None: | ||
pass | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters