def _UpdateSerialisableInfo( self, version, old_serialisable_info ):
     
     if version == 1:
         
         ( query, check_now, last_check_time, next_check_time, paused, status, serialisable_file_seed_cache ) = old_serialisable_info
         
         gallery_seed_log = ClientImportGallerySeeds.GallerySeedLog()
         
         serialisable_gallery_seed_log = gallery_seed_log.GetSerialisableTuple()
         
         new_serialisable_info = ( query, check_now, last_check_time, next_check_time, paused, status, serialisable_gallery_seed_log, serialisable_file_seed_cache )
         
         return ( 2, new_serialisable_info )
         
     
     if version == 2:
         
         ( query, check_now, last_check_time, next_check_time, paused, status, serialisable_gallery_seed_log, serialisable_file_seed_cache ) = old_serialisable_info
         
         display_name = None
         tag_import_options = ClientImportOptions.TagImportOptions()
         
         serialisable_tag_import_options = tag_import_options.GetSerialisableTuple()
         
         new_serialisable_info = ( query, display_name, check_now, last_check_time, next_check_time, paused, status, serialisable_gallery_seed_log, serialisable_file_seed_cache, serialisable_tag_import_options )
         
         return ( 3, new_serialisable_info )
Пример #2
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' )
Пример #3
0
 def _UpdateSerialisableInfo( self, version, old_serialisable_info ):
     
     if version == 1:
         
         ( serialisable_file_seed_cache, serialisable_file_import_options, paused ) = old_serialisable_info
         
         gallery_seed_log = ClientImportGallerySeeds.GallerySeedLog()
         
         serialisable_gallery_seed_log = gallery_seed_log.GetSerialisableTuple()
         
         new_serialisable_info = ( serialisable_gallery_seed_log, serialisable_file_seed_cache, serialisable_file_import_options, paused )
         
         return ( 2, new_serialisable_info )
         
     
     if version == 2:
         
         ( serialisable_gallery_seed_log, serialisable_file_seed_cache, serialisable_file_import_options, paused ) = old_serialisable_info
         
         tag_import_options = TagImportOptions.TagImportOptions( is_default = True )
         
         serialisable_tag_import_options = tag_import_options.GetSerialisableTuple()
         
         new_serialisable_info = ( serialisable_gallery_seed_log, serialisable_file_seed_cache, serialisable_file_import_options, serialisable_tag_import_options, paused )
         
         return ( 3, new_serialisable_info )
Пример #4
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')
Пример #5
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')
Пример #6
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()
Пример #8
0
 def _UpdateSerialisableInfo( self, version, old_serialisable_info ):
     
     if version == 1:
         
         ( pending_page_urls, serialisable_file_seed_cache, serialisable_file_import_options, download_image_links, download_unlinked_images, paused ) = old_serialisable_info
         
         queue_paused = paused
         files_paused = paused
         
         new_serialisable_info = ( pending_page_urls, serialisable_file_seed_cache, serialisable_file_import_options, download_image_links, download_unlinked_images, queue_paused, files_paused )
         
         return ( 2, new_serialisable_info )
         
     
     if version == 2:
         
         ( pending_page_urls, serialisable_file_seed_cache, serialisable_file_import_options, download_image_links, download_unlinked_images, queue_paused, files_paused ) = old_serialisable_info
         
         pending_jobs = []
         
         new_serialisable_info = ( pending_jobs, serialisable_file_seed_cache, serialisable_file_import_options, queue_paused, files_paused )
         
         return ( 3, new_serialisable_info )
         
     
     if version == 3:
         
         ( pending_jobs, serialisable_file_seed_cache, serialisable_file_import_options, queue_paused, files_paused ) = old_serialisable_info
         
         pending_jobs = []
         
         formula_name = 'all files linked by images in page'
         
         new_serialisable_info = ( pending_jobs, serialisable_file_seed_cache, serialisable_file_import_options, formula_name, queue_paused, files_paused )
         
         return ( 4, new_serialisable_info )
         
     
     if version == 4:
         
         ( pending_jobs, serialisable_file_seed_cache, serialisable_file_import_options, formula_name, queue_paused, files_paused ) = old_serialisable_info
         
         gallery_seed_log = ClientImportGallerySeeds.GallerySeedLog()
         
         serialisable_gallery_seed_log = gallery_seed_log.GetSerialisableTuple()
         
         new_serialisable_info = ( pending_jobs, serialisable_gallery_seed_log, serialisable_file_seed_cache, serialisable_file_import_options, formula_name, queue_paused, files_paused )
         
         return ( 5, new_serialisable_info )
    def __init__(self, name):

        HydrusSerialisable.SerialisableBaseNamed.__init__(self, name)

        self._gallery_seed_log = ClientImportGallerySeeds.GallerySeedLog()
        self._file_seed_cache = ClientImportFileSeeds.FileSeedCache()
Пример #10
0
    def _UpdateSerialisableInfo(self, version, old_serialisable_info):

        if version == 1:

            (url, serialisable_file_seed_cache, urls_to_filenames,
             urls_to_md5_base64, serialisable_file_import_options,
             serialisable_tag_import_options, times_to_check, check_period,
             last_check_time, paused) = old_serialisable_info

            checker_options = ClientImportOptions.CheckerOptions(
                intended_files_per_check=8,
                never_faster_than=300,
                never_slower_than=86400,
                death_file_velocity=(1, 86400))

            serialisable_checker_options = checker_options.GetSerialisableTuple(
            )

            files_paused = paused
            checking_paused = paused

            new_serialisable_info = (url, serialisable_file_seed_cache,
                                     urls_to_filenames, urls_to_md5_base64,
                                     serialisable_checker_options,
                                     serialisable_file_import_options,
                                     serialisable_tag_import_options,
                                     last_check_time, files_paused,
                                     checking_paused)

            return (2, new_serialisable_info)

        if version == 2:

            (url, serialisable_file_seed_cache, urls_to_filenames,
             urls_to_md5_base64, serialisable_checker_options,
             serialisable_file_import_options, serialisable_tag_import_options,
             last_check_time, files_paused,
             checking_paused) = old_serialisable_info

            checking_status = ClientImporting.CHECKER_STATUS_OK
            subject = 'unknown subject'

            new_serialisable_info = (url, serialisable_file_seed_cache,
                                     urls_to_filenames, urls_to_md5_base64,
                                     serialisable_checker_options,
                                     serialisable_file_import_options,
                                     serialisable_tag_import_options,
                                     last_check_time, files_paused,
                                     checking_paused, checking_status, subject)

            return (3, new_serialisable_info)

        if version == 3:

            (url, serialisable_file_seed_cache, urls_to_filenames,
             urls_to_md5_base64, serialisable_checker_options,
             serialisable_file_import_options, serialisable_tag_import_options,
             last_check_time, files_paused, checking_paused, checking_status,
             subject) = old_serialisable_info

            no_work_until = 0
            no_work_until_reason = ''

            new_serialisable_info = (url, serialisable_file_seed_cache,
                                     urls_to_filenames, urls_to_md5_base64,
                                     serialisable_checker_options,
                                     serialisable_file_import_options,
                                     serialisable_tag_import_options,
                                     last_check_time, files_paused,
                                     checking_paused, checking_status, subject,
                                     no_work_until, no_work_until_reason)

            return (4, new_serialisable_info)

        if version == 4:

            (url, serialisable_file_seed_cache, urls_to_filenames,
             urls_to_md5_base64, serialisable_checker_options,
             serialisable_file_import_options, serialisable_tag_import_options,
             last_check_time, files_paused, checking_paused, checking_status,
             subject, no_work_until,
             no_work_until_reason) = old_serialisable_info

            creation_time = HydrusData.GetNow()

            new_serialisable_info = (url, serialisable_file_seed_cache,
                                     urls_to_filenames, urls_to_md5_base64,
                                     serialisable_checker_options,
                                     serialisable_file_import_options,
                                     serialisable_tag_import_options,
                                     last_check_time, files_paused,
                                     checking_paused, checking_status, subject,
                                     no_work_until, no_work_until_reason,
                                     creation_time)

            return (5, new_serialisable_info)

        if version == 5:

            (url, serialisable_file_seed_cache, urls_to_filenames,
             urls_to_md5_base64, serialisable_checker_options,
             serialisable_file_import_options, serialisable_tag_import_options,
             last_check_time, files_paused, checking_paused, checking_status,
             subject, no_work_until, no_work_until_reason,
             creation_time) = old_serialisable_info

            gallery_seed_log = ClientImportGallerySeeds.GallerySeedLog()

            serialisable_gallery_seed_log = gallery_seed_log.GetSerialisableTuple(
            )

            new_serialisable_info = (url, serialisable_gallery_seed_log,
                                     serialisable_file_seed_cache,
                                     urls_to_filenames, urls_to_md5_base64,
                                     serialisable_checker_options,
                                     serialisable_file_import_options,
                                     serialisable_tag_import_options,
                                     last_check_time, files_paused,
                                     checking_paused, checking_status, subject,
                                     no_work_until, no_work_until_reason,
                                     creation_time)

            return (6, new_serialisable_info)

        if version == 6:

            (url, serialisable_gallery_seed_log, serialisable_file_seed_cache,
             urls_to_filenames, urls_to_md5_base64,
             serialisable_checker_options, serialisable_file_import_options,
             serialisable_tag_import_options, last_check_time, files_paused,
             checking_paused, checking_status, subject, no_work_until,
             no_work_until_reason, creation_time) = old_serialisable_info

            fixed_service_keys_to_tags = ClientTags.ServiceKeysToTags()

            serialisable_fixed_service_keys_to_tags = fixed_service_keys_to_tags.GetSerialisableTuple(
            )

            new_serialisable_info = (url, serialisable_gallery_seed_log,
                                     serialisable_file_seed_cache,
                                     serialisable_fixed_service_keys_to_tags,
                                     serialisable_checker_options,
                                     serialisable_file_import_options,
                                     serialisable_tag_import_options,
                                     last_check_time, files_paused,
                                     checking_paused, checking_status, subject,
                                     no_work_until, no_work_until_reason,
                                     creation_time)

            return (7, new_serialisable_info)