def _ConvertGallerySeedToListCtrlTuples(self, gallery_seed):

        try:

            gallery_seed_index = self._gallery_seed_log.GetGallerySeedIndex(
                gallery_seed)

        except:

            gallery_seed_index = '--'

        url = gallery_seed.url
        status = gallery_seed.status
        added = gallery_seed.created
        modified = gallery_seed.modified
        note = gallery_seed.note

        pretty_gallery_seed_index = HydrusData.ToHumanInt(gallery_seed_index)
        pretty_url = url
        pretty_status = CC.status_string_lookup[status]
        pretty_added = ClientData.TimestampToPrettyTimeDelta(added)
        pretty_modified = ClientData.TimestampToPrettyTimeDelta(modified)
        pretty_note = note.split(os.linesep)[0]

        display_tuple = (pretty_gallery_seed_index, pretty_url, pretty_status,
                         pretty_added, pretty_modified, pretty_note)
        sort_tuple = (gallery_seed_index, url, status, added, modified, note)

        return (display_tuple, sort_tuple)
Beispiel #2
0
 def GetStatus( self ):
     
     with self._lock:
         
         file_status = self._file_status
         
         if self._checking_status == ClientImporting.CHECKER_STATUS_404:
             
             watcher_status = 'URL 404'
             
         elif self._checking_status == ClientImporting.CHECKER_STATUS_DEAD:
             
             watcher_status = 'URL DEAD'
             
         elif not HydrusData.TimeHasPassed( self._no_work_until ):
             
             no_work_text = self._no_work_until_reason + ' - ' + 'next check ' + ClientData.TimestampToPrettyTimeDelta( self._next_check_time )
             
             file_status = no_work_text
             watcher_status = no_work_text
             
         else:
             
             watcher_status = self._watcher_status
             
         
         return ( file_status, self._files_paused, self._file_velocity_status, self._next_check_time, watcher_status, self._subject, self._checking_status, self._check_now, self._checking_paused )
    def GetNextCheckStatusString(self):

        if self._check_now:

            return 'checking on dialog ok'

        elif self._checker_status == ClientImporting.CHECKER_STATUS_DEAD:

            return 'dead, so not checking'

        else:

            if HydrusData.TimeHasPassed(self._next_check_time):

                s = 'imminent'

            else:

                s = ClientData.TimestampToPrettyTimeDelta(
                    self._next_check_time)

            if self._paused:

                s = 'paused, but would be ' + s

            return s
    def _ConvertFileSeedToListCtrlTuples(self, file_seed):

        try:

            file_seed_index = self._file_seed_cache.GetFileSeedIndex(file_seed)

            pretty_file_seed_index = HydrusData.ToHumanInt(file_seed_index)

        except:

            file_seed_index = '--'

            pretty_file_seed_index = '--'

        file_seed_data = file_seed.file_seed_data
        status = file_seed.status
        added = file_seed.created
        modified = file_seed.modified
        source_time = file_seed.source_time
        note = file_seed.note

        pretty_file_seed_data = str(file_seed_data)
        pretty_status = CC.status_string_lookup[status]
        pretty_added = ClientData.TimestampToPrettyTimeDelta(added)
        pretty_modified = ClientData.TimestampToPrettyTimeDelta(modified)

        if source_time is None:

            pretty_source_time = 'unknown'

        else:

            pretty_source_time = ClientData.TimestampToPrettyTimeDelta(
                source_time)

        sort_source_time = ClientGUIListCtrl.SafeNoneInt(source_time)

        pretty_note = note.split(os.linesep)[0]

        display_tuple = (pretty_file_seed_index, pretty_file_seed_data,
                         pretty_status, pretty_added, pretty_modified,
                         pretty_source_time, pretty_note)
        sort_tuple = (file_seed_index, file_seed_data, status, added, modified,
                      sort_source_time, note)

        return (display_tuple, sort_tuple)
Beispiel #5
0
 def GetSimpleStatus( self ):
     
     with self._lock:
         
         if self._checking_status == ClientImporting.CHECKER_STATUS_404:
             
             return '404'
             
         elif self._checking_status == ClientImporting.CHECKER_STATUS_DEAD:
             
             return 'DEAD'
             
         elif not HydrusData.TimeHasPassed( self._no_work_until ):
             
             return self._no_work_until_reason + ' - ' + 'next check ' + ClientData.TimestampToPrettyTimeDelta( self._next_check_time )
             
         elif self._watcher_status != '' or self._file_status != '':
             
             return 'working'
             
         else:
             
             return ''