def download(self, url, secondary_files=None, prompt=True): npath = to_abspath(self._download(url, metasearch=True)) rbx_path = npath + '.rbx.json' if isfile(rbx_path): file_dict = from_url(rbx_path) startdir = dirname(npath) file_dict['path'] = npath file = File(file_dict) file.secondary_files = [ File( self._download( URL(to_abspath(sf.path, startdir)), metasearch=False)) for sf in file.secondary_files ] else: file = File(npath) file.meta = self._meta(npath, prompt=prompt) if secondary_files: file.secondary_files = self._get_secondary_files( secondary_files, url, prompt=prompt) if prompt: self._rbx_dump(file) return file
def download(self, url, secondary_files=None, prompt=True): npath = to_abspath(self._download(url, metasearch=True)) rbx_path = npath + '.rbx.json' if isfile(rbx_path): file_dict = from_url(rbx_path) startdir = dirname(npath) file_dict['path'] = npath file = FileConstructor()(file_dict) file.secondary_files = [ File( self._download( URL(to_abspath(sf.path, startdir)), metasearch=False)) for sf in file.secondary_files ] else: file = File(npath) file.meta = self._meta(npath, prompt=prompt) if secondary_files: file.secondary_files = self._get_secondary_files( secondary_files, url, prompt=prompt) if prompt: self._rbx_dump(file) return file
def secondary_files(p, outputBinding, evaluator): secondaryFiles = [] secFiles = wrap_in_list(evaluator.resolve(outputBinding.get('secondaryFiles', []))) for s in secFiles: path = sec_files_naming_conv(p, s) secondaryFiles.append({'path': to_abspath(path)}) return secondaryFiles
def secondary_files(p, outputBinding, evaluator): secondaryFiles = [] secFiles = wrap_in_list( evaluator.resolve(outputBinding.get('secondaryFiles', []))) for s in secFiles: path = sec_files_naming_conv(p, s) secondaryFiles.append({'path': to_abspath(path)}) return secondaryFiles
def do_rebase(v): if isinstance(v, dict): v['path'] = to_abspath(v['path'], base) return v return to_abspath(v, base)