def run_once(): if not check_root(): clean_exit( '''You need to have root privileges to execute this script. Please try again, this time using "sudo". Exiting.''', BADPERM) for i in settings.sections: x = Section(settings.config[i]) x.makesnapshot()
def new_snapshot(self): failed = [] ok = False for s in self.selected: x = Section(settings.config[s]) if x.makesnapshot(force=True): ok = True else: failed.append(s) if failed: text = 'Failed to create new snapshots for the sections: \n\n' + \ '\n'.join(failed) + '\ \n\nMaybe are not you root?' title = 'Operation failed' self.mbox.warning(self, title, text, self.mbox.Ok) if ok: # Only update table if some change happened self.reloadTable()
def section_newsnapshot(): s = args.section_newsnapshot.rstrip('/') x = Section(settings.config[s]) x.makesnapshot(True)
def run_once(): for i in settings.sections: x = Section(settings.config[i]) x.makesnapshot()
def section_newsnapshot(): for i in Snapman.args.targets: s = i.rstrip('/') x = Section(settings.config[s]) x.makesnapshot(True)