Skip to content

Commit

Permalink
Merge pull request #3641 from nsoranzo/merge_17.01
Browse files Browse the repository at this point in the history
Merge 17.01 into dev
  • Loading branch information
martenson committed Feb 22, 2017
2 parents badf49d + 24eba8c commit 9563a69
Show file tree
Hide file tree
Showing 19 changed files with 113 additions and 36 deletions.
2 changes: 1 addition & 1 deletion client/galaxy/scripts/mvc/history/history-model.js
Expand Up @@ -177,7 +177,7 @@ var History = Backbone.Model
// if we don't flip this, then a fully-fetched list will not be re-checked via fetch
this.contents.allFetched = false;
var fetchFn = self.contents.currentPage !== 0
? function(){ return self.contents.fetchPage( 0 ); }
? function(){ return self.contents.fetchPage( self.contents.currentPage ); }
: function(){ return self.contents.fetchUpdated( lastUpdateTime ); };
// note: if there was no previous update time, all summary contents will be fetched
return fetchFn()
Expand Down
3 changes: 3 additions & 0 deletions client/galaxy/scripts/mvc/history/history-view.js
Expand Up @@ -369,14 +369,17 @@ var HistoryView = _super.extend(
}),

_clickPrevPage : function( ev ){
this.model.clearUpdateTimeout();
this.model.contents.fetchPrevPage();
},

_clickNextPage : function( ev ){
this.model.clearUpdateTimeout();
this.model.contents.fetchNextPage();
},

_changePageSelect : function( ev ){
this.model.clearUpdateTimeout();
var page = $( ev.currentTarget ).val();
this.model.contents.fetchPage( page );
},
Expand Down
29 changes: 8 additions & 21 deletions client/galaxy/scripts/mvc/history/options-menu.js
Expand Up @@ -110,36 +110,23 @@ var menu = [
html : _l( 'Unhide Hidden Datasets' ),
anon : true,
func : function() {
// TODO: Deprecate this functionality and replace with group dataset selector and action combination
if( Galaxy && Galaxy.currHistoryPanel && confirm( _l( 'Really unhide all hidden datasets?' ) ) ){
var filtered = Galaxy.currHistoryPanel.model.contents.hidden();
//TODO: batch
filtered.ajaxQueue( Backbone.Model.prototype.save, { visible : true })
.done( function(){
Galaxy.currHistoryPanel.renderItems();
})
.fail( function(){
alert( 'There was an error unhiding the datasets' );
console.error( arguments );
});
$.post(Galaxy.root + "history/adjust_hidden",
{ 'user_action' : 'unhide' },
function(){Galaxy.currHistoryPanel.loadCurrentHistory();});
}
},
},
{
html : _l( 'Delete Hidden Datasets' ),
anon : true,
func : function() {
// TODO: Deprecate this functionality and replace with group dataset selector and action combination
if( Galaxy && Galaxy.currHistoryPanel && confirm( _l( 'Really delete all hidden datasets?' ) ) ){
var filtered = Galaxy.currHistoryPanel.model.contents.hidden();
//TODO: batch
// both delete *and* unhide them
filtered.ajaxQueue( Backbone.Model.prototype.save, { deleted : true, visible: true })
.done( function(){
Galaxy.currHistoryPanel.renderItems();
})
.fail( function(){
alert( 'There was an error deleting the datasets' );
console.error( arguments );
});
$.post(Galaxy.root + "history/adjust_hidden",
{ 'user_action' : 'delete' },
function(){Galaxy.currHistoryPanel.loadCurrentHistory();});
}
},
},
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/jobs/command_factory.py
Expand Up @@ -29,7 +29,7 @@
-a -f "$GALAXY_VIRTUAL_ENV/bin/activate" ]; then
. "$GALAXY_VIRTUAL_ENV/bin/activate"
fi
GALAXY_PYTHON=`which python`
GALAXY_PYTHON=`command -v python`
"""


Expand Down
46 changes: 45 additions & 1 deletion lib/galaxy/tools/deps/conda_util.py
Expand Up @@ -82,6 +82,41 @@ def __init__(self, conda_prefix=None, conda_exec=None,
ensure_channels = None
self.ensure_channels = ensure_channels
self.ensured_channels = False
self._conda_version = None
self._miniconda_version = None

@property
def conda_version(self):
if self._conda_version is None:
self._guess_conda_version()
return self._conda_version

def _guess_conda_version(self):
conda_meta_path = self._conda_meta_path
# Perhaps we should call "conda info --json" and parse it but for now we are going
# to assume the default.
conda_version = LooseVersion(CONDA_VERSION)
miniconda_version = "3"

if os.path.exists(conda_meta_path):
for package in os.listdir(conda_meta_path):
package_parts = package.split("-")
if len(package_parts) < 3:
continue
package = '-'.join(package_parts[:-2])
version = package_parts[-2]
# build = package_parts[-1]
if package == "conda":
conda_version = LooseVersion(version)
if package == "python" and version.startswith("2"):
miniconda_version = "2"

self._conda_version = conda_version
self._miniconda_version = miniconda_version

@property
def _conda_meta_path(self):
return os.path.join(self.conda_prefix, "conda-meta")

def ensure_channels_configured(self):
if not self.ensured_channels:
Expand Down Expand Up @@ -495,7 +530,16 @@ def build_isolated_environment(
export_path
)
export_paths.append(export_path)
create_args = ["--unknown", "--offline"]
create_args = ["--unknown"]
# Works in 3.19, 4.0 - 4.2 - not in 4.3.
# Adjust fix if they fix Conda - xref
# - https://github.com/galaxyproject/galaxy/issues/3635
# - https://github.com/conda/conda/issues/2035
offline_works = conda_context.conda_version < LooseVersion("4.3")
if offline_works:
create_args.extend(["--offline"])
else:
create_args.extend(["--use-index-cache"])
if path is None:
create_args.extend(["--name", tempdir_name])
else:
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/web/framework/middleware/remoteuser.py
Expand Up @@ -147,6 +147,7 @@ def __call__( self, environ, start_response ):
"""
return self.error( start_response, title, message )
user_accessible_paths = (
'/users',
'/user/api_keys',
'/user/edit_username',
'/user/dbkeys',
Expand Down
5 changes: 5 additions & 0 deletions lib/galaxy/webapps/galaxy/buildapp.py
Expand Up @@ -78,6 +78,11 @@ def paste_app_factory( global_conf, **kwargs ):
# Force /history to go to view of current
webapp.add_route( '/history', controller='history', action='view' )
webapp.add_route( '/history/view/{id}', controller='history', action='view' )
# THIS IS A TEMPORARY ROUTE FOR THE 17.01 RELEASE
# This route supports the previous hide/delete-all-hidden functionality in a history.
# It will be removed after 17.01.
webapp.add_route( '/history/adjust_hidden', controller='history', action='adjust_hidden')

# Force /activate to go to the controller
webapp.add_route( '/activate', controller='user', action='activate' )
webapp.add_route( '/login', controller='root', action='login' )
Expand Down
14 changes: 14 additions & 0 deletions lib/galaxy/webapps/galaxy/controllers/history.py
Expand Up @@ -826,6 +826,20 @@ def share( self, trans, id=None, email="", **kwd ):
email=email,
send_to_err=send_to_err )

@web.expose
def adjust_hidden( self, trans, id=None, **kwd ):
""" THIS METHOD IS A TEMPORARY ADDITION. It'll allow us to fix the
regression in history-wide actions, and will be removed in the first
release after 17.01 """
action = kwd.get('user_action', None)
if action == 'delete':
for hda in trans.history.datasets:
if not hda.visible:
hda.mark_deleted()
elif action == 'unhide':
trans.history.unhide_datasets()
trans.sa_session.flush()

@web.expose
@web.require_login( "share restricted histories with other users" )
def share_restricted( self, trans, id=None, email="", **kwd ):
Expand Down
2 changes: 1 addition & 1 deletion static/maps/mvc/history/history-model.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/maps/mvc/history/history-view.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/maps/mvc/history/options-menu.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions static/scripts/bundled/analysis.bundled.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/analysis.bundled.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/libs.bundled.js.map

Large diffs are not rendered by default.

0 comments on commit 9563a69

Please sign in to comment.