Skip to content

Commit

Permalink
Merge pull request #175 from glensc/decors-ns
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc authored Apr 5, 2021
2 parents b0eb3f2 + 5619e09 commit b02d384
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
3 changes: 3 additions & 0 deletions plex_trakt_sync/decorators/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .measure_time import measure_time
from .memoize import memoize
from .nocache import CacheDisabledDecorator as nocache
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import logging
from contextlib import contextmanager
from time import time
from plex_trakt_sync.nocache import CacheDisabledDecorator as nocache

try:
from functools import cache as memoize
except ImportError:
# For py<3.9
# https://docs.python.org/3.9/library/functools.html
from functools import lru_cache as memoize


@contextmanager
Expand Down
6 changes: 6 additions & 0 deletions plex_trakt_sync/decorators/memoize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
try:
from functools import cache as memoize
except ImportError:
# For py<3.9
# https://docs.python.org/3.9/library/functools.html
from functools import lru_cache as memoize
File renamed without changes.
2 changes: 1 addition & 1 deletion plex_trakt_sync/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def process_movie_section(section: PlexLibrarySection, watched_set, ratings_dict
movie.title, movie.year))
except trakt.errors.NotFoundException:
logging.error(
"Movie [{} ({})]: GUID {} not found on trakt".format(movie.title, movie.year, guid))
"Movie [{} ({})]: GUID {} not found on trakt".format(movie.title, movie.year, it.guid))
except trakt.errors.RateLimitException as e:
delay = int(e.response.headers.get("Retry-After", 1))
logging.warning(
Expand Down

0 comments on commit b02d384

Please sign in to comment.