Esempio n. 1
0
 def __init__( self ):
     
     HydrusSerialisable.SerialisableBase.__init__( self )
     
     self._gallery_seed_log = ClientImportGallerySeeds.GallerySeedLog()
     self._file_seed_cache = ClientImportFileSeeds.FileSeedCache()
     self._file_import_options = HG.client_controller.new_options.GetDefaultFileImportOptions( 'loud' )
     self._tag_import_options = TagImportOptions.TagImportOptions( is_default = True )
     self._paused = False
     
     self._no_work_until = 0
     self._no_work_until_reason = ''
     
     self._page_key = b'initialising page key'
     self._downloader_key = HydrusData.GenerateKey()
     
     self._lock = threading.Lock()
     
     self._have_started = False
     
     self._files_status = ''
     self._gallery_status = ''
     
     self._files_network_job = None
     self._gallery_network_job = None
     
     self._files_repeating_job = None
     self._gallery_repeating_job = None
     
     self._last_serialisable_change_timestamp = 0
     
     HG.client_controller.sub( self, 'NotifyFileSeedsUpdated', 'file_seed_cache_file_seeds_updated' )
     HG.client_controller.sub( self, 'NotifyGallerySeedsUpdated', 'gallery_seed_log_gallery_seeds_updated' )
Esempio n. 2
0
    def SetTuple(self, name, path, mimes, file_import_options,
                 tag_import_options,
                 tag_service_keys_to_filename_tagging_options, actions,
                 action_locations, period, check_regularly, paused, check_now,
                 show_working_popup, publish_files_to_popup_button,
                 publish_files_to_page):

        if path != self._path:

            self._file_seed_cache = ClientImportFileSeeds.FileSeedCache()

        if set(mimes) != set(self._mimes):

            self._file_seed_cache.RemoveFileSeedsByStatus((CC.STATUS_VETOED, ))

        self._name = name
        self._path = path
        self._mimes = mimes
        self._file_import_options = file_import_options
        self._tag_import_options = tag_import_options
        self._tag_service_keys_to_filename_tagging_options = tag_service_keys_to_filename_tagging_options
        self._actions = actions
        self._action_locations = action_locations
        self._period = period
        self._check_regularly = check_regularly
        self._paused = paused
        self._check_now = check_now
        self._show_working_popup = show_working_popup
        self._publish_files_to_popup_button = publish_files_to_popup_button
        self._publish_files_to_page = publish_files_to_page
Esempio n. 3
0
    def __init__(self):

        HydrusSerialisable.SerialisableBase.__init__(self)

        file_import_options = HG.client_controller.new_options.GetDefaultFileImportOptions(
            'loud')

        self._pending_jobs = []
        self._gallery_seed_log = ClientImportGallerySeeds.GallerySeedLog()
        self._file_seed_cache = ClientImportFileSeeds.FileSeedCache()
        self._file_import_options = file_import_options
        self._formula_name = 'all files linked by images in page'
        self._queue_paused = False
        self._files_paused = False

        self._downloader_key = HydrusData.GenerateKey()

        self._parser_status = ''
        self._current_action = ''

        self._lock = threading.Lock()

        self._have_started = False

        self._files_network_job = None
        self._page_network_job = None

        self._files_repeating_job = None
        self._queue_repeating_job = None

        self._last_serialisable_change_timestamp = 0

        HG.client_controller.sub(self, 'NotifyFileSeedsUpdated',
                                 'file_seed_cache_file_seeds_updated')
Esempio n. 4
0
    def __init__(self):

        HydrusSerialisable.SerialisableBase.__init__(self)

        self._gallery_seed_log = ClientImportGallerySeeds.GallerySeedLog()
        self._file_seed_cache = ClientImportFileSeeds.FileSeedCache()
        self._file_import_options = HG.client_controller.new_options.GetDefaultFileImportOptions(
            'loud')
        self._tag_import_options = ClientImportOptions.TagImportOptions(
            is_default=True)
        self._paused = False

        self._downloader_key = HydrusData.GenerateKey()

        self._lock = threading.Lock()

        self._files_network_job = None
        self._gallery_network_job = None

        self._files_repeating_job = None
        self._gallery_repeating_job = None

        HG.client_controller.sub(self, 'NotifyFileSeedsUpdated',
                                 'file_seed_cache_file_seeds_updated')
        HG.client_controller.sub(self, 'NotifyGallerySeedsUpdated',
                                 'gallery_seed_log_gallery_seeds_updated')
Esempio n. 5
0
    def __init__(self,
                 paths=None,
                 file_import_options=None,
                 paths_to_additional_service_keys_to_tags=None,
                 delete_after_success=None):

        HydrusSerialisable.SerialisableBase.__init__(self)

        if paths is None:

            self._file_seed_cache = None

        else:

            self._file_seed_cache = ClientImportFileSeeds.FileSeedCache()

            file_seeds = []

            for path in paths:

                file_seed = ClientImportFileSeeds.FileSeed(
                    ClientImportFileSeeds.FILE_SEED_TYPE_HDD, path)

                try:

                    file_modified_time = HydrusFileHandling.GetFileModifiedTimestamp(
                        path)

                    file_seed.source_time = file_modified_time

                except:

                    pass

                if path in paths_to_additional_service_keys_to_tags:

                    file_seed.SetExternalAdditionalServiceKeysToTags(
                        paths_to_additional_service_keys_to_tags[path])

                file_seeds.append(file_seed)

            self._file_seed_cache.AddFileSeeds(file_seeds)

        self._file_import_options = file_import_options
        self._delete_after_success = delete_after_success

        self._page_key = b'initialising page key'

        self._files_status = ''
        self._paused = False

        self._lock = threading.Lock()

        self._files_repeating_job = None

        self._last_serialisable_change_timestamp = 0

        HG.client_controller.sub(self, 'NotifyFileSeedsUpdated',
                                 'file_seed_cache_file_seeds_updated')
 def Reset( self ):
     
     self._last_check_time = 0
     self._next_check_time = 0
     self._status = ClientImporting.CHECKER_STATUS_OK
     self._paused = False
     
     self._file_seed_cache = ClientImportFileSeeds.FileSeedCache()
 def __init__( self, name, path = '', file_import_options = None, tag_import_options = None, tag_service_keys_to_filename_tagging_options = None, mimes = None, actions = None, action_locations = None, period = 3600, check_regularly = True, show_working_popup = True, publish_files_to_popup_button = True, publish_files_to_page = False ):
     
     if mimes is None:
         
         mimes = HC.ALLOWED_MIMES
         
     
     if file_import_options is None:
         
         file_import_options = HG.client_controller.new_options.GetDefaultFileImportOptions( 'quiet' )
         
     
     if tag_import_options is None:
         
         tag_import_options = TagImportOptions.TagImportOptions()
         
     
     if tag_service_keys_to_filename_tagging_options is None:
         
         tag_service_keys_to_filename_tagging_options = {}
         
     
     if actions is None:
         
         actions = {}
         
         actions[ CC.STATUS_SUCCESSFUL_AND_NEW ] = CC.IMPORT_FOLDER_IGNORE
         actions[ CC.STATUS_SUCCESSFUL_BUT_REDUNDANT ] = CC.IMPORT_FOLDER_IGNORE
         actions[ CC.STATUS_DELETED ] = CC.IMPORT_FOLDER_IGNORE
         actions[ CC.STATUS_ERROR ] = CC.IMPORT_FOLDER_IGNORE
         
     
     if action_locations is None:
         
         action_locations = {}
         
     
     HydrusSerialisable.SerialisableBaseNamed.__init__( self, name )
     
     self._path = path
     self._mimes = mimes
     self._file_import_options = file_import_options
     self._tag_import_options = tag_import_options
     self._tag_service_keys_to_filename_tagging_options = tag_service_keys_to_filename_tagging_options
     self._actions = actions
     self._action_locations = action_locations
     self._period = period
     self._check_regularly = check_regularly
     
     self._file_seed_cache = ClientImportFileSeeds.FileSeedCache()
     self._last_checked = 0
     self._paused = False
     self._check_now = False
     
     self._show_working_popup = show_working_popup
     self._publish_files_to_popup_button = publish_files_to_popup_button
     self._publish_files_to_page = publish_files_to_page
    def Reset(self, query_log_container: SubscriptionQueryLogContainer):

        self._last_check_time = 0
        self._next_check_time = 0
        self._checker_status = ClientImporting.CHECKER_STATUS_OK
        self._paused = False

        file_seed_cache = ClientImportFileSeeds.FileSeedCache()

        query_log_container.SetFileSeedCache(file_seed_cache)

        self.UpdateFileStatus(query_log_container)
Esempio n. 9
0
    def __init__(self):

        HydrusSerialisable.SerialisableBase.__init__(self)

        self._page_key = 'initialising page key'
        self._publish_to_page = False

        self._url = ''

        self._gallery_seed_log = ClientImportGallerySeeds.GallerySeedLog()
        self._file_seed_cache = ClientImportFileSeeds.FileSeedCache()

        self._fixed_service_keys_to_tags = ClientTags.ServiceKeysToTags()

        self._checker_options = HG.client_controller.new_options.GetDefaultWatcherCheckerOptions(
        )
        self._file_import_options = HG.client_controller.new_options.GetDefaultFileImportOptions(
            'loud')
        self._tag_import_options = ClientImportOptions.TagImportOptions(
            is_default=True)
        self._last_check_time = 0
        self._checking_status = ClientImporting.CHECKER_STATUS_OK
        self._subject = 'unknown subject'

        self._next_check_time = None

        self._file_network_job = None
        self._checker_network_job = None

        self._check_now = False
        self._files_paused = False
        self._checking_paused = False

        self._no_work_until = 0
        self._no_work_until_reason = ''

        self._creation_time = HydrusData.GetNow()

        self._file_velocity_status = ''
        self._file_status = ''
        self._watcher_status = ''

        self._watcher_key = HydrusData.GenerateKey()

        self._lock = threading.Lock()

        self._last_pubbed_page_name = ''

        self._files_repeating_job = None
        self._checker_repeating_job = None

        HG.client_controller.sub(self, 'NotifyFileSeedsUpdated',
                                 'file_seed_cache_file_seeds_updated')
 def __init__( self, query = 'query text' ):
     
     HydrusSerialisable.SerialisableBase.__init__( self )
     
     self._query = query
     self._display_name = None
     self._check_now = False
     self._last_check_time = 0
     self._next_check_time = 0
     self._paused = False
     self._status = ClientImporting.CHECKER_STATUS_OK
     self._gallery_seed_log = ClientImportGallerySeeds.GallerySeedLog()
     self._file_seed_cache = ClientImportFileSeeds.FileSeedCache()
     self._tag_import_options = ClientImportOptions.TagImportOptions()
    def __init__(self, name):

        HydrusSerialisable.SerialisableBaseNamed.__init__(self, name)

        self._gallery_seed_log = ClientImportGallerySeeds.GallerySeedLog()
        self._file_seed_cache = ClientImportFileSeeds.FileSeedCache()