Refactor factory.progressbar to return early
MODIFY
plextraktsync/factory.py
plextraktsync/factory.py
@@ -78,9 +78,9 @@ def sync(self):
@cached_property
def progressbar(self):
- enabled = self.run_config.progressbar
+ if not self.run_config.progressbar:
+ return None
- if enabled:
import warnings
from functools import partial
@@ -93,8 +93,6 @@ def progressbar(self):
return partial(tqdm, options={'console': console})
- return None
-
@cached_property
def run_config(self):
from plextraktsync.config.RunConfig import RunConfig

Refactor factory.progressbar to return early