Skip to content

Commit b9449b5

Browse files
Merge pull request #20 from MurdoMaclachlan/dev
Remove smooth_progress integration
2 parents 3c327c1 + 09dbe9a commit b9449b5

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ def readme():
1919
url="https://github.com/MurdoMaclachlan/smooth_logger",
2020
packages=find_packages(),
2121
install_requires=[
22-
"plyer",
23-
"smooth_progress"
22+
"plyer"
2423
],
2524
classifiers=[
2625
"Programming Language :: Python :: 3.5",

smooth_logger/Logger.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from os.path import expanduser, isdir
44
from plyer import notification
55
from plyer.facades import Notification
6-
from smooth_progress import ProgressBar
76
from time import time
87
from typing_extensions import Union
98

@@ -34,7 +33,6 @@ def __init__(self,
3433
fatal: int = Categories.MAXIMUM,
3534
info: int = Categories.PRINT,
3635
warning: int = Categories.MAXIMUM) -> None:
37-
self.bar: ProgressBar = ProgressBar()
3836
self.is_empty: bool = True
3937
self.program_name: str = program_name
4038
self._log: list[LogEntry] = []
@@ -104,24 +102,20 @@ def __display_log_entry(self,
104102
entry: LogEntry,
105103
scope: str,
106104
notify: bool,
107-
is_bar: bool,
108105
print_to_console: bool = True) -> None:
109106
"""
110107
Displays a given log entry as appropriate using further given settings.
111108
112109
:param entry: the entry to display
113110
:param scope: the scope of the entry
114111
:param notify: whether to show a desktop notification for the entry
115-
:param is_bar: whether the progress bar is active
116112
:param print_to_console: whether the message should be printed to the console
117113
"""
118114
if scope is None or (
119115
self._scopes[scope] in [Categories.MAXIMUM, Categories.PRINT, Categories.ENABLED]
120116
and print_to_console
121117
):
122118
print(entry.rendered)
123-
if is_bar:
124-
print(self.bar.state, end="\r", flush=True)
125119
if notify:
126120
self.notify(entry.message)
127121

@@ -242,15 +236,6 @@ def get(self,
242236
if data:
243237
return data
244238

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-
254239
def is_scope(self, scope: str, category: Categories = None) -> bool:
255240
"""
256241
Queries a given scope to check if it exists, and optionally if it matches a given category.
@@ -293,12 +278,6 @@ def new(self,
293278
if scope is None else
294279
self._scopes[scope] in [Categories.MAXIMUM, Categories.SAVE]
295280
)
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))
302281

303282
entry: LogEntry = self.__create_log_entry(message, output, scope)
304283
self.__display_log_entry(entry, scope, notify, is_bar, print_to_console)

0 commit comments

Comments
 (0)