fix: make python commands modular and reusable

This commit is contained in:
Revant Nandgaonkar
2020-03-20 20:56:23 +05:30
parent 8ce9d4214d
commit 7c356ccb27
8 changed files with 112 additions and 95 deletions

View File

@@ -20,10 +20,13 @@ def backup(sites, with_files=False):
print("private files backup taken -", odb.backup_path_private_files, "- on", now())
frappe.destroy()
installed_sites = ":".join(get_sites())
sites = os.environ.get("SITES", installed_sites).split(":")
with_files=True if os.environ.get("WITH_FILES") else False
def main():
installed_sites = ":".join(get_sites())
sites = os.environ.get("SITES", installed_sites).split(":")
with_files=True if os.environ.get("WITH_FILES") else False
backup(sites, with_files)
backup(sites, with_files)
exit(0)
exit(0)
if __name__ == "__main__":
main()