def register(self, pattern=None): """Register static gravity fields donwloaded in the data director :param pattern: only register files whose filename obeys this regular expression """ if not pattern: pattern = '.*\.gz' #create a list of files which need to be (re)registered if self.updated: files = self.updated else: files = [ UriFile(file) for file in findFiles(self.dataDir(), pattern) ] #loop over files for uri in files: urilike = os.path.basename(uri.url) if not self.uriNeedsUpdate(urilike, uri.lastmod): continue meta = icgemMetaExtractor(uri) self.addEntry(meta) self.updateInvent()
def register(self): #create a list of files which need to be (re)registered if self.updated: files=self.updated else: files=[UriFile(file) for file in findFiles(self._dbinvent.datadir,'.*gfc.gz',since=self._dbinvent.lastupdate)] newfiles=self.retainnewUris(files) #loop over files for uri in newfiles: slurplogger().info("extracting meta info from %s"%(uri.url)) meta=icgemMetaExtractor(uri) meta=enhanceMeta(meta) self.addEntry(meta) self.updateInvent()
def register(self, pattern=None): if not pattern: pattern = '.*\.gz' #create a list of files which need to be (re)registered if self.updated: files = self.updated else: files = [ UriFile(file) for file in findFiles(self.dataDir(), pattern) ] #loop over files for uri in files: urilike = os.path.basename(uri.url) if not self.uriNeedsUpdate(urilike, uri.lastmod): continue meta = icgemMetaExtractor(uri) self.addEntry(meta) self.updateInvent()