|
3 | 3 | from os.path import expanduser, isdir
|
4 | 4 | from plyer import notification
|
5 | 5 | from plyer.facades import Notification
|
6 |
| -from smooth_progress import ProgressBar |
7 | 6 | from time import time
|
8 | 7 | from typing_extensions import Union
|
9 | 8 |
|
@@ -34,7 +33,6 @@ def __init__(self,
|
34 | 33 | fatal: int = Categories.MAXIMUM,
|
35 | 34 | info: int = Categories.PRINT,
|
36 | 35 | warning: int = Categories.MAXIMUM) -> None:
|
37 |
| - self.bar: ProgressBar = ProgressBar() |
38 | 36 | self.is_empty: bool = True
|
39 | 37 | self.program_name: str = program_name
|
40 | 38 | self._log: list[LogEntry] = []
|
@@ -104,24 +102,20 @@ def __display_log_entry(self,
|
104 | 102 | entry: LogEntry,
|
105 | 103 | scope: str,
|
106 | 104 | notify: bool,
|
107 |
| - is_bar: bool, |
108 | 105 | print_to_console: bool = True) -> None:
|
109 | 106 | """
|
110 | 107 | Displays a given log entry as appropriate using further given settings.
|
111 | 108 |
|
112 | 109 | :param entry: the entry to display
|
113 | 110 | :param scope: the scope of the entry
|
114 | 111 | :param notify: whether to show a desktop notification for the entry
|
115 |
| - :param is_bar: whether the progress bar is active |
116 | 112 | :param print_to_console: whether the message should be printed to the console
|
117 | 113 | """
|
118 | 114 | if scope is None or (
|
119 | 115 | self._scopes[scope] in [Categories.MAXIMUM, Categories.PRINT, Categories.ENABLED]
|
120 | 116 | and print_to_console
|
121 | 117 | ):
|
122 | 118 | print(entry.rendered)
|
123 |
| - if is_bar: |
124 |
| - print(self.bar.state, end="\r", flush=True) |
125 | 119 | if notify:
|
126 | 120 | self.notify(entry.message)
|
127 | 121 |
|
@@ -242,15 +236,6 @@ def get(self,
|
242 | 236 | if data:
|
243 | 237 | return data
|
244 | 238 |
|
245 |
| - def init_bar(self, limit: int) -> None: |
246 |
| - """ |
247 |
| - Initiate and open the progress bar. |
248 |
| -
|
249 |
| - :param limit: the number of increments it should take to fill the bar |
250 |
| - """ |
251 |
| - self.bar = ProgressBar(limit=limit) |
252 |
| - self.bar.open() |
253 |
| - |
254 | 239 | def is_scope(self, scope: str, category: Categories = None) -> bool:
|
255 | 240 | """
|
256 | 241 | Queries a given scope to check if it exists, and optionally if it matches a given category.
|
@@ -293,12 +278,6 @@ def new(self,
|
293 | 278 | if scope is None else
|
294 | 279 | self._scopes[scope] in [Categories.MAXIMUM, Categories.SAVE]
|
295 | 280 | )
|
296 |
| - is_bar: bool = (self.bar is not None) and self.bar.opened |
297 |
| - |
298 |
| - # if the progress bar is enabled, append any necessary empty characters to the message |
299 |
| - # to completely overwrite it upon output |
300 |
| - if is_bar and len(message) < len(self.bar.state): |
301 |
| - message += " " * (len(self.bar.state) - len(message)) |
302 | 281 |
|
303 | 282 | entry: LogEntry = self.__create_log_entry(message, output, scope)
|
304 | 283 | self.__display_log_entry(entry, scope, notify, is_bar, print_to_console)
|
|
0 commit comments