diff --git a/PFERD/authenticator.py b/PFERD/IliasAuthenticators.py similarity index 97% rename from PFERD/authenticator.py rename to PFERD/IliasAuthenticators.py index 0ccbbe1..615ae63 100644 --- a/PFERD/authenticator.py +++ b/PFERD/IliasAuthenticators.py @@ -10,7 +10,7 @@ from .ReadWriteLock import ReadWriteLock __all__ = [ "OutOfTriesException", - "UnknownFileType", + "UnknownFileTypeException", "ShibbolethAuthenticator", ] logger = logging.getLogger(__name__) @@ -18,7 +18,7 @@ logger = logging.getLogger(__name__) class OutOfTriesException(Exception): pass -class UnknownFileType(Exception): +class UnknownFileTypeException(Exception): pass class ShibbolethAuthenticator: @@ -196,7 +196,7 @@ class ShibbolethAuthenticator: return False else: # What *did* we get? - raise UnknownFileType(f"Unknown file of type {resp.content_type}.") + raise UnknownFileTypeException(f"Unknown file of type {resp.content_type}.") except aiohttp.client_exceptions.ServerDisconnectedError: logger.debug(f"Try {t+1} out of {self.RETRY_ATTEMPTS} failed, retrying in {self.RETRY_DELAY} s") diff --git a/PFERD/__init__.py b/PFERD/__init__.py index 989b54c..a7d808f 100644 --- a/PFERD/__init__.py +++ b/PFERD/__init__.py @@ -1,8 +1,8 @@ -from .authenticator import * +from .IliasAuthenticators import * from .organizer import * __all__ = ( - authenticator.__all__ + + IliasAuthenticators.__all__ + organizer.__all__ ) diff --git a/test.py b/test.py index ec5bd75..7155674 100644 --- a/test.py +++ b/test.py @@ -19,9 +19,12 @@ async def test_download(): orga.clean_temp_dir() filename = orga.temp_file() - print(filename) await auth.download_file("file_886544_download", filename) orga.add_file(filename, pathlib.Path("test.pdf")) + + filename = orga.temp_file() + await auth.download_file("file_886544_download", filename) + orga.add_file(filename, pathlib.Path("bla/test2.pdf")) orga.clean_sync_dir() orga.clean_temp_dir()