commit/galaxy-central: greg: Eliminate the use of trans in the tool shed's tool_dependency_util.py module.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/7ded35475477/ Changeset: 7ded35475477 User: greg Date: 2014-07-17 21:49:48 Summary: Eliminate the use of trans in the tool shed's tool_dependency_util.py module. Affected #: 2 files diff -r 027d160ca90a264d1208184488479ec68e999b5d -r 7ded3547547731daa7d09b47bf601ce2f2209513 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py --- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py @@ -169,7 +169,7 @@ message = kwd.get( 'message', '' ) status = kwd.get( 'status', 'done' ) tool_dependency_ids = tool_dependency_util.get_tool_dependency_ids( as_string=False, **kwd ) - tool_dependency = tool_dependency_util.get_tool_dependency( trans, tool_dependency_ids[ 0 ] ) + tool_dependency = tool_dependency_util.get_tool_dependency( trans.app, tool_dependency_ids[ 0 ] ) if tool_dependency.in_error_state: message = "This tool dependency is not installed correctly (see the <b>Tool dependency installation error</b> below). " message += "Choose <b>Uninstall this tool dependency</b> from the <b>Repository Actions</b> menu, correct problems " @@ -806,7 +806,7 @@ tool_dependency_ids = tool_dependency_util.get_tool_dependency_ids( as_string=False, **kwd ) if tool_dependency_ids: # We need a tool_shed_repository, so get it from one of the tool_dependencies. - tool_dependency = tool_dependency_util.get_tool_dependency( trans, tool_dependency_ids[ 0 ] ) + tool_dependency = tool_dependency_util.get_tool_dependency( trans.app, tool_dependency_ids[ 0 ] ) tool_shed_repository = tool_dependency.tool_shed_repository else: # The user must be on the manage_repository_tool_dependencies page and clicked the button to either install or uninstall a @@ -830,7 +830,7 @@ elif operation == 'uninstall': tool_dependencies_for_uninstallation = [] for tool_dependency_id in tool_dependency_ids: - tool_dependency = tool_dependency_util.get_tool_dependency( trans, tool_dependency_id ) + tool_dependency = tool_dependency_util.get_tool_dependency( trans.app, tool_dependency_id ) if tool_dependency.status in [ trans.install_model.ToolDependency.installation_status.INSTALLED, trans.install_model.ToolDependency.installation_status.ERROR ]: tool_dependencies_for_uninstallation.append( tool_dependency ) @@ -845,7 +845,7 @@ if trans.app.config.tool_dependency_dir: tool_dependencies_for_installation = [] for tool_dependency_id in tool_dependency_ids: - tool_dependency = tool_dependency_util.get_tool_dependency( trans, tool_dependency_id ) + tool_dependency = tool_dependency_util.get_tool_dependency( trans.app, tool_dependency_id ) if tool_dependency.status in [ trans.install_model.ToolDependency.installation_status.NEVER_INSTALLED, trans.install_model.ToolDependency.installation_status.UNINSTALLED ]: tool_dependencies_for_installation.append( tool_dependency ) @@ -889,7 +889,7 @@ repository_id = kwd.get( 'repository_id', None ) if tool_dependency_ids: # We need a tool_shed_repository, so get it from one of the tool_dependencies. - tool_dependency = tool_dependency_util.get_tool_dependency( trans, tool_dependency_ids[ 0 ] ) + tool_dependency = tool_dependency_util.get_tool_dependency( trans.app, tool_dependency_ids[ 0 ] ) tool_shed_repository = tool_dependency.tool_shed_repository else: # The user must be on the manage_repository_tool_dependencies page and clicked the button to either install or uninstall a @@ -914,7 +914,7 @@ if trans.app.config.tool_dependency_dir: tool_dependencies_for_installation = [] for tool_dependency_id in tool_dependency_ids: - tool_dependency = tool_dependency_util.get_tool_dependency( trans, tool_dependency_id ) + tool_dependency = tool_dependency_util.get_tool_dependency( trans.app, tool_dependency_id ) if tool_dependency.status in [ trans.install_model.ToolDependency.installation_status.NEVER_INSTALLED, trans.install_model.ToolDependency.installation_status.UNINSTALLED ]: tool_dependencies_for_installation.append( tool_dependency ) @@ -1849,7 +1849,7 @@ tool_dependency_ids = util.listify( kwd.get( 'id', None ) ) tool_dependencies = [] for tool_dependency_id in tool_dependency_ids: - tool_dependency = tool_dependency_util.get_tool_dependency( trans, tool_dependency_id ) + tool_dependency = tool_dependency_util.get_tool_dependency( trans.app, tool_dependency_id ) tool_dependencies.append( tool_dependency ) tool_shed_repository = tool_dependencies[ 0 ].tool_shed_repository if kwd.get( 'uninstall_tool_dependencies_button', False ): diff -r 027d160ca90a264d1208184488479ec68e999b5d -r 7ded3547547731daa7d09b47bf601ce2f2209513 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 @@ -128,9 +128,9 @@ platform_dict[ 'architecture' ] = machine.lower() return platform_dict -def get_tool_dependency( trans, id ): +def get_tool_dependency( app, id ): """Get a tool_dependency from the database via id""" - return trans.install_model.context.query( trans.install_model.ToolDependency ).get( trans.security.decode_id( id ) ) + return app.install_model.context.query( app.install_model.ToolDependency ).get( app.security.decode_id( id ) ) def get_tool_dependency_by_name_type_repository( app, repository, name, type ): context = app.install_model.context 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.
participants (1)
-
commits-noreply@bitbucket.org