def _loadTasks(sync=None, fromFile=None): from subsync.synchro import SyncTaskList if sync: return SyncTaskList.deserialize(sync) if fromFile: return SyncTaskList.load(fromFile) return []
def onMenuImportClick(self, event): wildcard = '*.yaml|*.yaml|{}|*.*'.format(_('All files')) path = filedlg.showOpenFileDlg(self, wildcard=wildcard) if path: tasks = SyncTaskList.load(path) self.m_items.removeAll() self.m_items.addTasks(tasks)
def parseBatchArgs(args): from subsync.synchro import SyncTaskList tasks = SyncTaskList.load(args.batch) settings().tasks = tasks return tasks
def onMenuItemImportListClick(self, event): wildcard = '*.yaml|*.yaml|{}|*.*'.format(_('All files')) path = filedlg.showOpenFileDlg(self, wildcard=wildcard) if path: tasks = SyncTaskList.load(path) self.setTasks(tasks)
def parseBatchArgs(args): from subsync.synchro import SyncTaskList return SyncTaskList.load(args.batch)