Skip to content

Commit

Permalink
Merge pull request #109 from Akarys42/localstorage-cast-to-path
Browse files Browse the repository at this point in the history
Localstorage: fix missing cast to Path
  • Loading branch information
lemonsaurus authored Jun 8, 2022
2 parents 681cbd7 + 80ad5e6 commit ff1522e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blackbox/handlers/databases/localstorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ def __init__(self, **kwargs) -> None:

super().__init__(**kwargs)

def backup(self, backup_path: Path) -> Path:
def backup(self, backup_path: Path) -> None:
path = self.config["path"]
compression_level = self.config.get("compression_level", 5)

# Store evey file in the archive
# We use deflate (Gzip) for compression and the level has already been validated in __init__
with ZipFile(backup_path, "w", ZIP_DEFLATED, compresslevel=compression_level) as zipfile:
for subpath in path.rglob("*"):
for subpath in Path(path).rglob("*"):
if subpath.is_file():
zipfile.write(subpath)

Expand Down

0 comments on commit ff1522e

Please sign in to comment.