Ejemplo n.º 1
0
 def download_core(self, name, localpath):
     """Download and verify file `name` under context `pipeline_context` to `localpath`."""
     if config.get_download_plugin():
         self.plugin_download(name, localpath)
     else:
         generator = self.get_data_http(name)
         self.generator_download(generator, localpath)
     self.verify_file(name, localpath)
Ejemplo n.º 2
0
 def download_core(self, name, localpath):
     """Download and verify file `name` under context `pipeline_context` to `localpath`."""
     if config.get_download_plugin():
         self.plugin_download(name, localpath)
     else:
         generator = self.get_data_http(name)
         self.generator_download(generator, localpath)
     self.verify_file(name, localpath)
Ejemplo n.º 3
0
 def plugin_download(self, filename, localpath):
     """Run an external program defined by CRDS_DOWNLOAD_PLUGIN to download filename to localpath."""
     url = self.get_url(filename)
     plugin_cmd = config.get_download_plugin()
     plugin_cmd = plugin_cmd.replace("${SOURCE_URL}", url)
     plugin_cmd = plugin_cmd.replace("${OUTPUT_PATH}", localpath)
     log.verbose("Running download plugin:", repr(plugin_cmd))
     status = os.system(plugin_cmd)
     if status != 0:
         if status == 2:
             raise KeyboardInterrupt("Interrupted plugin.")
         else:
             raise CrdsDownloadError(
                 "Plugin download fail status =", repr(status),
                 "with command:", srepr(plugin_cmd))
Ejemplo n.º 4
0
 def plugin_download(self, filename, localpath):
     """Run an external program defined by CRDS_DOWNLOAD_PLUGIN to download filename to localpath."""
     url = self.get_url(filename)
     plugin_cmd = config.get_download_plugin()
     plugin_cmd = plugin_cmd.replace("${SOURCE_URL}", url)
     plugin_cmd = plugin_cmd.replace("${OUTPUT_PATH}", localpath)
     log.verbose("Running download plugin:", repr(plugin_cmd))
     status = os.system(plugin_cmd)
     if status != 0:
         if status == 2:
             raise KeyboardInterrupt("Interrupted plugin.")
         else:
             raise CrdsDownloadError(
                 "Plugin download fail status =", repr(status),
                 "with command:", srepr(plugin_cmd))