diff options
author | Diego Prado Gesto <d.pradogesto@ultimaker.com> | 2018-06-08 17:31:43 +0300 |
---|---|---|
committer | Diego Prado Gesto <d.pradogesto@ultimaker.com> | 2018-06-08 17:31:43 +0300 |
commit | a6815e7c61a7ab83cb15a0aa215c3229dbd4c246 (patch) | |
tree | 8dda5603f8541e6e4e8e1c962ae10472a590aa1e /cura/Backups | |
parent | adafea73cc9f5eafab74cb54b1493ed5215f7c68 (diff) |
CURA-5330 Add typing to Backup
Diffstat (limited to 'cura/Backups')
-rw-r--r-- | cura/Backups/Backup.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cura/Backups/Backup.py b/cura/Backups/Backup.py index c4fe720b2b..6c1f02dc01 100644 --- a/cura/Backups/Backup.py +++ b/cura/Backups/Backup.py @@ -29,11 +29,11 @@ class Backup: # Re-use translation catalog. catalog = i18nCatalog("cura") - def __init__(self, zip_file: bytes = None, meta_data: dict = None): + def __init__(self, zip_file: bytes = None, meta_data: dict = None) -> None: self.zip_file = zip_file # type: Optional[bytes] self.meta_data = meta_data # type: Optional[dict] - def makeFromCurrent(self) -> (bool, Optional[str]): + def makeFromCurrent(self) -> None: """ Create a backup from the current user config folder. """ @@ -57,6 +57,8 @@ class Backup: # Create an empty buffer and write the archive to it. buffer = io.BytesIO() archive = self._makeArchive(buffer, version_data_dir) + if archive is None: + return files = archive.namelist() # Count the metadata items. We do this in a rather naive way at the moment. |