예제 #1
0
def uris_to_paths(ctx, uris):
    fetcher = ToolLocationFetcher()
    paths = []
    for uri in uris:
        path = fetcher.to_tool_path(uri)
        paths.append(path)
    return paths
예제 #2
0
파일: tools.py 프로젝트: simonbray/planemo
def uris_to_paths(ctx, uris):
    """Fetch multiple URIs to a local path."""
    fetcher = ToolLocationFetcher()
    paths = []
    for uri in uris:
        path = fetcher.to_tool_path(uri)
        paths.append(path)
    return paths
예제 #3
0
 def load_tool_from_config(self, repository_id, full_path):
     tool_source = get_tool_source(
         full_path,
         enable_beta_formats=getattr(self.app.config,
                                     "enable_beta_tool_formats", False),
         tool_location_fetcher=ToolLocationFetcher(),
     )
     try:
         tool = create_tool_from_source(config_file=full_path,
                                        app=self.app,
                                        tool_source=tool_source,
                                        repository_id=repository_id,
                                        allow_code_files=False)
         tool.assert_finalized(raise_if_invalid=True)
         valid = True
         error_message = None
     except KeyError as e:
         tool = None
         valid = False
         error_message = 'This file requires an entry for "%s" in the tool_data_table_conf.xml file.  Upload a file ' % str(
             e)
         error_message += 'named tool_data_table_conf.xml.sample to the repository that includes the required entry to correct '
         error_message += 'this error.  '
         log.exception(error_message)
     except Exception as e:
         tool = None
         valid = False
         error_message = str(e)
         log.exception('Caught exception loading tool from %s:', full_path)
     return tool, valid, error_message
예제 #4
0
파일: tools.py 프로젝트: simonbray/planemo
def uri_to_path(ctx, uri):
    """Fetch URI to a local path."""
    fetcher = ToolLocationFetcher()
    return fetcher.to_tool_path(uri)
예제 #5
0
def uri_to_path(ctx, uri):
    fetcher = ToolLocationFetcher()
    return fetcher.to_tool_path(uri)