1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/ac80dbfe7703/ Changeset: ac80dbfe7703 User: greg Date: 2013-03-26 16:41:49 Summary: Fix tool shed utility file imports and withe space to follow new Galaxy dev team coding standards. Affected #: 12 files diff -r 504264153fe1804c409c775be2c6db3f160b8fe2 -r ac80dbfe7703102ff152760419361a55d3eb0f6f lib/tool_shed/util/common_install_util.py --- a/lib/tool_shed/util/common_install_util.py +++ b/lib/tool_shed/util/common_install_util.py @@ -1,17 +1,25 @@ -import os, logging, urllib2 -import tool_shed.util.shed_util_common as suc -from tool_shed.util import encoding_util, data_manager_util, datatype_util, tool_util -from tool_shed.galaxy_install.tool_dependencies.install_util import install_package, set_environment +import logging +import os +import urllib2 +from galaxy import eggs from galaxy import util from galaxy.util import json from galaxy.webapps.tool_shed.util import container_util +import tool_shed.util.shed_util_common as suc +from tool_shed.util import encoding_util +from tool_shed.util import data_manager_util +from tool_shed.util import datatype_util +from tool_shed.util import tool_util +from tool_shed.galaxy_install.tool_dependencies.install_util import install_package +from tool_shed.galaxy_install.tool_dependencies.install_util import set_environment -from galaxy import eggs import pkg_resources pkg_resources.require( 'elementtree' ) -from elementtree import ElementTree, ElementInclude -from elementtree.ElementTree import Element, SubElement +from elementtree import ElementTree +from elementtree import ElementInclude +from elementtree.ElementTree import Element +from elementtree.ElementTree import SubElement log = logging.getLogger( __name__ ) diff -r 504264153fe1804c409c775be2c6db3f160b8fe2 -r ac80dbfe7703102ff152760419361a55d3eb0f6f lib/tool_shed/util/common_util.py --- a/lib/tool_shed/util/common_util.py +++ b/lib/tool_shed/util/common_util.py @@ -1,4 +1,5 @@ -import os, urllib2 +import os +import urllib2 from galaxy import util from galaxy.util.odict import odict from tool_shed.util import encoding_util @@ -63,6 +64,7 @@ exception_msg += 'The entry for this tool shed must always be available in this file, so re-add it before attempting to start your Galaxy server.\n' raise Exception( exception_msg ) return tool_shed_accessible, missing_tool_configs_dict + def check_tool_tag_set( elem, migrated_tool_configs_dict, missing_tool_configs_dict ): file_path = elem.get( 'file', None ) if file_path: @@ -71,6 +73,7 @@ tool_dependencies = migrated_tool_configs_dict[ name ] missing_tool_configs_dict[ name ] = tool_dependencies return missing_tool_configs_dict + def get_non_shed_tool_panel_configs( app ): # Get the non-shed related tool panel configs - there can be more than one, and the default is tool_conf.xml. config_filenames = [] @@ -83,6 +86,7 @@ if tool_path is None: config_filenames.append( config_filename ) return config_filenames + def get_tool_shed_url_from_tools_xml_file_path( app, tool_shed ): search_str = '://%s' % tool_shed for shed_name, shed_url in app.tool_shed_registry.tool_sheds.items(): diff -r 504264153fe1804c409c775be2c6db3f160b8fe2 -r ac80dbfe7703102ff152760419361a55d3eb0f6f lib/tool_shed/util/data_manager_util.py --- a/lib/tool_shed/util/data_manager_util.py +++ b/lib/tool_shed/util/data_manager_util.py @@ -1,4 +1,5 @@ -import os, logging +import logging +import os from galaxy import util import tool_shed.util.shed_util_common as suc diff -r 504264153fe1804c409c775be2c6db3f160b8fe2 -r ac80dbfe7703102ff152760419361a55d3eb0f6f lib/tool_shed/util/datatype_util.py --- a/lib/tool_shed/util/datatype_util.py +++ b/lib/tool_shed/util/datatype_util.py @@ -1,13 +1,17 @@ -import os, logging, tempfile +import logging +import os +import tempfile +from galaxy import eggs +from galaxy import util import tool_shed.util.shed_util_common as suc -from galaxy import util -from galaxy import eggs import pkg_resources pkg_resources.require( 'elementtree' ) -from elementtree import ElementTree, ElementInclude -from elementtree.ElementTree import Element, SubElement +from elementtree import ElementTree +from elementtree import ElementInclude +from elementtree.ElementTree import Element +from elementtree.ElementTree import SubElement log = logging.getLogger( __name__ ) diff -r 504264153fe1804c409c775be2c6db3f160b8fe2 -r ac80dbfe7703102ff152760419361a55d3eb0f6f lib/tool_shed/util/encoding_util.py --- a/lib/tool_shed/util/encoding_util.py +++ b/lib/tool_shed/util/encoding_util.py @@ -1,8 +1,9 @@ -import binascii, logging +import binascii +import logging +from galaxy import eggs from galaxy.util.hash_util import hmac_new from galaxy.util.json import json_fix -from galaxy import eggs import pkg_resources pkg_resources.require( "simplejson" ) @@ -34,6 +35,7 @@ if values is None: values = value return values + def tool_shed_encode( val ): if isinstance( val, dict ): value = simplejson.dumps( val ) diff -r 504264153fe1804c409c775be2c6db3f160b8fe2 -r ac80dbfe7703102ff152760419361a55d3eb0f6f lib/tool_shed/util/metadata_util.py --- a/lib/tool_shed/util/metadata_util.py +++ b/lib/tool_shed/util/metadata_util.py @@ -1,21 +1,32 @@ -import os, tempfile, logging, urllib2 -from galaxy import web, util -from galaxy.util import inflector, json +import logging +import os +import tempfile +import urllib2 +from galaxy import eggs +from galaxy import util +from galaxy import web +from galaxy.datatypes import checkers +from galaxy.model.orm import and_ +from galaxy.tools.data_manager.manager import DataManager +from galaxy.util import inflector +from galaxy.util import json from galaxy.webapps.tool_shed.util import container_util -from galaxy.datatypes import checkers -from galaxy.tools.data_manager.manager import DataManager import tool_shed.util.shed_util_common as suc -from tool_shed.util import common_install_util, readme_util, tool_dependency_util, tool_util -from galaxy.model.orm import and_ +from tool_shed.util import common_install_util +from tool_shed.util import readme_util +from tool_shed.util import tool_dependency_util +from tool_shed.util import tool_util -from galaxy import eggs import pkg_resources pkg_resources.require( 'mercurial' ) -from mercurial import hg, ui, commands +from mercurial import commands +from mercurial import hg +from mercurial import ui pkg_resources.require( 'elementtree' ) -from elementtree import ElementTree, ElementInclude +from elementtree import ElementTree +from elementtree import ElementInclude log = logging.getLogger( __name__ ) diff -r 504264153fe1804c409c775be2c6db3f160b8fe2 -r ac80dbfe7703102ff152760419361a55d3eb0f6f lib/tool_shed/util/readme_util.py --- a/lib/tool_shed/util/readme_util.py +++ b/lib/tool_shed/util/readme_util.py @@ -1,6 +1,8 @@ -import os, logging, urllib2 +import logging +import os +import urllib2 +from galaxy.util import json import tool_shed.util.shed_util_common as suc -from galaxy.util import json log = logging.getLogger( __name__ ) diff -r 504264153fe1804c409c775be2c6db3f160b8fe2 -r ac80dbfe7703102ff152760419361a55d3eb0f6f lib/tool_shed/util/repository_dependency_util.py --- a/lib/tool_shed/util/repository_dependency_util.py +++ b/lib/tool_shed/util/repository_dependency_util.py @@ -1,14 +1,20 @@ -import os, logging +import logging +import os +from galaxy import eggs from galaxy.util import json +from galaxy.webapps.tool_shed.util import container_util import tool_shed.util.shed_util_common as suc -from tool_shed.util import common_install_util, encoding_util, metadata_util, tool_util -from galaxy.webapps.tool_shed.util import container_util +from tool_shed.util import common_install_util +from tool_shed.util import encoding_util +from tool_shed.util import metadata_util +from tool_shed.util import tool_util -from galaxy import eggs import pkg_resources pkg_resources.require( 'mercurial' ) -from mercurial import hg, ui, commands +from mercurial import commands +from mercurial import hg +from mercurial import ui log = logging.getLogger( __name__ ) diff -r 504264153fe1804c409c775be2c6db3f160b8fe2 -r ac80dbfe7703102ff152760419361a55d3eb0f6f lib/tool_shed/util/review_util.py --- a/lib/tool_shed/util/review_util.py +++ b/lib/tool_shed/util/review_util.py @@ -1,13 +1,16 @@ -import os, logging +import logging +import os +from galaxy import eggs +from galaxy.model.orm import and_ from galaxy.util.odict import odict import tool_shed.util.shed_util_common as suc -from galaxy.model.orm import and_ -from galaxy import eggs import pkg_resources pkg_resources.require( 'mercurial' ) -from mercurial import hg, ui, commands +from mercurial import commands +from mercurial import hg +from mercurial import ui log = logging.getLogger( __name__ ) diff -r 504264153fe1804c409c775be2c6db3f160b8fe2 -r ac80dbfe7703102ff152760419361a55d3eb0f6f lib/tool_shed/util/tool_dependency_util.py --- a/lib/tool_shed/util/tool_dependency_util.py +++ b/lib/tool_shed/util/tool_dependency_util.py @@ -1,15 +1,14 @@ import logging import os import shutil - from galaxy import eggs -eggs.require( 'elementtree' ) -from elementtree import ElementTree, ElementInclude - +from galaxy import util from galaxy.model.orm import and_ import tool_shed.util.shed_util_common as suc -from galaxy import util +eggs.require( 'elementtree' ) +from elementtree import ElementTree +from elementtree import ElementInclude log = logging.getLogger( __name__ ) diff -r 504264153fe1804c409c775be2c6db3f160b8fe2 -r ac80dbfe7703102ff152760419361a55d3eb0f6f lib/tool_shed/util/tool_util.py --- a/lib/tool_shed/util/tool_util.py +++ b/lib/tool_shed/util/tool_util.py @@ -4,6 +4,7 @@ import shutil import tempfile import galaxy.tools +from galaxy import eggs from galaxy import util from galaxy.datatypes import checkers from galaxy.model.orm import and_ @@ -13,15 +14,18 @@ from galaxy.web.form_builder import SelectField import tool_shed.util.shed_util_common as suc -from galaxy import eggs import pkg_resources pkg_resources.require( 'mercurial' ) -from mercurial import hg, ui, commands +from mercurial import commands +from mercurial import hg +from mercurial import ui pkg_resources.require( 'elementtree' ) -from elementtree import ElementTree, ElementInclude -from elementtree.ElementTree import Element, SubElement +from elementtree import ElementTree +from elementtree import ElementInclude +from elementtree.ElementTree import Element +from elementtree.ElementTree import SubElement log = logging.getLogger( __name__ ) diff -r 504264153fe1804c409c775be2c6db3f160b8fe2 -r ac80dbfe7703102ff152760419361a55d3eb0f6f lib/tool_shed/util/workflow_util.py --- a/lib/tool_shed/util/workflow_util.py +++ b/lib/tool_shed/util/workflow_util.py @@ -1,19 +1,25 @@ +import logging +import galaxy.tools +import galaxy.tools.parameters +import galaxy.webapps.galaxy.controllers.workflow from galaxy import eggs +from galaxy.util import json +from galaxy.workflow.modules import InputDataModule +from galaxy.workflow.modules import ToolModule +from galaxy.workflow.modules import WorkflowModuleFactory +import tool_shed.util.shed_util_common as suc +from tool_shed.util import encoding_util +from tool_shed.util import metadata_util +from tool_shed.util import tool_util + import pkg_resources pkg_resources.require( "SVGFig" ) - -import logging, svgfig -from galaxy.util import json -import tool_shed.util.shed_util_common as suc -from tool_shed.util import encoding_util, metadata_util, tool_util -from galaxy.workflow.modules import InputDataModule, ToolModule, WorkflowModuleFactory -import galaxy.webapps.galaxy.controllers.workflow -import galaxy.tools -import galaxy.tools.parameters +import svgfig log = logging.getLogger( __name__ ) + class RepoInputDataModule( InputDataModule ): type = "data_input" @@ -24,12 +30,14 @@ module = Class( trans ) module.state = dict( name="Input Dataset" ) return module + @classmethod def from_dict( Class, trans, repository_id, changeset_revision, step_dict, tools_metadata=None, secure=True ): module = Class( trans ) state = json.from_json_string( step_dict[ "tool_state" ] ) module.state = dict( name=state.get( "name", "Input Dataset" ) ) return module + @classmethod def from_workflow_step( Class, trans, repository_id, changeset_revision, tools_metadata, step ): module = Class( trans ) @@ -38,6 +46,7 @@ module.state[ 'name' ] = step.tool_inputs[ 'name' ] return module + class RepoToolModule( ToolModule ): type = "tool" @@ -64,11 +73,13 @@ self.post_job_actions = {} self.workflow_outputs = [] self.state = None + @classmethod def new( Class, trans, repository_id, changeset_revision, tools_metadata, tool_id=None ): module = Class( trans, repository_id, changeset_revision, tools_metadata, tool_id ) module.state = module.tool.new_state( trans, all_pages=True ) return module + @classmethod def from_dict( Class, trans, repository_id, changeset_revision, step_dict, tools_metadata, secure=True ): tool_id = step_dict[ 'tool_id' ] @@ -78,6 +89,7 @@ module.state.decode( step_dict[ "tool_state" ], module.tool, module.trans.app, secure=secure ) module.errors = step_dict.get( "tool_errors", None ) return module + @classmethod def from_workflow_step( Class, trans, repository_id, changeset_revision, tools_metadata, step ): module = Class( trans, repository_id, changeset_revision, tools_metadata, step.tool_id ) @@ -88,6 +100,7 @@ module.state.inputs = {} module.errors = step.tool_errors return module + def get_data_inputs( self ): data_inputs = [] def callback( input, value, prefixed_name, prefixed_label ): @@ -98,6 +111,7 @@ if self.tool: galaxy.tools.parameters.visit_input_values( self.tool.inputs, self.state.inputs, callback ) return data_inputs + def get_data_outputs( self ): data_outputs = [] if self.tool: @@ -124,18 +138,23 @@ data_outputs.append( dict( name=name, extensions=formats ) ) return data_outputs + class RepoWorkflowModuleFactory( WorkflowModuleFactory ): + def __init__( self, module_types ): self.module_types = module_types + def new( self, trans, type, tools_metadata=None, tool_id=None ): """Return module for type and (optional) tool_id initialized with new / default state.""" assert type in self.module_types return self.module_types[type].new( trans, tool_id ) + def from_dict( self, trans, repository_id, changeset_revision, step_dict, **kwd ): """Return module initialized from the data in dictionary `step_dict`.""" type = step_dict[ 'type' ] assert type in self.module_types return self.module_types[ type ].from_dict( trans, repository_id, changeset_revision, step_dict, **kwd ) + def from_workflow_step( self, trans, repository_id, changeset_revision, tools_metadata, step ): """Return module initialized from the WorkflowStep object `step`.""" type = step.type @@ -292,6 +311,7 @@ canvas[ 'viewBox' ] = "0 0 %s %s" % ( width, height ) trans.response.set_content_type( "image/svg+xml" ) return canvas.standalone_xml() + def get_workflow_data_inputs( step, module ): if module.type == 'tool': if module.tool: @@ -306,6 +326,7 @@ data_inputs.append( data_inputs_dict ) return data_inputs return module.get_data_inputs() + def get_workflow_data_outputs( step, module, steps ): if module.type == 'tool': if module.tool: @@ -329,6 +350,7 @@ data_outputs.append( data_outputs_dict ) return data_outputs return module.get_data_outputs() + def get_workflow_from_dict( trans, workflow_dict, tools_metadata, repository_id, changeset_revision ): """ Return an in-memory Workflow object from the dictionary object created when it was exported. This method is called from @@ -383,6 +405,7 @@ galaxy.webapps.galaxy.controllers.workflow.attach_ordered_steps( workflow, steps ) # Return the in-memory Workflow object for display or later persistence to the Galaxy database. return workflow, missing_tool_tups + def get_workflow_module_name( module, missing_tool_tups ): module_name = module.get_name() if module.type == 'tool' and module_name == 'unavailable': @@ -392,6 +415,7 @@ module_name = '%s' % missing_tool_name break return module_name + def save_workflow( trans, workflow ): """Use the received in-memory Workflow object for saving to the Galaxy database.""" stored = trans.model.StoredWorkflow() Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.