Use print from factory
MODIFY
plextraktsync/commands/config.py
plextraktsync/commands/config.py
-from plextraktsync.console import print
+from plextraktsync.factory import factory
def dump(data, print=None):
@@ -14,9 +14,9 @@ def dump(data, print=None):
print(dump)
-def config(urls_expire_after: bool, print=print):
- from plextraktsync.factory import factory
+def config(urls_expire_after: bool):
config = factory.config
+ print = factory.print
if urls_expire_after:
print("# HTTP Cache")

MODIFY
plextraktsync/commands/imdb_import.py
plextraktsync/commands/imdb_import.py
from dataclasses import dataclass
from typing import TYPE_CHECKING
-from plextraktsync.console import print
from plextraktsync.decorators.cached_property import cached_property
from plextraktsync.factory import factory
@@ -65,6 +64,7 @@ def from_csv(row):
def imdb_import(input: PathLike, dry_run: bool):
trakt = factory.trakt_api
+ print = factory.print
for r in read_csv(input):
print(f"Importing [blue]{r.media_type} {r.imdb}[/]: {r.title} ({r.year}), rated at {r.rate_date}")

MODIFY
plextraktsync/commands/inspect.py
plextraktsync/commands/inspect.py
from typing import TYPE_CHECKING
from urllib.parse import quote_plus
-from plextraktsync.console import print
from plextraktsync.factory import factory
from plextraktsync.util.expand_id import expand_id
from plextraktsync.version import version
def inspect_media(id):
plex = factory.plex_api
mf = factory.media_factory
+ print = factory.print
print("")
pm: PlexLibraryItem = plex.fetch_item(id)
@@ -83,6 +83,7 @@ def inspect_media(id):
def inspect(input):
+ print = factory.print
print(f"PlexTraktSync [{version()}]")
for id in expand_id(input):

MODIFY
plextraktsync/commands/watched_shows.py
plextraktsync/commands/watched_shows.py
from rich.table import Table
-from plextraktsync.console import print
from plextraktsync.factory import factory
def watched_shows():
trakt = factory.trakt_api
+ print = factory.print
table = Table(
show_header=True, header_style="bold magenta", title="Watched shows on Trakt"

Use print from factory