Example #1
0
def _loadTasks(sync=None, fromFile=None):
    from subsync.synchro import SyncTaskList
    if sync:
        return SyncTaskList.deserialize(sync)
    if fromFile:
        return SyncTaskList.load(fromFile)
    return []
Example #2
0
 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)
Example #3
0
def parseBatchArgs(args):
    from subsync.synchro import SyncTaskList
    tasks = SyncTaskList.load(args.batch)
    settings().tasks = tasks
    return tasks
Example #4
0
 def onMenuItemExportListClick(self, event):
     wildcard = '*.yaml|*.yaml|{}|*.*'.format(_('All files'))
     path = filedlg.showSaveFileDlg(self, wildcard=wildcard)
     if path:
         self.updateTasks()
         SyncTaskList.save(self.tasks, path)
Example #5
0
 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)
Example #6
0
 def onMenuExportClick(self, event):
     wildcard = '*.yaml|*.yaml|{}|*.*'.format(_('All files'))
     path = filedlg.showSaveFileDlg(self, wildcard=wildcard)
     if path:
         tasks = self.m_items.getTasks()
         SyncTaskList.save(tasks, path)
Example #7
0
def parseBatchArgs(args):
    from subsync.synchro import SyncTaskList
    return SyncTaskList.load(args.batch)