Logo Search packages:      
Sourcecode: harvestman version File versions  Download package

def HarvestMan::datamgr::harvestManDataManager::update_file_stats (   self,
  urlObject,
  status 
)

Add the passed information to the saved file list 

Definition at line 399 of file datamgr.py.

00399                                                   :
        """ Add the passed information to the saved file list """

        if not urlObject: return -1

        # Bug: we should be getting this url as rooturl and not
        # the base url of this url.
        filename = urlObject.get_full_filename()

        ok=False

        # Status == 1 or 2 means look up in "_savedfiles"
        # Status == 3 means look up in "_reposfiles"
        # Status == 4 means look up in "_cachefiles"
        lookuplist=[]
        if status == 1 or status == 2:
            lookuplist = self._downloaddict['_savedfiles']
        elif status == 3:
            lookuplist = self._downloaddict['_reposfiles']
        elif status == 4:
            lookuplist = self._downloaddict['_cachefiles']            
        else:
            return -1

        for x in lookuplist:
            # Already added
            if x[0] == filename:
                ok=True
                break

        # If this was present in failed urls list, remove it
        try:
            self._downloaddict['_failedurls'].index(urlObject)
            self._downloaddict['_failedurls'].remove(urlObject)
        except:
            pass
            
        if not ok:
            lookuplist.append( filename )

        return 0
    


Generated by  Doxygen 1.6.0   Back to index