Skip to content

Commit

Permalink
fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yubarajshrestha committed Oct 31, 2023
1 parent e4a1c60 commit 0890312
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
# your project is installed. For an analysis of "install_requires" vs pip's
# requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=["masonite>=4.0<5.0"],
install_requires=["masonite>=4.0,<5.0"],
# List additional groups of dependencies here (e.g. development
# dependencies). You can install these using the following syntax,
# for example:
Expand Down
14 changes: 9 additions & 5 deletions src/backup/Backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ def email(self, info):
return

info("Sending backup to email")
if self.archive_file_path != None and pathlib.Path(f"{self.archive_file_path}.zip").exists():
if (
self.archive_file_path != None
and pathlib.Path(f"{self.archive_file_path}.zip").exists()
):
Mail.mailable(
BackupMailable().attach(f"System Backup.zip", f"{self.archive_file_path}.zip")
).send()
Expand All @@ -129,16 +132,17 @@ def s3(self, info):
return

info("Uploading backup to S3")
if self.archive_file_path != None and pathlib.Path(f"{self.archive_file_path}.zip").exists():
if (
self.archive_file_path != None
and pathlib.Path(f"{self.archive_file_path}.zip").exists()
):
self.app.make("storage").disk("s3").put(
f"System Backup.zip", f"{self.archive_file_path}.zip"
)

if self.db_file_path != None and pathlib.Path(self.db_file_path).exists():
ext = self.db_file_path.split(".")[-1]
self.app.make("storage").disk("s3").put(
f"Database Backup.{ext}", self.db_file_path
)
self.app.make("storage").disk("s3").put(f"Database Backup.{ext}", self.db_file_path)

def cleanup(self):
"""
Expand Down

0 comments on commit 0890312

Please sign in to comment.