mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Fix syntax error + more minor refactoring/cleanup
This commit is contained in:
parent
42f430d234
commit
1be93094b5
1 changed files with 5 additions and 5 deletions
|
@ -240,7 +240,7 @@ class BackupManager():
|
||||||
backup_manager.backup()
|
backup_manager.backup()
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, name=None, description='', work_dir=None):
|
def __init__(self, name=None, description='', methods=[], work_dir=None):
|
||||||
"""
|
"""
|
||||||
BackupManager constructor
|
BackupManager constructor
|
||||||
|
|
||||||
|
@ -258,7 +258,6 @@ class BackupManager():
|
||||||
self.created_at = int(time.time())
|
self.created_at = int(time.time())
|
||||||
self.apps_return = {}
|
self.apps_return = {}
|
||||||
self.system_return = {}
|
self.system_return = {}
|
||||||
self.methods = []
|
|
||||||
self.paths_to_backup = []
|
self.paths_to_backup = []
|
||||||
self.size_details = {
|
self.size_details = {
|
||||||
'system': {},
|
'system': {},
|
||||||
|
@ -277,6 +276,9 @@ class BackupManager():
|
||||||
self.work_dir = os.path.join(BACKUP_PATH, 'tmp', name)
|
self.work_dir = os.path.join(BACKUP_PATH, 'tmp', name)
|
||||||
self._init_work_dir()
|
self._init_work_dir()
|
||||||
|
|
||||||
|
# Initialize backup methods
|
||||||
|
self.methods = [BackupMethod.create(method, self, repo=work_dir) for method in methods]
|
||||||
|
|
||||||
#
|
#
|
||||||
# Misc helpers #
|
# Misc helpers #
|
||||||
#
|
#
|
||||||
|
@ -2035,9 +2037,7 @@ def backup_create(name=None, description=None, methods=[],
|
||||||
|
|
||||||
# Initialize backup manager
|
# Initialize backup manager
|
||||||
|
|
||||||
backup_manager = BackupManager(name, description, work_dir=output_directory)
|
backup_manager = BackupManager(name, description, methods=methods, work_dir=output_directory)
|
||||||
for method in methods:
|
|
||||||
backup_manager.methods += BackupMethod.create(method, backup_manager, repo=output_directory))
|
|
||||||
|
|
||||||
# Add backup targets (system and apps)
|
# Add backup targets (system and apps)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue