galaxy-dist commit 7d3a9212b15e: Enable recently used tools menu to show only tools that are currently in the toolbox.
# HG changeset patch -- Bitbucket.org # Project galaxy-dist # URL http://bitbucket.org/galaxy/galaxy-dist/overview # User jeremy goecks <jeremy.goecks@emory.edu> # Date 1277147965 14400 # Node ID 7d3a9212b15e82327c2af7c3222995f358532d60 # Parent 91d047183110888b3bbcbfc99a0b5f2c38c2d6bf Enable recently used tools menu to show only tools that are currently in the toolbox. --- a/lib/galaxy/web/controllers/root.py +++ b/lib/galaxy/web/controllers/root.py @@ -6,7 +6,6 @@ from cgi import escape, FieldStorage from galaxy import util, datatypes, jobs, web, util from galaxy.web.base.controller import * from galaxy.util.sanitize_html import sanitize_html -from galaxy.util.odict import odict from galaxy.model.orm import * log = logging.getLogger( __name__ ) @@ -33,20 +32,18 @@ class RootController( BaseController, Us else: ## Get most recently used tools. toolbox = self.get_toolbox() - recent_tool_ids = odict() + recent_tools = [] if trans.user: for row in trans.sa_session.query( self.app.model.Job.tool_id ). \ filter( self.app.model.Job.user==trans.user ). \ order_by( self.app.model.Job.create_time.desc() ): tool_id = row[0] - recent_tool_ids[tool_id] = tool_id - ## TODO: make number of recently used tools a user preference. - if len ( recent_tool_ids ) == 5: - break - - # Create list of recently used tools. - recent_tools = [ toolbox.tools_by_id[ tool_id ] for tool_id in recent_tool_ids.keys() ] - + if tool_id in toolbox.tools_by_id: + recent_tools.append( toolbox.tools_by_id[tool_id] ) + ## TODO: make number of recently used tools a user preference. + if len ( recent_tools ) == 5: + break + return trans.fill_template('/root/tool_menu.mako', toolbox=toolbox, recent_tools=recent_tools ) @web.json
participants (1)
-
commits-noreply@bitbucket.org