def __init__(self, name, path='', export_type=HC.EXPORT_FOLDER_TYPE_REGULAR, file_search_context=None, period=3600, phrase=None): HydrusSerialisable.SerialisableBaseNamed.__init__(self, name) if file_search_context is None: file_search_context = ClientSearch.FileSearchContext( file_service_key=CC.LOCAL_FILE_SERVICE_KEY) if phrase is None: new_options = HG.client_controller.GetNewOptions() phrase = new_options.GetString('export_phrase') self._path = path self._export_type = export_type self._file_search_context = file_search_context self._period = period self._phrase = phrase self._last_checked = 0
def _AddFolder(self): new_options = HG.client_controller.new_options phrase = new_options.GetString('export_phrase') name = 'export folder' path = '' export_type = HC.EXPORT_FOLDER_TYPE_REGULAR delete_from_client_after_export = False file_search_context = ClientSearch.FileSearchContext( file_service_key=CC.LOCAL_FILE_SERVICE_KEY) period = 15 * 60 export_folder = ClientExporting.ExportFolder( name, path, export_type=export_type, delete_from_client_after_export=delete_from_client_after_export, file_search_context=file_search_context, period=period, phrase=phrase) with ClientGUITopLevelWindows.DialogEdit(self, 'edit export folder') as dlg: panel = EditExportFolderPanel(dlg, export_folder) dlg.SetPanel(panel) if dlg.ShowModal() == wx.ID_OK: export_folder = panel.GetValue() export_folder.SetNonDupeName(self._GetExistingNames()) self._export_folders.AddDatas((export_folder, ))