Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions pywikibot/tools/djvu.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def __str__(self) -> str:
"""Return a string representation."""
return str("{}('{}')").format(self.__class__.__name__, self._filename)

@staticmethod
def check_cache(fn):
"""Decorator to check if cache shall be cleared."""
cache = ['_page_count', '_has_text', '_page_info']
Expand All @@ -100,6 +101,7 @@ def wrapper(obj, *args, **kwargs):
return _res
return wrapper

@staticmethod
def check_page_number(fn):
"""Decorator to check if page number is valid.

Expand Down Expand Up @@ -312,8 +314,3 @@ def delete_page(self, n):
assert self.page_info(new_ref_page, force=True) == ('', (sz, dpi))

return True

# This is to be used only if this class is subclassed and the decorators
# needs to be used by the child.
check_page_number = staticmethod(check_page_number)
check_cache = staticmethod(check_cache)