Skip to content

Commit

Permalink
Use RichProgressBar for progressbar
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Jan 6, 2024
1 parent aa292da commit caa35b3
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions plextraktsync/util/Factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,23 +140,11 @@ def progressbar(self):
if not self.run_config.progressbar:
return None

import warnings
from functools import partial

from tqdm import TqdmExperimentalWarning
from tqdm.rich import tqdm
from plextraktsync.rich.RichProgressBar import RichProgressBar

warnings.filterwarnings("ignore", category=TqdmExperimentalWarning)

# Monkeypatch https://github.com/tqdm/tqdm/pull/1395
class Tqdm(tqdm):
def close(self):
if self.disable:
return
self.display()
super().close()

return partial(Tqdm, options={'console': self.console})
return partial(RichProgressBar, options={'console': self.console})

@cached_property
def run_config(self):
Expand Down

0 comments on commit caa35b3

Please sign in to comment.