示例#1
0
 def export_folder(self, folder, destination, fmt=CONSTS.TEXT_FMT):
     """ Export the cache files contained in a folder """
     (self.files, startindex, end) = get_files_from_cache_folder(folder)
     self.destination_folder = destination
     self.state = self.STOP
     self.files_processed = 0
     self.t1 = 0
     self.t2 = 0
     self.fmt = fmt
     self._start()
 def export_folder( self, folder, destination, fmt=CONSTS.TEXT_FMT ):    
     """ Export the cache files contained in a folder """
     (self.files,startindex,end) = get_files_from_cache_folder( folder )
     self.destination_folder = destination
     self.state = self.STOP
     self.files_processed = 0
     self.t1 = 0
     self.t2 = 0
     self.fmt = fmt
     self._start()
示例#3
0
    def dropEvent(self, e):
        """ Load valid icecache files from event """
        self._statusbar.clearMessage()
        files = []
        for url in e.mimeData().urls():
            f = url.toLocalFile()
            
            if os.path.isfile( f ):                
                files.append( f )            
            elif os.path.isdir( f ):
                t = get_files_from_cache_folder( f )
                if t != ():
                    (files,st,end) = t
                break
            else: 
                self._statusbar.showMessage( 'Error - Invalid file: %s\n' % f )

        # Performs a basic file extention test just to make sure we have valid files to load
        files_to_load = [ f for f in files if is_valid_file( f ) == True ]
        
        if len(files_to_load):
            self.load_files( files_to_load )
        else:
            self._statusbar.showMessage( 'Error - Invalid file' )
示例#4
0
 def load_files_from_folder(self, dir ):
     """ Load all cache files located in dir """        
     (files,startcache,endcache) = get_files_from_cache_folder( dir )
     self._load_icecache_files( files, startcache, endcache )