Пример #1
0
                                                 **module_method_kwds)

    def from_workflow_step(self, trans, repository_id, changeset_revision,
                           tools_metadata, step):
        """Return module initialized from the WorkflowStep object `step`."""
        type = step.type
        module_method_kwds = dict()
        if type == "tool":
            module_method_kwds['repository_id'] = repository_id
            module_method_kwds['changeset_revision'] = changeset_revision
            module_method_kwds['tools_metadata'] = tools_metadata
        return self.module_types[type].from_workflow_step(
            trans, step, **module_method_kwds)


tool_shed_module_types = module_types.copy()
tool_shed_module_types['tool'] = RepoToolModule
module_factory = RepoWorkflowModuleFactory(tool_shed_module_types)


def generate_workflow_image(trans,
                            workflow_name,
                            repository_metadata_id=None,
                            repository_id=None):
    """
    Return an svg image representation of a workflow dictionary created when the workflow was exported.  This method is called
    from both Galaxy and the tool shed.  When called from the tool shed, repository_metadata_id will have a value and repository_id
    will be None.  When called from Galaxy, repository_metadata_id will be None and repository_id will have a value.
    """
    workflow_name = encoding_util.tool_shed_decode(workflow_name)
    if trans.webapp.name == 'tool_shed':
Пример #2
0
            module_method_kwds[ 'repository_id' ] = repository_id
            module_method_kwds[ 'changeset_revision' ] = changeset_revision
            module_method_kwds[ 'tools_metadata' ] = tools_metadata
        return self.module_types[ type ].from_dict( trans, step_dict, **module_method_kwds )

    def from_workflow_step( self, trans, repository_id, changeset_revision, tools_metadata, step ):
        """Return module initialized from the WorkflowStep object `step`."""
        type = step.type
        module_method_kwds = dict( )
        if type == "tool":
            module_method_kwds[ 'repository_id' ] = repository_id
            module_method_kwds[ 'changeset_revision' ] = changeset_revision
            module_method_kwds[ 'tools_metadata' ] = tools_metadata
        return self.module_types[ type ].from_workflow_step( trans, step, **module_method_kwds )

tool_shed_module_types = module_types.copy()
tool_shed_module_types[ 'tool' ] = RepoToolModule
module_factory = RepoWorkflowModuleFactory( tool_shed_module_types )


def generate_workflow_image( trans, workflow_name, repository_metadata_id=None, repository_id=None ):
    """
    Return an svg image representation of a workflow dictionary created when the workflow was exported.  This method is called
    from both Galaxy and the tool shed.  When called from the tool shed, repository_metadata_id will have a value and repository_id
    will be None.  When called from Galaxy, repository_metadata_id will be None and repository_id will have a value.
    """
    workflow_name = encoding_util.tool_shed_decode( workflow_name )
    if trans.webapp.name == 'tool_shed':
        # We're in the tool shed.
        repository_metadata = metadata_util.get_repository_metadata_by_id( trans.app, repository_metadata_id )
        repository_id = trans.security.encode_id( repository_metadata.repository_id )