Logo Search packages:      
Sourcecode: rapid-photo-downloader version File versions  Download package

def rapid::rapid::CopyPhotos::initializeFromPrefs (   self,
  notifyOnError 
)

Setup thread so that user preferences are handled

Definition at line 1719 of file rapid.py.

01719                                                 :
        """
        Setup thread so that user preferences are handled
        """
        
        def checkPrefs(prefsFactory):
            try:
                prefsFactory.checkPrefsForValidity()
            except (rn.PrefValueInvalidError, rn.PrefLengthError, 
                    rn.PrefValueKeyComboError, rn.PrefKeyError), e:
                if notifyOnError:
                    self.handlePreferencesError(e, prefsFactory)
                raise rn.PrefError
                
        self.prefs = self.parentApp.prefs
        
        #Image and Video filename preferences
        sample_download_start_time = datetime.datetime.now()

        self.imageRenamePrefsFactory = rn.ImageRenamePreferences(self.prefs.image_rename, self, 
                                                                 self.fileSequenceLock, sequences)
        self.imageRenamePrefsFactory.setDownloadStartTime(sample_download_start_time)
        checkPrefs(self.imageRenamePrefsFactory)
           
        self.videoRenamePrefsFactory = rn.VideoRenamePreferences(self.prefs.video_rename, self, 
                                                                 self.fileSequenceLock, sequences)
        self.videoRenamePrefsFactory.setDownloadStartTime(sample_download_start_time)
        checkPrefs(self.videoRenamePrefsFactory)
        
        #Image and Video subfolder preferences

        self.subfolderPrefsFactory = rn.SubfolderPreferences(self.prefs.subfolder, self)
        self.subfolderPrefsFactory.setDownloadStartTime(sample_download_start_time)
        checkPrefs(self.subfolderPrefsFactory)

        self.videoSubfolderPrefsFactory = rn.VideoSubfolderPreferences(self.prefs.video_subfolder, self)
        self.videoSubfolderPrefsFactory.setDownloadStartTime(sample_download_start_time)
        checkPrefs(self.videoSubfolderPrefsFactory)
        
        # copy this variable, as it is used heavily in the loop
        # and it is perhaps relatively expensive to read
        self.stripCharacters = self.prefs.strip_characters

    def run(self):


Generated by  Doxygen 1.6.0   Back to index