Ejemplo n.º 1
0
 def download(self):
     if self.uri.startswith('http'):
         uri=http(self.uri,lastmod=self.meta['lastupdate'])
     elif self.uri.startswith('ftp'):
         uri=ftp(self.uri)
         uri.updateModTime()
     uri.download(self.direc,check=True,outfile=self.fout)
Ejemplo n.º 2
0
 def pull(self):
     """pulls the station catalogue as excel file """
     downloaddir=self.cacheDir()
     urif,upd=ftp("ftp://ftp.bafg.de/pub/REFERATE/GRDC/catalogue/grdc_stations.zip").download(downloaddir)
     if upd:
         with ZipFile(urif.url,'r') as zp:
                 zp.extractall(downloaddir)
Ejemplo n.º 3
0
    def pull(self):
        """Pulls the entire GSHHG archive from the ftp server"""
        url = 'ftp://ftp.soest.hawaii.edu/gshhg/gshhg-shp-%d.%d.%d.zip' % self.gshhgversion
        geturi = ftp(url, lastmod=datetime(2017, 6, 15))

        furi, upd = geturi.download(self.cache, True)
        if upd:
            with ZipFile(furi.url, 'r') as zp:
                zp.extractall(self.cache)
            self.updateInvent(False)
Ejemplo n.º 4
0
 def __init__(self, dbconn):
     super().__init__(dbconn)
     self.cache = self.conf.getCacheDir(self.scheme, subdirs="GSHHG")
     self.ogrfile = os.path.join(self.cache, self.path)
     self.ftpt = ftp('ftp://ftp.soest.hawaii.edu/gshhg/')
     if self._dbinvent.data:
         self._dbinvent.data["GSHHGversion"] = tuple(
             self._dbinvent.data["GSHHGversion"])
     else:
         self._dbinvent.data["GSHHGversion"] = self.gshhgversion
Ejemplo n.º 5
0
 def pull(self):
     auth = self.conf.authCred("sebs")
     downdir = self.cacheDir()
     files = [
         "EB-ET/EB-ET_v2/Global_land_monthly_ET_V2.rar", "Latitude.mat",
         "Longitude.mat"
     ]
     ftproot = "ftp://210.72.14.198/"
     for f in files:
         ftpfile = ftp(ftproot + f, auth=auth, lastmod=datetime(2022, 6, 1))
         uri, updated = ftpfile.download(downdir, check=True)
Ejemplo n.º 6
0
 def pull(self):
     """Pulls the C20 Technical note 14"""
     uri=ftp(self.rooturl+self.fout,lastmod=datetime(2019,12,1)).download(self.cacheDir(),check=True)