Skip to content

Commit

Permalink
Merge branch 'dev' of git://github.com/galaxyproject/galaxy into repo…
Browse files Browse the repository at this point in the history
…_queue_sharing
  • Loading branch information
davebx committed Aug 30, 2016
2 parents 5b65f12 + 5ebdefe commit d9d3f25
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 16 deletions.
2 changes: 1 addition & 1 deletion doc/source/admin/chat.rst
Expand Up @@ -115,7 +115,7 @@ This service does not:

- enforce rate-limiting of messages
- run any sort of text/obscenity filtering rules
- prevent user spoofing is the user is an administrator and impersonating
- prevent user spoofing if the user is an administrator and impersonating
another user

Keeping the Chat Server Running
Expand Down
4 changes: 2 additions & 2 deletions doc/source/admin/conda_faq.rst
Expand Up @@ -274,7 +274,7 @@ install new tools, even if ``conda_auto_install`` is disabled.

More improvements to the UI will be coming in future releases. To see if Galaxy
has created a Trinity environment for you have a look at folder under
``<tool_dependency_dir>/_conda/envs/``.
``<tool_dependency_dir>/_conda/envs/``(or ``<conda_prefix>/envs`` if you have changed `conda_prefix` in your galaxy.ini file).


12. Can I mix traditional Galaxy packages and Conda packages?
Expand Down Expand Up @@ -314,7 +314,7 @@ following in your galaxy log files:
In rare cases Conda may not have been properly installed by Galaxy.
A symptom for this is if there is no activate script in
``conda_prefix/bin`` folder. In that case you can delete the ``conda_prefix`` folder
``<conda_prefix>/bin`` folder. In that case you can delete the ``conda_prefix`` folder
and restart Galaxy, which will again attempt to install Conda.

If this does not solve your problem or you have any trouble following
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/tools/deps/conda_util.py
Expand Up @@ -31,9 +31,9 @@

def conda_link():
if IS_OS_X:
url = "https://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh"
url = "https://repo.continuum.io/miniconda/Miniconda2-4.0.5-MacOSX-x86_64.sh"
else:
url = "https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh"
url = "https://repo.continuum.io/miniconda/Miniconda2-4.0.5-Linux-x86_64.sh"
return url


Expand Down
5 changes: 5 additions & 0 deletions lib/galaxy/tools/toolbox/base.py
Expand Up @@ -392,6 +392,11 @@ def get_tool( self, tool_id, tool_version=None, get_all_versions=False, exact=Fa
return self._tool_versions_by_id[ tool_id ][ tool_version ]
# tool_id exactly matches an available tool by id (which is 'old' tool_id or guid)
return self._tools_by_id[ tool_id ]
elif exact:
# We're looking for an exact match, so we skip lineage and
# versionless mapping, though we may want to check duplicate
# toolsheds
continue
# exact tool id match not found, or all versions requested, search for other options, e.g. migrated tools or different versions
rval = []
tool_lineage = self._lineage_map.get( tool_id )
Expand Down
28 changes: 24 additions & 4 deletions lib/galaxy/web/framework/webapp.py
Expand Up @@ -660,7 +660,7 @@ def handle_user_login( self, user ):
users_last_session.current_history.deleted):
history = users_last_session.current_history
elif not history:
history = self.get_history( create=True )
history = self.get_history( create=True, most_recent=True )
if history not in self.galaxy_session.histories:
self.galaxy_session.add_history( history )
if history.user is None:
Expand Down Expand Up @@ -708,17 +708,20 @@ def get_galaxy_session( self ):
"""
return self.galaxy_session

def get_history( self, create=False ):
def get_history( self, create=False, most_recent=False ):
"""
Load the current history, creating a new one only if there is not
current history and we're told to create.
Load the current history.
- If that isn't available, we find the most recently updated history.
- If *that* isn't available, we get or create the default history.
Transactions will not always have an active history (API requests), so
None is a valid response.
"""
history = None
if self.galaxy_session:
if hasattr( self.galaxy_session, 'current_history' ):
history = self.galaxy_session.current_history
if not history and most_recent:
history = self.get_most_recent_history()
if not history and util.string_as_bool( create ):
history = self.get_or_create_default_history()
return history
Expand Down Expand Up @@ -764,6 +767,23 @@ def get_or_create_default_history( self ):

return history

def get_most_recent_history( self ):
"""
Gets the most recently updated history.
"""
# There must be a user to fetch histories, and without a user we have
# no recent history.
if not self.galaxy_session.user:
return None
try:
recent_history = self.sa_session.query( self.app.model.History ).filter_by(
user=self.galaxy_session.user,
deleted=False ).order_by(self.app.model.History.update_time.desc()).first()
except NoResultFound:
return None
self.set_history(recent_history)
return recent_history

def new_history( self, name=None ):
"""
Create a new history and associate it with the current session and
Expand Down
6 changes: 3 additions & 3 deletions lib/galaxy/webapps/galaxy/controllers/admin.py
Expand Up @@ -445,7 +445,7 @@ def get_value( self, trans, grid, tool_version ):
toolbox = trans.app.toolbox
if toolbox.has_tool( tool_version.tool_id, exact=True ):
link = url_for( controller='tool_runner', tool_id=tool_version.tool_id )
link_str = '<a href="%s">' % link
link_str = '<a target="_blank" href="%s">' % link
return '<div class="count-box state-color-ok">%s%s</a></div>' % ( link_str, tool_version.tool_id )
return tool_version.tool_id

Expand All @@ -455,8 +455,8 @@ def get_value( self, trans, grid, tool_version ):
toolbox = trans.app.toolbox
for tool_id in tool_version.get_version_ids( trans.app ):
if toolbox.has_tool( tool_id, exact=True ):
link = url_for( controller='tool_runner', tool_id=tool_version.tool_id )
link_str = '<a href="%s">' % link
link = url_for( controller='tool_runner', tool_id=tool_id )
link_str = '<a target="_blank" href="%s">' % link
tool_ids_str += '<div class="count-box state-color-ok">%s%s</a></div><br/>' % ( link_str, tool_id )
else:
tool_ids_str += '%s<br/>' % tool_id
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/webapps/galaxy/controllers/history.py
Expand Up @@ -487,7 +487,7 @@ def as_xml( self, trans, id=None, show_deleted=None, show_hidden=None ):
history = self.history_manager.get_accessible( self.decode_id( id ), trans.user,
current_history=trans.history )
else:
history = trans.get_history( create=True )
history = trans.get_history( most_recent=True, create=True )

trans.response.set_content_type( 'text/xml' )
return trans.fill_template_mako(
Expand Down Expand Up @@ -1351,7 +1351,7 @@ def current_history_json( self, trans ):
"""Return the current user's current history in a serialized, dictionary form."""
# Prevent IE11 from caching this
trans.response.headers[ 'Cache-Control' ] = ["max-age=0", "no-cache", "no-store"]
history = trans.get_history( create=True )
history = trans.get_history( most_recent=True, create=True )
return self.history_data( trans, history )

@web.json
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/galaxy/controllers/visualization.py
Expand Up @@ -955,7 +955,7 @@ def sweepster( self, trans, id=None, hda_ldda=None, dataset_id=None, regions=Non
"""
regions = regions or '{}'
# Need to create history if necessary in order to create tool form.
trans.get_history( create=True )
trans.get_history( most_recent=True, create=True )

if id:
# Loading a shared visualization.
Expand Down
2 changes: 1 addition & 1 deletion templates/webapps/galaxy/workflow/display.mako
Expand Up @@ -90,7 +90,7 @@
<%
# HACK: Rendering workflow steps requires that trans have a history; however, if its user's first visit to Galaxy is here, he won't have a history
# and an error will occur. To prevent this error, make sure user has a history.
trans.get_history( create=True )
trans.get_history( most_recent=True, create=True )
%>
<table class="annotated-item">
<tr><th>Step</th><th class="annotation">Annotation</th></tr>
Expand Down

0 comments on commit d9d3f25

Please sign in to comment.