galaxy-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 15302 discussions
commit/galaxy-central: greg: Fix for determining the list of all repository dependency dictionaries when installing a repository into Galaxy that has a deep dependency hierarchy.
by commits-noreply@bitbucket.org 29 Apr '14
by commits-noreply@bitbucket.org 29 Apr '14
29 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5846eb77fc8e/
Changeset: 5846eb77fc8e
User: greg
Date: 2014-04-29 15:34:58
Summary: Fix for determining the list of all repository dependency dictionaries when installing a repository into Galaxy that has a deep dependency hierarchy.
Affected #: 1 file
diff -r e3808d426ef2387a25aa79cbba397a6ec2f0d8f5 -r 5846eb77fc8e7b49fe1cafd986e709974ec1ae87 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
@@ -464,7 +464,15 @@
all_required_repo_info_dict[ k ] = v
if required_repo_info_dicts:
for required_repo_info_dict in required_repo_info_dicts:
- if required_repo_info_dict not in all_repo_info_dicts:
+ # Each required_repo_info_dict has a single entry, and all_repo_info_dicts is a list
+ # of dictionaries, each of which has a single entry. We'll check keys here rather than
+ # the entire dictionary because a dictionary entry in all_repo_info_dicts will include
+ # lists of discovered repository dependencies, but these lists will be empty in the
+ # required_repo_info_dict since dependency discovery has not yet been performed for these
+ # dictionaries.
+ required_repo_infor_dict_key = required_repo_info_dict.keys()[ 0 ]
+ all_repo_info_dicts_keys = [ d.keys()[ 0 ] for d in all_repo_info_dicts ]
+ if required_repo_infor_dict_key not in all_repo_info_dicts_keys:
all_repo_info_dicts.append( required_repo_info_dict )
all_required_repo_info_dict[ 'all_repo_info_dicts' ] = all_repo_info_dicts
return all_required_repo_info_dict
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.
1
0
commit/galaxy-central: greg: Handle changing http protocols in the tool shed registry's password_manager_for_url() function.
by commits-noreply@bitbucket.org 28 Apr '14
by commits-noreply@bitbucket.org 28 Apr '14
28 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e3808d426ef2/
Changeset: e3808d426ef2
User: greg
Date: 2014-04-28 21:58:48
Summary: Handle changing http protocols in the tool shed registry's password_manager_for_url() function.
Affected #: 1 file
diff -r 04befb2eb25baa347a3f440ed22045d01e75ebc7 -r e3808d426ef2387a25aa79cbba397a6ec2f0d8f5 lib/tool_shed/tool_shed_registry.py
--- a/lib/tool_shed/tool_shed_registry.py
+++ b/lib/tool_shed/tool_shed_registry.py
@@ -2,6 +2,7 @@
import sys
import urllib2
from galaxy.util.odict import odict
+from tool_shed.util import common_util
from tool_shed.util import xml_util
log = logging.getLogger( __name__ )
@@ -39,13 +40,17 @@
def password_manager_for_url( self, url ):
"""
- If the tool shed is using external auth, the client to the tool shed must authenticate to that as well. This provides access to the
- urllib2.HTTPPasswordMgrWithdefaultRealm() object for the url passed in.
+ If the tool shed is using external auth, the client to the tool shed must authenticate to that
+ as well. This provides access to the urllib2.HTTPPasswordMgrWithdefaultRealm() object for the
+ url passed in.
- Following more what galaxy.demo_sequencer.controllers.common does might be more appropriate at some stage...
+ Following more what galaxy.demo_sequencer.controllers.common does might be more appropriate at
+ some stage...
"""
+ url_sans_protocol = common_util.remove_protocol_from_tool_shed_url( url )
for shed_name, shed_url in self.tool_sheds.items():
- if shed_url.find( url ) >= 0:
+ shed_url_sans_protocol = common_util.remove_protocol_from_tool_shed_url( shed_url )
+ if shed_url_sans_protocol.find( url_sans_protocol ) >= 0:
return self.tool_sheds_auth[ shed_name ]
log.debug( "Invalid url '%s' received by tool shed registry's password_manager_for_url method." % str( url ) )
return None
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.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/31d00b1b6a9f/
Changeset: 31d00b1b6a9f
User: dan
Date: 2014-04-28 21:35:47
Summary: For setup_virtualenv: allow specifying to not use requirements file for pip install. Empirically, calling pip install PACKAGE may work better than using a requirements file with some package combinations. Specify a specific log file for pip to use during installation.
Affected #: 1 file
diff -r ef1ed48f60a5d6592d148ec55ff2f50dc3587035 -r 31d00b1b6a9f7ed88a74f03569b686e15558d196 lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
@@ -1139,7 +1139,22 @@
# POSIXLY_CORRECT forces shell commands . and source to have the same
# and well defined behavior in bash/zsh.
activate_command = "POSIXLY_CORRECT=1; . %s" % os.path.join( venv_directory, "bin", "activate" )
- install_command = "python '%s' install -r '%s'" % ( os.path.join( venv_directory, "bin", "pip" ), requirements_path )
+ if action_dict[ 'use_requirements_file' ]:
+ install_command = "python '%s' install -r '%s' --log '%s'" % ( os.path.join( venv_directory, "bin", "pip" ), requirements_path, os.path.join( install_dir, 'pip_install.log' ) )
+ else:
+ install_command = ''
+ with open( requirements_path, "rb" ) as f:
+ while True:
+ line = f.readline()
+ if not line:
+ break
+ line = line.strip()
+ if line:
+ line_install_command = "python '%s' install %s --log '%s'" % ( os.path.join( venv_directory, "bin", "pip" ), line, os.path.join( install_dir, 'pip_install_%s.log' % ( line ) ) )
+ if not install_command:
+ install_command = line_install_command
+ else:
+ install_command = "%s && %s" % ( install_command, line_install_command )
full_setup_command = "%s; %s; %s" % ( setup_command, activate_command, install_command )
return_code = install_environment.handle_command( app, tool_dependency, install_dir, full_setup_command )
if return_code:
@@ -1183,6 +1198,7 @@
# <action type="setup_virtualenv">pyyaml==3.2.0
# lxml==2.3.0</action>
## Manually specify contents of requirements.txt file to create dynamically.
+ action_dict[ 'use_requirements_file' ] = asbool( action_elem.get( 'use_requirements_file', True ) )
action_dict[ 'requirements' ] = td_common_util.evaluate_template( action_elem.text or 'requirements.txt', install_dir )
action_dict[ 'python' ] = action_elem.get( 'python', 'python' )
return action_dict
https://bitbucket.org/galaxy/galaxy-central/commits/dd2f7cb5e0b1/
Changeset: dd2f7cb5e0b1
User: dan
Date: 2014-04-28 21:39:55
Summary: merge default
Affected #: 3 files
diff -r 31d00b1b6a9f7ed88a74f03569b686e15558d196 -r dd2f7cb5e0b14f6410b3bf6c7262f25783e144e8 lib/galaxy/app.py
--- a/lib/galaxy/app.py
+++ b/lib/galaxy/app.py
@@ -40,7 +40,8 @@
# Setup the database engine and ORM
config_file = kwargs.get( 'global_conf', {} ).get( '__file__', None )
- self._configure_models( check_migrate_databases=True, check_migrate_tools=True, config_file=config_file )
+ check_migrate_tools = self.config.check_migrate_tools
+ self._configure_models( check_migrate_databases=True, check_migrate_tools=check_migrate_tools, config_file=config_file )
# Manage installed tool shed repositories.
from tool_shed.galaxy_install import installed_repository_manager
diff -r 31d00b1b6a9f7ed88a74f03569b686e15558d196 -r dd2f7cb5e0b14f6410b3bf6c7262f25783e144e8 lib/galaxy/config.py
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -4,8 +4,12 @@
# absolute_import needed for tool_shed package.
from __future__ import absolute_import
-import sys, os, tempfile, re
-import logging, logging.config
+import os
+import re
+import sys
+import tempfile
+import logging
+import logging.config
import ConfigParser
from datetime import timedelta
from galaxy.web.formatting import expand_pretty_datetime_format
@@ -23,11 +27,14 @@
path = os.path.join( root, path )
return path
+
class ConfigurationError( Exception ):
pass
+
class Configuration( object ):
deprecated_options = ( 'database_file', )
+
def __init__( self, **kwargs ):
self.config_dict = kwargs
self.root = kwargs.get( 'root_dir', '.' )
@@ -87,6 +94,9 @@
self.user_section_filters = listify( kwargs.get( "user_tool_section_filters", [] ), do_strip=True )
self.tool_configs = [ resolve_path( p, self.root ) for p in listify( tcf ) ]
+ # Check for tools defined in the above non-shed tool configs (i.e., tool_conf.xml) tht have
+ # been migrated from the Galaxy code distribution to the Tool Shed.
+ self.check_migrate_tools = string_as_bool( kwargs.get( 'check_migrate_tools', True ) )
self.shed_tool_data_path = kwargs.get( "shed_tool_data_path", None )
if self.shed_tool_data_path:
self.shed_tool_data_path = resolve_path( self.shed_tool_data_path, self.root )
@@ -397,13 +407,16 @@
return rval
except ConfigParser.NoSectionError:
return {}
+
def get( self, key, default ):
return self.config_dict.get( key, default )
+
def get_bool( self, key, default ):
if key in self.config_dict:
return string_as_bool( self.config_dict[key] )
else:
return default
+
def check( self ):
paths_to_check = [ self.root, self.tool_path, self.tool_data_path, self.template_path ]
# Check that required directories exist
@@ -488,7 +501,6 @@
rval[ key ] = value
return rval
-
def configure_logging( config ):
"""
Allow some basic logging configuration to be read from ini file.
diff -r 31d00b1b6a9f7ed88a74f03569b686e15558d196 -r dd2f7cb5e0b14f6410b3bf6c7262f25783e144e8 universe_wsgi.ini.sample
--- a/universe_wsgi.ini.sample
+++ b/universe_wsgi.ini.sample
@@ -136,6 +136,13 @@
# Tools can be locally developed or installed from Galaxy tool sheds.
#tool_config_file = tool_conf.xml,shed_tool_conf.xml
+# Enable / disable checking if any tools defined in the above non-shed tool_config_files
+# (i.e., tool_conf.xml) have been migrated from the Galaxy code distribution to the Tool
+# Shed. This setting should generally be set to False only for development Galaxy environments
+# that are often rebuilt from scratch where migrated tools do not need to be available in the
+# Galaxy tool panel. If the following setting remains commented, the default setting will be True.
+#check_migrate_tools = True
+
# Default path to the directory containing the tools defined in tool_conf.xml.
# Other tool config files must include the tool_path as an attribute in the <toolbox> tag.
#tool_path = tools
https://bitbucket.org/galaxy/galaxy-central/commits/04befb2eb25b/
Changeset: 04befb2eb25b
User: dan
Date: 2014-04-28 21:40:15
Summary: merge default
Affected #: 1 file
diff -r dd2f7cb5e0b14f6410b3bf6c7262f25783e144e8 -r 04befb2eb25baa347a3f440ed22045d01e75ebc7 test/functional/api/test_tools.py
--- a/test/functional/api/test_tools.py
+++ b/test/functional/api/test_tools.py
@@ -1,6 +1,4 @@
# Test tools API.
-from itertools import chain
-
from base import api
from operator import itemgetter
from .helpers import DatasetPopulator
@@ -13,22 +11,16 @@
self.dataset_populator = DatasetPopulator( self.galaxy_interactor )
def test_index( self ):
- index = self._get( "tools" )
- tools_index = index.json()
- # In panels by default, so flatten out sections...
- tools = list( chain( *map( itemgetter( "elems" ), tools_index ) ) )
- tool_ids = map( itemgetter( "id" ), tools )
+ tool_ids = self.__tool_ids()
assert "upload1" in tool_ids
- assert "cat1" in tool_ids
def test_no_panel_index( self ):
- index = self._get( "tools", data=dict(in_panel="false") )
+ index = self._get( "tools", data=dict( in_panel="false" ) )
tools_index = index.json()
# No need to flatten out sections, with in_panel=False, only tools are
# returned.
tool_ids = map( itemgetter( "id" ), tools_index )
assert "upload1" in tool_ids
- assert "cat1" in tool_ids
def test_upload1_paste( self ):
history_id = self.dataset_populator.new_history()
@@ -58,6 +50,7 @@
self.assertEquals( result_content, table )
def test_run_cat1( self ):
+ self.__skip_without_tool( "cat1" )
# Run simple non-upload tool with an input data parameter.
history_id = self.dataset_populator.new_history()
new_dataset = self.dataset_populator.new_dataset( history_id, content='Cat1Test' )
@@ -72,6 +65,7 @@
self.assertEqual( output1_content.strip(), "Cat1Test" )
def test_run_cat1_with_two_inputs( self ):
+ self.__skip_without_tool( "cat1" )
# Run tool with an multiple data parameter and grouping (repeat)
history_id = self.dataset_populator.new_history()
new_dataset1 = self.dataset_populator.new_dataset( history_id, content='Cat1Test' )
@@ -118,6 +112,25 @@
self._assert_status_code_is( display_response, 200 )
return display_response.content
+ def __tool_ids( self ):
+ index = self._get( "tools" )
+ tools_index = index.json()
+ # In panels by default, so flatten out sections...
+ tools = []
+ for tool_or_section in tools_index:
+ if "elems" in tool_or_section:
+ tools.extend( tool_or_section[ "elems" ] )
+ else:
+ tools.append( tool_or_section )
+
+ tool_ids = map( itemgetter( "id" ), tools )
+ return tool_ids
+
+ def __skip_without_tool( self, tool_id ):
+ from nose.plugins.skip import SkipTest
+ if tool_id not in self.__tool_ids( ):
+ raise SkipTest( )
+
def dataset_to_param( dataset ):
return dict(
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.
1
0
commit/galaxy-central: jmchilton: Tools API Improvements.
by commits-noreply@bitbucket.org 28 Apr '14
by commits-noreply@bitbucket.org 28 Apr '14
28 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5d88d8b71662/
Changeset: 5d88d8b71662
User: jmchilton
Date: 2014-04-28 21:38:45
Summary: Tools API Improvements.
Ablity to require tool for API test. Fix test_index for tool panels containing tools outside a section.
Affected #: 1 file
diff -r a3b4e0950ae60007af2efcc257a78be6dbe7ca7a -r 5d88d8b716623e06dcc2dbca442c5f52c0a43389 test/functional/api/test_tools.py
--- a/test/functional/api/test_tools.py
+++ b/test/functional/api/test_tools.py
@@ -1,6 +1,4 @@
# Test tools API.
-from itertools import chain
-
from base import api
from operator import itemgetter
from .helpers import DatasetPopulator
@@ -13,22 +11,16 @@
self.dataset_populator = DatasetPopulator( self.galaxy_interactor )
def test_index( self ):
- index = self._get( "tools" )
- tools_index = index.json()
- # In panels by default, so flatten out sections...
- tools = list( chain( *map( itemgetter( "elems" ), tools_index ) ) )
- tool_ids = map( itemgetter( "id" ), tools )
+ tool_ids = self.__tool_ids()
assert "upload1" in tool_ids
- assert "cat1" in tool_ids
def test_no_panel_index( self ):
- index = self._get( "tools", data=dict(in_panel="false") )
+ index = self._get( "tools", data=dict( in_panel="false" ) )
tools_index = index.json()
# No need to flatten out sections, with in_panel=False, only tools are
# returned.
tool_ids = map( itemgetter( "id" ), tools_index )
assert "upload1" in tool_ids
- assert "cat1" in tool_ids
def test_upload1_paste( self ):
history_id = self.dataset_populator.new_history()
@@ -58,6 +50,7 @@
self.assertEquals( result_content, table )
def test_run_cat1( self ):
+ self.__skip_without_tool( "cat1" )
# Run simple non-upload tool with an input data parameter.
history_id = self.dataset_populator.new_history()
new_dataset = self.dataset_populator.new_dataset( history_id, content='Cat1Test' )
@@ -72,6 +65,7 @@
self.assertEqual( output1_content.strip(), "Cat1Test" )
def test_run_cat1_with_two_inputs( self ):
+ self.__skip_without_tool( "cat1" )
# Run tool with an multiple data parameter and grouping (repeat)
history_id = self.dataset_populator.new_history()
new_dataset1 = self.dataset_populator.new_dataset( history_id, content='Cat1Test' )
@@ -118,6 +112,25 @@
self._assert_status_code_is( display_response, 200 )
return display_response.content
+ def __tool_ids( self ):
+ index = self._get( "tools" )
+ tools_index = index.json()
+ # In panels by default, so flatten out sections...
+ tools = []
+ for tool_or_section in tools_index:
+ if "elems" in tool_or_section:
+ tools.extend( tool_or_section[ "elems" ] )
+ else:
+ tools.append( tool_or_section )
+
+ tool_ids = map( itemgetter( "id" ), tools )
+ return tool_ids
+
+ def __skip_without_tool( self, tool_id ):
+ from nose.plugins.skip import SkipTest
+ if tool_id not in self.__tool_ids( ):
+ raise SkipTest( )
+
def dataset_to_param( dataset ):
return dict(
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.
1
0
28 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a3b4e0950ae6/
Changeset: a3b4e0950ae6
User: greg
Date: 2014-04-28 21:35:41
Summary: Make checking for for migrated tools when starting the Galaxy server a config setting that defaults to True. This setting should generally be False only for development Galaxy environments that are often set up from scratch (with new db, etc) and migrated tools are not needed in the Galaxy tool panel. In those cases where this setting is False, starting a fresh Galaxy instance (with no checking for migrated tools) will be much faster.
Affected #: 3 files
diff -r ef1ed48f60a5d6592d148ec55ff2f50dc3587035 -r a3b4e0950ae60007af2efcc257a78be6dbe7ca7a lib/galaxy/app.py
--- a/lib/galaxy/app.py
+++ b/lib/galaxy/app.py
@@ -40,7 +40,8 @@
# Setup the database engine and ORM
config_file = kwargs.get( 'global_conf', {} ).get( '__file__', None )
- self._configure_models( check_migrate_databases=True, check_migrate_tools=True, config_file=config_file )
+ check_migrate_tools = self.config.check_migrate_tools
+ self._configure_models( check_migrate_databases=True, check_migrate_tools=check_migrate_tools, config_file=config_file )
# Manage installed tool shed repositories.
from tool_shed.galaxy_install import installed_repository_manager
diff -r ef1ed48f60a5d6592d148ec55ff2f50dc3587035 -r a3b4e0950ae60007af2efcc257a78be6dbe7ca7a lib/galaxy/config.py
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -4,8 +4,12 @@
# absolute_import needed for tool_shed package.
from __future__ import absolute_import
-import sys, os, tempfile, re
-import logging, logging.config
+import os
+import re
+import sys
+import tempfile
+import logging
+import logging.config
import ConfigParser
from datetime import timedelta
from galaxy.web.formatting import expand_pretty_datetime_format
@@ -23,11 +27,14 @@
path = os.path.join( root, path )
return path
+
class ConfigurationError( Exception ):
pass
+
class Configuration( object ):
deprecated_options = ( 'database_file', )
+
def __init__( self, **kwargs ):
self.config_dict = kwargs
self.root = kwargs.get( 'root_dir', '.' )
@@ -87,6 +94,9 @@
self.user_section_filters = listify( kwargs.get( "user_tool_section_filters", [] ), do_strip=True )
self.tool_configs = [ resolve_path( p, self.root ) for p in listify( tcf ) ]
+ # Check for tools defined in the above non-shed tool configs (i.e., tool_conf.xml) tht have
+ # been migrated from the Galaxy code distribution to the Tool Shed.
+ self.check_migrate_tools = string_as_bool( kwargs.get( 'check_migrate_tools', True ) )
self.shed_tool_data_path = kwargs.get( "shed_tool_data_path", None )
if self.shed_tool_data_path:
self.shed_tool_data_path = resolve_path( self.shed_tool_data_path, self.root )
@@ -397,13 +407,16 @@
return rval
except ConfigParser.NoSectionError:
return {}
+
def get( self, key, default ):
return self.config_dict.get( key, default )
+
def get_bool( self, key, default ):
if key in self.config_dict:
return string_as_bool( self.config_dict[key] )
else:
return default
+
def check( self ):
paths_to_check = [ self.root, self.tool_path, self.tool_data_path, self.template_path ]
# Check that required directories exist
@@ -488,7 +501,6 @@
rval[ key ] = value
return rval
-
def configure_logging( config ):
"""
Allow some basic logging configuration to be read from ini file.
diff -r ef1ed48f60a5d6592d148ec55ff2f50dc3587035 -r a3b4e0950ae60007af2efcc257a78be6dbe7ca7a universe_wsgi.ini.sample
--- a/universe_wsgi.ini.sample
+++ b/universe_wsgi.ini.sample
@@ -136,6 +136,13 @@
# Tools can be locally developed or installed from Galaxy tool sheds.
#tool_config_file = tool_conf.xml,shed_tool_conf.xml
+# Enable / disable checking if any tools defined in the above non-shed tool_config_files
+# (i.e., tool_conf.xml) have been migrated from the Galaxy code distribution to the Tool
+# Shed. This setting should generally be set to False only for development Galaxy environments
+# that are often rebuilt from scratch where migrated tools do not need to be available in the
+# Galaxy tool panel. If the following setting remains commented, the default setting will be True.
+#check_migrate_tools = True
+
# Default path to the directory containing the tools defined in tool_conf.xml.
# Other tool config files must include the tool_path as an attribute in the <toolbox> tag.
#tool_path = tools
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.
1
0
commit/galaxy-central: greg: Pep-8 fixes for the tool shd config.
by commits-noreply@bitbucket.org 28 Apr '14
by commits-noreply@bitbucket.org 28 Apr '14
28 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ef1ed48f60a5/
Changeset: ef1ed48f60a5
User: greg
Date: 2014-04-28 21:26:38
Summary: Pep-8 fixes for the tool shd config.
Affected #: 1 file
diff -r 861535cf753a61bdc360b04d008dc504a5437e8c -r ef1ed48f60a5d6592d148ec55ff2f50dc3587035 lib/galaxy/webapps/tool_shed/config.py
--- a/lib/galaxy/webapps/tool_shed/config.py
+++ b/lib/galaxy/webapps/tool_shed/config.py
@@ -1,16 +1,14 @@
"""
Universe configuration builder.
"""
-
-import sys, os
-import logging, logging.config
+import os
+import sys
+import logging
+import logging.config
from optparse import OptionParser
import ConfigParser
from galaxy.util import string_as_bool, listify
-from galaxy import eggs
-import pkg_resources
-
log = logging.getLogger( __name__ )
def resolve_path( path, root ):
@@ -19,10 +17,13 @@
path = os.path.join( root, path )
return path
+
class ConfigurationError( Exception ):
pass
+
class Configuration( object ):
+
def __init__( self, **kwargs ):
self.config_dict = kwargs
self.root = kwargs.get( 'root_dir', '.' )
@@ -125,13 +126,16 @@
if global_conf and "__file__" in global_conf:
global_conf_parser.read(global_conf['__file__'])
self.running_functional_tests = string_as_bool( kwargs.get( 'running_functional_tests', False ) )
+
def get( self, key, default ):
return self.config_dict.get( key, default )
+
def get_bool( self, key, default ):
if key in self.config_dict:
return string_as_bool( self.config_dict[key] )
else:
return default
+
def check( self ):
# Check that required directories exist.
paths_to_check = [ self.root, self.file_path, self.hgweb_config_dir, self.tool_data_path, self.template_path ]
@@ -153,6 +157,7 @@
# Check that required files exist.
if not os.path.isfile( self.datatypes_config ):
raise ConfigurationError( "File not found: %s" % self.datatypes_config )
+
def is_admin_user( self, user ):
"""
Determine if the provided user is listed in `admin_users`.
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.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8e2a9de88ddb/
Changeset: 8e2a9de88ddb
User: carlfeberhard
Date: 2014-04-28 21:16:46
Summary: UI, published histories: use paging in grid and set num per page to 50 (preventing extremely long load times)
Affected #: 1 file
diff -r 8ed5006bfc1f67350834291bc81ace94312ad070 -r 8e2a9de88ddbf091e6462d2b563816028ef0107d lib/galaxy/webapps/galaxy/controllers/history.py
--- a/lib/galaxy/webapps/galaxy/controllers/history.py
+++ b/lib/galaxy/webapps/galaxy/controllers/history.py
@@ -164,6 +164,8 @@
model_class = model.History
default_sort_key = "update_time"
default_filter = dict( public_url="All", username="All", tags="All" )
+ use_paging = True
+ num_rows_per_page = 50
use_async = True
columns = [
NameURLColumn( "Name", key="name", filterable="advanced" ),
https://bitbucket.org/galaxy/galaxy-central/commits/861535cf753a/
Changeset: 861535cf753a
User: carlfeberhard
Date: 2014-04-28 21:17:40
Summary: merge
Affected #: 10 files
diff -r 8e2a9de88ddbf091e6462d2b563816028ef0107d -r 861535cf753a61bdc360b04d008dc504a5437e8c lib/galaxy/webapps/galaxy/api/folder_contents.py
--- a/lib/galaxy/webapps/galaxy/api/folder_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/folder_contents.py
@@ -43,7 +43,7 @@
:raises: MalformedId, InconsistentDatabase, ObjectNotFound,
InternalServerError
"""
- deleted = kwd.get( 'deleted', 'missing' )
+ deleted = kwd.get( 'include_deleted', 'missing' )
try:
deleted = util.asbool( deleted )
except ValueError:
diff -r 8e2a9de88ddbf091e6462d2b563816028ef0107d -r 861535cf753a61bdc360b04d008dc504a5437e8c static/scripts/mvc/library/library-folderlist-view.js
--- a/static/scripts/mvc/library/library-folderlist-view.js
+++ b/static/scripts/mvc/library/library-folderlist-view.js
@@ -13,6 +13,9 @@
var FolderListView = Backbone.View.extend({
el : '#folder_items_element',
+ defaults: {
+ 'include_deleted' : false
+ },
// progress percentage
progress: 0,
// progress rate per one item
@@ -38,15 +41,21 @@
this.fetchFolder();
},
- fetchFolder: function(){
+ fetchFolder: function(options){
+ // this.options = _.defaults(this.options, options);
+ var options = options || {};
+ this.options.include_deleted = options.include_deleted;
var that = this;
this.folderContainer = new mod_library_model.FolderContainer({id: this.options.id});
this.folderContainer.url = this.folderContainer.attributes.urlRoot + this.options.id + '/contents';
+ if (this.options.include_deleted){
+ this.folderContainer.url = this.folderContainer.url + '?include_deleted=true';
+ }
this.folderContainer.fetch({
success: function(folder_container) {
that.folder_container = folder_container;
that.render();
- that.addAll(folder_container.get('folder').models)
+ that.addAll(folder_container.get('folder').models);
},
error: function(model, response){
if (typeof response.responseJSON !== "undefined"){
@@ -59,7 +68,7 @@
},
render: function (options) {
- this.options = _.defaults(this.options || {}, options);
+ this.options = _.defaults(this.options, options);
var template = this.templateFolder();
// TODO move to server
@@ -93,6 +102,7 @@
_.each(models.reverse(), function(model) {
Galaxy.libraries.folderListView.collection.add(model);
});
+ $("#center [data-toggle]").tooltip();
this.checkEmptiness();
},
diff -r 8e2a9de88ddbf091e6462d2b563816028ef0107d -r 861535cf753a61bdc360b04d008dc504a5437e8c static/scripts/mvc/library/library-folderrow-view.js
--- a/static/scripts/mvc/library/library-folderrow-view.js
+++ b/static/scripts/mvc/library/library-folderrow-view.js
@@ -36,7 +36,11 @@
template = this.templateRowFolder();
} else {
this.options.type = 'file';
- template = this.templateRowFile();
+ if (folder_item.get('deleted')){
+ template = this.templateRowDeletedFile();
+ } else {
+ template = this.templateRowFile();
+ }
}
this.setElement(template({content_item:folder_item}));
this.$el.show();
@@ -227,6 +231,23 @@
tmpl_array.push('</tr>');
return _.template(tmpl_array.join(''));
+ },
+
+ templateRowDeletedFile: function(){
+ tmpl_array = [];
+
+ tmpl_array.push('<tr class="active" id="<%- content_item.id %>">');
+ tmpl_array.push(' <td>');
+ tmpl_array.push(' <span title="Dataset" class="fa fa-file-o"></span>');
+ tmpl_array.push(' </td>');
+ tmpl_array.push(' <td><span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg"></span></td>');
+ tmpl_array.push(' <td style="color:grey;"><%- content_item.get("name") %></td>'); // dataset
+ tmpl_array.push(' <td><%= _.escape(content_item.get("data_type")) %></td>'); // data type
+ tmpl_array.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>'); // size
+ tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>'); // time updated
+ tmpl_array.push('</tr>');
+
+ return _.template(tmpl_array.join(''));
},
templateDatasetModal : function(){
diff -r 8e2a9de88ddbf091e6462d2b563816028ef0107d -r 861535cf753a61bdc360b04d008dc504a5437e8c static/scripts/mvc/library/library-foldertoolbar-view.js
--- a/static/scripts/mvc/library/library-foldertoolbar-view.js
+++ b/static/scripts/mvc/library/library-foldertoolbar-view.js
@@ -12,9 +12,10 @@
el: '#center',
events: {
- 'click #toolbtn_create_folder' : 'createFolderFromModal',
- 'click #toolbtn_bulk_import' : 'modalBulkImport',
- 'click .toolbtn_add_files' : 'addFilesToFolderModal'
+ 'click #toolbtn_create_folder' : 'createFolderFromModal',
+ 'click #toolbtn_bulk_import' : 'modalBulkImport',
+ 'click .toolbtn_add_files' : 'addFilesToFolderModal',
+ 'click #include_deleted_datasets_chk' : 'check_include_deleted'
},
defaults: {
@@ -389,6 +390,21 @@
});
},
+ /**
+ * Handles the click on 'show deleted' checkbox
+ */
+ check_include_deleted: function(event){
+ if (event.target.checked){
+ Galaxy.libraries.folderListView.collection = new mod_library_model.Folder();
+ Galaxy.libraries.folderListView.listenTo(Galaxy.libraries.folderListView.collection, 'add', Galaxy.libraries.folderListView.renderOne);
+ Galaxy.libraries.folderListView.fetchFolder({include_deleted: true});
+ } else{
+ Galaxy.libraries.folderListView.collection = new mod_library_model.Folder();
+ Galaxy.libraries.folderListView.listenTo(Galaxy.libraries.folderListView.collection, 'add', Galaxy.libraries.folderListView.renderOne);
+ Galaxy.libraries.folderListView.fetchFolder({include_deleted: false});
+ }
+ },
+
templateToolBar: function(){
tmpl_array = [];
diff -r 8e2a9de88ddbf091e6462d2b563816028ef0107d -r 861535cf753a61bdc360b04d008dc504a5437e8c static/scripts/mvc/library/library-libraryrow-view.js
--- a/static/scripts/mvc/library/library-libraryrow-view.js
+++ b/static/scripts/mvc/library/library-libraryrow-view.js
@@ -221,7 +221,11 @@
tmpl_array.push(' <tr class="<% if(library.get("deleted") === true) { print("active") } %>" style="display:none;" data-id="<%- library.get("id") %>">');
tmpl_array.push(' <% if(!edit_mode) { %>');
- tmpl_array.push(' <td><a href="#folders/<%- library.get("root_folder_id") %>"><%- library.get("name") %></a></td>');
+ tmpl_array.push(' <% if(library.get("deleted")) { %>');
+ tmpl_array.push(' <td style="color:grey;"><%- library.get("name") %></td>');
+ tmpl_array.push(' <% } else { %>');
+ tmpl_array.push(' <td><a href="#folders/<%- library.get("root_folder_id") %>"><%- library.get("name") %></a></td>');
+ tmpl_array.push(' <% } %>');
tmpl_array.push(' <td><%= _.escape(library.get("description")) %></td>');
tmpl_array.push(' <td><%= _.escape(library.get("synopsis")) %></td>');
tmpl_array.push(' <% } else if(edit_mode){ %>');
@@ -230,9 +234,9 @@
tmpl_array.push(' <td><input type="text" class="form-control input_library_synopsis" placeholder="synopsis" value="<%- library.get("synopsis") %>"></td>');
tmpl_array.push(' <% } %>');
tmpl_array.push(' <td class="right-center">');
- tmpl_array.push(' <% if(library.get("deleted") === true) { %>');
+ tmpl_array.push(' <% if(library.get("deleted")) { %>');
tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg deleted_lib_ico"></span>');
- tmpl_array.push(' <% } else if(library.get("public") === true) { %>');
+ tmpl_array.push(' <% } else if(library.get("public")) { %>');
tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Public" style="color:grey;" class="fa fa-globe fa-lg public_lib_ico"></span>');
tmpl_array.push(' <% }%>');
// tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Upload to library" class="primary-button btn-xs upload_library_btn" type="button" style="<% if(button_config.upload_library_btn === false) { print("display:none;") } %>"><span class="fa fa-upload"></span></button>');
diff -r 8e2a9de88ddbf091e6462d2b563816028ef0107d -r 861535cf753a61bdc360b04d008dc504a5437e8c static/scripts/packed/galaxy.base.js
--- a/static/scripts/packed/galaxy.base.js
+++ b/static/scripts/packed/galaxy.base.js
@@ -1,1 +1,1 @@
-(function(){var b=0;var c=["ms","moz","webkit","o"];for(var a=0;a<c.length&&!window.requestAnimationFrame;++a){window.requestAnimationFrame=window[c[a]+"RequestAnimationFrame"];window.cancelRequestAnimationFrame=window[c[a]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame){window.requestAnimationFrame=function(h,e){var d=new Date().getTime();var f=Math.max(0,16-(d-b));var g=window.setTimeout(function(){h(d+f)},f);b=d+f;return g}}if(!window.cancelAnimationFrame){window.cancelAnimationFrame=function(d){clearTimeout(d)}}}());if(!Array.indexOf){Array.prototype.indexOf=function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]==c){return b}}return -1}}function obj_length(c){if(c.length!==undefined){return c.length}var b=0;for(var a in c){b++}return b}$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function make_popupmenu(b,c){var a=(b.data("menu_options"));b.data("menu_options",c);if(a){return}b.bind("click.show_popup",function(d){$(".popmenu-wrapper").remove();setTimeout(function(){var g=$("<ul class='dropdown-menu' id='"+b.attr("id")+"-menu'></ul>");var f=b.data("menu_options");if(obj_length(f)<=0){$("<li>No Options.</li>").appendTo(g)}$.each(f,function(j,i){if(i){var l=i.action||i;g.append($("<li></li>").append($("<a>").attr("href",i.url).html(j).click(l)))}else{g.append($("<li></li>").addClass("head").append($("<a href='#'></a>").html(j)))}});var h=$("<div class='popmenu-wrapper' style='position: absolute;left: 0; top: -1000;'></div>").append(g).appendTo("body");var e=d.pageX-h.width()/2;e=Math.min(e,$(document).scrollLeft()+$(window).width()-$(h).width()-5);e=Math.max(e,$(document).scrollLeft()+5);h.css({top:d.pageY,left:e})},10);setTimeout(function(){var f=function(h){$(h).bind("click.close_popup",function(){$(".popmenu-wrapper").remove();h.unbind("click.close_popup")})};f($(window.document));f($(window.top.document));for(var e=window.top.frames.length;e--;){var g=$(window.top.frames[e].document);f(g)}},50);return false})}function make_popup_menus(a){a=a||document;$(a).find("div[popupmenu]").each(function(){var b={};var d=$(this);d.find("a").each(function(){var g=$(this),i=g.get(0),e=i.getAttribute("confirm"),f=i.getAttribute("href"),h=i.getAttribute("target");if(!f){b[g.text()]=null}else{b[g.text()]={url:f,action:function(){if(!e||confirm(e)){if(h){window.open(f,h);return false}else{g.click()}}}}}});var c=$(a).find("#"+d.attr("popupmenu"));c.find("a").bind("click",function(f){f.stopPropagation();return true});make_popupmenu(c,b);c.addClass("popup");d.remove()})}function naturalSort(j,h){var p=/(-?[0-9\.]+)/g,k=j.toString().toLowerCase()||"",g=h.toString().toLowerCase()||"",l=String.fromCharCode(0),n=k.replace(p,l+"$1"+l).split(l),e=g.replace(p,l+"$1"+l).split(l),d=(new Date(k)).getTime(),o=d?(new Date(g)).getTime():null;if(o){if(d<o){return -1}else{if(d>o){return 1}}}var m,f;for(var i=0,c=Math.max(n.length,e.length);i<c;i++){m=parseFloat(n[i])||n[i];f=parseFloat(e[i])||e[i];if(m<f){return -1}else{if(m>f){return 1}}}return 0}$.fn.refresh_select2=function(){var b=$(this);var a={width:"resolve",closeOnSelect:!b.is("[MULTIPLE]")};return b.select2(a)};function replace_big_select_inputs(a,c,b){if(!jQuery.fn.select2){return}if(a===undefined){a=20}if(c===undefined){c=3000}b=b||$("select");b.each(function(){var e=$(this);var d=e.find("option").length;if((d<a)||(d>c)){return}if(e.hasClass("no-autocomplete")){return}e.refresh_select2()})}$.fn.make_text_editable=function(g){var d=("num_cols" in g?g.num_cols:30),c=("num_rows" in g?g.num_rows:4),e=("use_textarea" in g?g.use_textarea:false),b=("on_finish" in g?g.on_finish:null),f=("help_text" in g?g.help_text:null);var a=$(this);a.addClass("editable-text").click(function(l){if($(this).children(":input").length>0){return}a.removeClass("editable-text");var i=function(m){a.find(":input").remove();if(m!==""){a.text(m)}else{a.html("<br>")}a.addClass("editable-text");if(b){b(m)}};var h=("cur_text" in g?g.cur_text:a.text()),k,j;if(e){k=$("<textarea/>").attr({rows:c,cols:d}).text($.trim(h)).keyup(function(m){if(m.keyCode===27){i(h)}});j=$("<button/>").text("Done").click(function(){i(k.val());return false})}else{k=$("<input type='text'/>").attr({value:$.trim(h),size:d}).blur(function(){i(h)}).keyup(function(m){if(m.keyCode===27){$(this).trigger("blur")}else{if(m.keyCode===13){i($(this).val())}}})}a.text("");a.append(k);if(j){a.append(j)}k.focus();k.select();l.stopPropagation()});if(f){a.attr("title",f).tooltip()}return a};function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).click(function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text($.trim(k))}else{j=$("<input type='text'></input>").attr({value:$.trim(k),size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){if(o!==""){l.text(o)}else{l.html("<em>None</em>")}if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(d,a,c){var b=function(){try{var e=$.jStorage.get("history_expand_state");if(e){for(var g in e){$("#"+g+" div.historyItemBody").show()}}}catch(f){$.jStorage.deleteKey("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.peek").css("overflow","hidden")}})}d.each(function(){var j=this.id,h=$(this).children("div.historyItemBody"),i=h.find("pre.peek");$(this).find(".historyItemTitleBar > .historyItemTitle").wrap("<a href='javascript:void(0);'></a>").click(function(){var k;if(h.is(":visible")){if($.browser.mozilla){i.css("overflow","hidden")}h.slideUp("fast");if(!c){k=$.jStorage.get("history_expand_state");if(k){delete k[j];$.jStorage.set("history_expand_state",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){k=$.jStorage.get("history_expand_state");if(!k){k={}}k[j]=true;$.jStorage.set("history_expand_state",k)}}return false})});$("#top-links > a.toggle").click(function(){var h=$.jStorage.get("history_expand_state");if(!h){h={}}$("div.historyItemBody:visible").each(function(){if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(h){delete h[$(this).parent().attr("id")]}});$.jStorage.set("history_expand_state",h)}).show()};b()}function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}function reset_tool_search(a){var c=$("#galaxy_tools").contents();if(c.length===0){c=$(document)}$(this).removeClass("search_active");c.find(".toolTitle").removeClass("search_match");c.find(".toolSectionBody").hide();c.find(".toolTitle").show();c.find(".toolPanelLabel").show();c.find(".toolSectionWrapper").each(function(){if($(this).attr("id")!=="recently_used_wrapper"){$(this).show()}else{if($(this).hasClass("user_pref_visible")){$(this).show()}}});c.find("#search-no-results").hide();c.find("#search-spinner").hide();if(a){var b=c.find("#tool-search-query");b.val("search tools")}}var GalaxyAsync=function(a){this.url_dict={};this.log_action=(a===undefined?false:a)};GalaxyAsync.prototype.set_func_url=function(a,b){this.url_dict[a]=b};GalaxyAsync.prototype.set_user_pref=function(a,b){var c=this.url_dict[arguments.callee];if(c===undefined){return false}$.ajax({url:c,data:{pref_name:a,pref_value:b},error:function(){return false},success:function(){return true}})};GalaxyAsync.prototype.log_user_action=function(c,b,d){if(!this.log_action){return}var a=this.url_dict[arguments.callee];if(a===undefined){return false}$.ajax({url:a,data:{action:c,context:b,params:d},error:function(){return false},success:function(){return true}})};function init_refresh_on_change(){$("select[refresh_on_change='true']").off("change").change(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");$(document).trigger("convert_to_values");a.get(0).form.submit()});$(":checkbox[refresh_on_change='true']").off("click").click(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");a.get(0).form.submit()});$("a[confirm]").off("click").click(function(){return confirm($(this).attr("confirm"))})}$(document).ready(function(){init_refresh_on_change();if($.fn.tooltip){$(".unified-panel-header [title]").tooltip({placement:"bottom"});$("[title]").tooltip()}make_popup_menus();replace_big_select_inputs(20,1500);$("a").click(function(){var b=$(this);var c=(parent.frames&&parent.frames.galaxy_main);if((b.attr("target")=="galaxy_main")&&(!c)){var a=b.attr("href");if(a.indexOf("?")==-1){a+="?"}else{a+="&"}a+="use_panels=True";b.attr("href",a);b.attr("target","_self")}return b})});
\ No newline at end of file
+(function(){var b=0;var c=["ms","moz","webkit","o"];for(var a=0;a<c.length&&!window.requestAnimationFrame;++a){window.requestAnimationFrame=window[c[a]+"RequestAnimationFrame"];window.cancelRequestAnimationFrame=window[c[a]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame){window.requestAnimationFrame=function(h,e){var d=new Date().getTime();var f=Math.max(0,16-(d-b));var g=window.setTimeout(function(){h(d+f)},f);b=d+f;return g}}if(!window.cancelAnimationFrame){window.cancelAnimationFrame=function(d){clearTimeout(d)}}}());if(!Array.indexOf){Array.prototype.indexOf=function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]==c){return b}}return -1}}function obj_length(c){if(c.length!==undefined){return c.length}var b=0;for(var a in c){b++}return b}$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function make_popupmenu(b,c){var a=(b.data("menu_options"));b.data("menu_options",c);if(a){return}b.bind("click.show_popup",function(d){$(".popmenu-wrapper").remove();setTimeout(function(){var g=$("<ul class='dropdown-menu' id='"+b.attr("id")+"-menu'></ul>");var f=b.data("menu_options");if(obj_length(f)<=0){$("<li>No Options.</li>").appendTo(g)}$.each(f,function(j,i){if(i){var l=i.action||i;g.append($("<li></li>").append($("<a>").attr("href",i.url).html(j).click(l)))}else{g.append($("<li></li>").addClass("head").append($("<a href='#'></a>").html(j)))}});var h=$("<div class='popmenu-wrapper' style='position: absolute;left: 0; top: -1000;'></div>").append(g).appendTo("body");var e=d.pageX-h.width()/2;e=Math.min(e,$(document).scrollLeft()+$(window).width()-$(h).width()-5);e=Math.max(e,$(document).scrollLeft()+5);h.css({top:d.pageY,left:e})},10);setTimeout(function(){var f=function(h){$(h).bind("click.close_popup",function(){$(".popmenu-wrapper").remove();h.unbind("click.close_popup")})};f($(window.document));f($(window.top.document));for(var e=window.top.frames.length;e--;){var g=$(window.top.frames[e].document);f(g)}},50);return false})}function make_popup_menus(a){a=a||document;$(a).find("div[popupmenu]").each(function(){var b={};var d=$(this);d.find("a").each(function(){var g=$(this),i=g.get(0),e=i.getAttribute("confirm"),f=i.getAttribute("href"),h=i.getAttribute("target");if(!f){b[g.text()]=null}else{b[g.text()]={url:f,action:function(){if(!e||confirm(e)){if(h){window.open(f,h);return false}else{g.click()}}}}}});var c=$(a).find("#"+d.attr("popupmenu"));c.find("a").bind("click",function(f){f.stopPropagation();return true});make_popupmenu(c,b);c.addClass("popup");d.remove()})}function naturalSort(j,h){var p=/(-?[0-9\.]+)/g,k=j.toString().toLowerCase()||"",g=h.toString().toLowerCase()||"",l=String.fromCharCode(0),n=k.replace(p,l+"$1"+l).split(l),e=g.replace(p,l+"$1"+l).split(l),d=(new Date(k)).getTime(),o=d?(new Date(g)).getTime():null;if(o){if(d<o){return -1}else{if(d>o){return 1}}}var m,f;for(var i=0,c=Math.max(n.length,e.length);i<c;i++){m=parseFloat(n[i])||n[i];f=parseFloat(e[i])||e[i];if(m<f){return -1}else{if(m>f){return 1}}}return 0}$.fn.refresh_select2=function(){var b=$(this);var a={width:"resolve",closeOnSelect:!b.is("[MULTIPLE]")};return b.select2(a)};function replace_big_select_inputs(a,c,b){if(!jQuery.fn.select2){return}if(a===undefined){a=20}if(c===undefined){c=3000}b=b||$("select");b.each(function(){var e=$(this);var d=e.find("option").length;if((d<a)||(d>c)){return}if(e.hasClass("no-autocomplete")){return}e.refresh_select2()})}$.fn.make_text_editable=function(g){var d=("num_cols" in g?g.num_cols:30),c=("num_rows" in g?g.num_rows:4),e=("use_textarea" in g?g.use_textarea:false),b=("on_finish" in g?g.on_finish:null),f=("help_text" in g?g.help_text:null);var a=$(this);a.addClass("editable-text").click(function(l){if($(this).children(":input").length>0){return}a.removeClass("editable-text");var i=function(m){a.find(":input").remove();if(m!==""){a.text(m)}else{a.html("<br>")}a.addClass("editable-text");if(b){b(m)}};var h=("cur_text" in g?g.cur_text:a.text()),k,j;if(e){k=$("<textarea/>").attr({rows:c,cols:d}).text($.trim(h)).keyup(function(m){if(m.keyCode===27){i(h)}});j=$("<button/>").text("Done").click(function(){i(k.val());return false})}else{k=$("<input type='text'/>").attr({value:$.trim(h),size:d}).blur(function(){i(h)}).keyup(function(m){if(m.keyCode===27){$(this).trigger("blur")}else{if(m.keyCode===13){i($(this).val())}}m.stopPropagation()})}a.text("");a.append(k);if(j){a.append(j)}k.focus();k.select();l.stopPropagation()});if(f){a.attr("title",f).tooltip()}return a};function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).click(function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text($.trim(k))}else{j=$("<input type='text'></input>").attr({value:$.trim(k),size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){if(o!==""){l.text(o)}else{l.html("<em>None</em>")}if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(d,a,c){var b=function(){try{var e=$.jStorage.get("history_expand_state");if(e){for(var g in e){$("#"+g+" div.historyItemBody").show()}}}catch(f){$.jStorage.deleteKey("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.peek").css("overflow","hidden")}})}d.each(function(){var j=this.id,h=$(this).children("div.historyItemBody"),i=h.find("pre.peek");$(this).find(".historyItemTitleBar > .historyItemTitle").wrap("<a href='javascript:void(0);'></a>").click(function(){var k;if(h.is(":visible")){if($.browser.mozilla){i.css("overflow","hidden")}h.slideUp("fast");if(!c){k=$.jStorage.get("history_expand_state");if(k){delete k[j];$.jStorage.set("history_expand_state",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){k=$.jStorage.get("history_expand_state");if(!k){k={}}k[j]=true;$.jStorage.set("history_expand_state",k)}}return false})});$("#top-links > a.toggle").click(function(){var h=$.jStorage.get("history_expand_state");if(!h){h={}}$("div.historyItemBody:visible").each(function(){if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(h){delete h[$(this).parent().attr("id")]}});$.jStorage.set("history_expand_state",h)}).show()};b()}function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}function reset_tool_search(a){var c=$("#galaxy_tools").contents();if(c.length===0){c=$(document)}$(this).removeClass("search_active");c.find(".toolTitle").removeClass("search_match");c.find(".toolSectionBody").hide();c.find(".toolTitle").show();c.find(".toolPanelLabel").show();c.find(".toolSectionWrapper").each(function(){if($(this).attr("id")!=="recently_used_wrapper"){$(this).show()}else{if($(this).hasClass("user_pref_visible")){$(this).show()}}});c.find("#search-no-results").hide();c.find("#search-spinner").hide();if(a){var b=c.find("#tool-search-query");b.val("search tools")}}var GalaxyAsync=function(a){this.url_dict={};this.log_action=(a===undefined?false:a)};GalaxyAsync.prototype.set_func_url=function(a,b){this.url_dict[a]=b};GalaxyAsync.prototype.set_user_pref=function(a,b){var c=this.url_dict[arguments.callee];if(c===undefined){return false}$.ajax({url:c,data:{pref_name:a,pref_value:b},error:function(){return false},success:function(){return true}})};GalaxyAsync.prototype.log_user_action=function(c,b,d){if(!this.log_action){return}var a=this.url_dict[arguments.callee];if(a===undefined){return false}$.ajax({url:a,data:{action:c,context:b,params:d},error:function(){return false},success:function(){return true}})};function init_refresh_on_change(){$("select[refresh_on_change='true']").off("change").change(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");$(document).trigger("convert_to_values");a.get(0).form.submit()});$(":checkbox[refresh_on_change='true']").off("click").click(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");a.get(0).form.submit()});$("a[confirm]").off("click").click(function(){return confirm($(this).attr("confirm"))})}$(document).ready(function(){init_refresh_on_change();if($.fn.tooltip){$(".unified-panel-header [title]").tooltip({placement:"bottom"});$("[title]").tooltip()}make_popup_menus();replace_big_select_inputs(20,1500);$("a").click(function(){var b=$(this);var c=(parent.frames&&parent.frames.galaxy_main);if((b.attr("target")=="galaxy_main")&&(!c)){var a=b.attr("href");if(a.indexOf("?")==-1){a+="?"}else{a+="&"}a+="use_panels=True";b.attr("href",a);b.attr("target","_self")}return b})});
\ No newline at end of file
diff -r 8e2a9de88ddbf091e6462d2b563816028ef0107d -r 861535cf753a61bdc360b04d008dc504a5437e8c static/scripts/packed/mvc/library/library-folderlist-view.js
--- a/static/scripts/packed/mvc/library/library-folderlist-view.js
+++ b/static/scripts/packed/mvc/library/library-folderlist-view.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model","mvc/library/library-folderrow-view"],function(c,e,f,d,a){var b=Backbone.View.extend({el:"#folder_items_element",progress:0,progressStep:1,modal:null,folderContainer:null,sort:"asc",events:{"click #select-all-checkboxes":"selectAll","click .dataset_row":"selectClickedRow","click .sort-folder-link":"sort_clicked"},initialize:function(g){this.options=_.defaults(this.options||{},g);this.collection=new d.Folder();this.listenTo(this.collection,"add",this.renderOne);this.fetchFolder()},fetchFolder:function(){var g=this;this.folderContainer=new d.FolderContainer({id:this.options.id});this.folderContainer.url=this.folderContainer.attributes.urlRoot+this.options.id+"/contents";this.folderContainer.fetch({success:function(h){g.folder_container=h;g.render();g.addAll(h.get("folder").models)},error:function(i,h){if(typeof h.responseJSON!=="undefined"){f.error(h.responseJSON.err_msg)}else{f.error("An error ocurred :(")}}})},render:function(g){this.options=_.defaults(this.options||{},g);var i=this.templateFolder();var j=this.folderContainer.attributes.metadata.full_path;var k;if(j.length===1){k=0}else{k=j[j.length-2][0]}this.$el.html(i({path:this.folderContainer.attributes.metadata.full_path,id:this.options.id,upper_folder_id:k,order:this.sort}));var h=this.folderContainer.attributes.metadata;h.contains_file=this.options.contains_file;Galaxy.libraries.folderToolbarView.configureElements(h);$("#center [data-toggle]").tooltip();$("#center").css("overflow","auto")},addAll:function(g){_.each(g.reverse(),function(h){Galaxy.libraries.folderListView.collection.add(h)});this.checkEmptiness()},renderAll:function(){var g=this;_.each(this.collection.models.reverse(),function(h){g.renderOne(h)})},renderOne:function(h){if(h.get("data_type")!=="folder"){this.options.contains_file=true;h.set("readable_size",this.size_to_string(h.get("file_size")))}var g=new a.FolderRowView(h);this.$el.find("#first_folder_item").after(g.el);this.checkEmptiness()},checkEmptiness:function(){if((this.$el.find(".dataset_row").length===0)&&(this.$el.find(".folder_row").length===0)){var g=this.templateEmptyFolder();this.$el.find("#folder_list_body").append(g())}else{this.$el.find("#empty_folder_message").remove()}},sort_clicked:function(g){g.preventDefault();if(this.sort==="asc"){this.sortFolder("name","desc");this.sort="desc"}else{this.sortFolder("name","asc");this.sort="asc"}this.render();this.renderAll()},sortFolder:function(h,g){if(h==="name"){if(g==="asc"){return this.collection.sortByNameAsc()}else{if(g==="desc"){return this.collection.sortByNameDesc()}}}},size_to_string:function(g){var h="";if(g>=100000000000){g=g/100000000000;h="TB"}else{if(g>=100000000){g=g/100000000;h="GB"}else{if(g>=100000){g=g/100000;h="MB"}else{if(g>=100){g=g/100;h="KB"}else{g=g*10;h="b"}}}}return(Math.round(g)/10)+h},selectAll:function(h){var g=h.target.checked;that=this;$(":checkbox").each(function(){this.checked=g;$row=$(this.parentElement.parentElement);if(g){that.makeDarkRow($row)}else{that.makeWhiteRow($row)}})},selectClickedRow:function(h){var j="";var g;var i;if(h.target.localName==="input"){j=h.target;g=$(h.target.parentElement.parentElement);i="input"}else{if(h.target.localName==="td"){j=$("#"+h.target.parentElement.id).find(":checkbox")[0];g=$(h.target.parentElement);i="td"}}if(j.checked){if(i==="td"){j.checked="";this.makeWhiteRow(g)}else{if(i==="input"){this.makeDarkRow(g)}}}else{if(i==="td"){j.checked="selected";this.makeDarkRow(g)}else{if(i==="input"){this.makeWhiteRow(g)}}}},makeDarkRow:function(g){g.removeClass("light");g.find("a").removeClass("light");g.addClass("dark");g.find("a").addClass("dark");g.find("span").removeClass("fa-file-o");g.find("span").addClass("fa-file")},makeWhiteRow:function(g){g.removeClass("dark");g.find("a").removeClass("dark");g.addClass("light");g.find("a").addClass("light");g.find("span").addClass("fa-file-o");g.find("span").removeClass("fa-file")},templateFolder:function(){var g=[];g.push('<ol class="breadcrumb">');g.push(' <li><a title="Return to the list of libraries" href="#">Libraries</a></li>');g.push(" <% _.each(path, function(path_item) { %>");g.push(" <% if (path_item[0] != id) { %>");g.push(' <li><a title="Return to this folder" href="#/folders/<%- path_item[0] %>"><%- path_item[1] %></a></li> ');g.push("<% } else { %>");g.push(' <li class="active"><span title="You are in this folder"><%- path_item[1] %></span></li>');g.push(" <% } %>");g.push(" <% }); %>");g.push("</ol>");g.push('<table id="folder_table" class="grid table table-condensed">');g.push(" <thead>");g.push(' <th class="button_heading"></th>');g.push(' <th style="text-align: center; width: 20px; " title="Check to select all datasets"><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');g.push(' <th><a class="sort-folder-link" title="Click to reverse order" href="#">name</a><span title="Sorted alphabetically" class="fa fa-sort-alpha-<%- order %>"></span></th>');g.push(" <th>data type</th>");g.push(" <th>size</th>");g.push(" <th>time updated (UTC)</th>");g.push(" </thead>");g.push(' <tbody id="folder_list_body">');g.push(' <tr id="first_folder_item">');g.push(' <td><a href="#<% if (upper_folder_id !== 0){ print("folders/" + upper_folder_id)} %>" title="Go to parent folder" class="btn_open_folder btn btn-default btn-xs">..<a></td>');g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" </tr>");g.push(" </tbody>");g.push("</table>");return _.template(g.join(""))},templateEmptyFolder:function(){var g=[];g.push('<tr id="empty_folder_message">');g.push('<td colspan="6" style="text-align:center">');g.push("This folder is either empty or you do not have proper access permissions to see the contents.");g.push("</td>");g.push("</tr>");return _.template(g.join(""))}});return{FolderListView:b}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model","mvc/library/library-folderrow-view"],function(c,e,f,d,a){var b=Backbone.View.extend({el:"#folder_items_element",defaults:{include_deleted:false},progress:0,progressStep:1,modal:null,folderContainer:null,sort:"asc",events:{"click #select-all-checkboxes":"selectAll","click .dataset_row":"selectClickedRow","click .sort-folder-link":"sort_clicked"},initialize:function(g){this.options=_.defaults(this.options||{},g);this.collection=new d.Folder();this.listenTo(this.collection,"add",this.renderOne);this.fetchFolder()},fetchFolder:function(g){var g=g||{};this.options.include_deleted=g.include_deleted;var h=this;this.folderContainer=new d.FolderContainer({id:this.options.id});this.folderContainer.url=this.folderContainer.attributes.urlRoot+this.options.id+"/contents";if(this.options.include_deleted){this.folderContainer.url=this.folderContainer.url+"?include_deleted=true"}this.folderContainer.fetch({success:function(i){h.folder_container=i;h.render();h.addAll(i.get("folder").models)},error:function(j,i){if(typeof i.responseJSON!=="undefined"){f.error(i.responseJSON.err_msg)}else{f.error("An error ocurred :(")}}})},render:function(g){this.options=_.defaults(this.options,g);var i=this.templateFolder();var j=this.folderContainer.attributes.metadata.full_path;var k;if(j.length===1){k=0}else{k=j[j.length-2][0]}this.$el.html(i({path:this.folderContainer.attributes.metadata.full_path,id:this.options.id,upper_folder_id:k,order:this.sort}));var h=this.folderContainer.attributes.metadata;h.contains_file=this.options.contains_file;Galaxy.libraries.folderToolbarView.configureElements(h);$("#center [data-toggle]").tooltip();$("#center").css("overflow","auto")},addAll:function(g){_.each(g.reverse(),function(h){Galaxy.libraries.folderListView.collection.add(h)});$("#center [data-toggle]").tooltip();this.checkEmptiness()},renderAll:function(){var g=this;_.each(this.collection.models.reverse(),function(h){g.renderOne(h)})},renderOne:function(h){if(h.get("data_type")!=="folder"){this.options.contains_file=true;h.set("readable_size",this.size_to_string(h.get("file_size")))}var g=new a.FolderRowView(h);this.$el.find("#first_folder_item").after(g.el);this.checkEmptiness()},checkEmptiness:function(){if((this.$el.find(".dataset_row").length===0)&&(this.$el.find(".folder_row").length===0)){var g=this.templateEmptyFolder();this.$el.find("#folder_list_body").append(g())}else{this.$el.find("#empty_folder_message").remove()}},sort_clicked:function(g){g.preventDefault();if(this.sort==="asc"){this.sortFolder("name","desc");this.sort="desc"}else{this.sortFolder("name","asc");this.sort="asc"}this.render();this.renderAll()},sortFolder:function(h,g){if(h==="name"){if(g==="asc"){return this.collection.sortByNameAsc()}else{if(g==="desc"){return this.collection.sortByNameDesc()}}}},size_to_string:function(g){var h="";if(g>=100000000000){g=g/100000000000;h="TB"}else{if(g>=100000000){g=g/100000000;h="GB"}else{if(g>=100000){g=g/100000;h="MB"}else{if(g>=100){g=g/100;h="KB"}else{g=g*10;h="b"}}}}return(Math.round(g)/10)+h},selectAll:function(h){var g=h.target.checked;that=this;$(":checkbox").each(function(){this.checked=g;$row=$(this.parentElement.parentElement);if(g){that.makeDarkRow($row)}else{that.makeWhiteRow($row)}})},selectClickedRow:function(h){var j="";var g;var i;if(h.target.localName==="input"){j=h.target;g=$(h.target.parentElement.parentElement);i="input"}else{if(h.target.localName==="td"){j=$("#"+h.target.parentElement.id).find(":checkbox")[0];g=$(h.target.parentElement);i="td"}}if(j.checked){if(i==="td"){j.checked="";this.makeWhiteRow(g)}else{if(i==="input"){this.makeDarkRow(g)}}}else{if(i==="td"){j.checked="selected";this.makeDarkRow(g)}else{if(i==="input"){this.makeWhiteRow(g)}}}},makeDarkRow:function(g){g.removeClass("light");g.find("a").removeClass("light");g.addClass("dark");g.find("a").addClass("dark");g.find("span").removeClass("fa-file-o");g.find("span").addClass("fa-file")},makeWhiteRow:function(g){g.removeClass("dark");g.find("a").removeClass("dark");g.addClass("light");g.find("a").addClass("light");g.find("span").addClass("fa-file-o");g.find("span").removeClass("fa-file")},templateFolder:function(){var g=[];g.push('<ol class="breadcrumb">');g.push(' <li><a title="Return to the list of libraries" href="#">Libraries</a></li>');g.push(" <% _.each(path, function(path_item) { %>");g.push(" <% if (path_item[0] != id) { %>");g.push(' <li><a title="Return to this folder" href="#/folders/<%- path_item[0] %>"><%- path_item[1] %></a></li> ');g.push("<% } else { %>");g.push(' <li class="active"><span title="You are in this folder"><%- path_item[1] %></span></li>');g.push(" <% } %>");g.push(" <% }); %>");g.push("</ol>");g.push('<table id="folder_table" class="grid table table-condensed">');g.push(" <thead>");g.push(' <th class="button_heading"></th>');g.push(' <th style="text-align: center; width: 20px; " title="Check to select all datasets"><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');g.push(' <th><a class="sort-folder-link" title="Click to reverse order" href="#">name</a><span title="Sorted alphabetically" class="fa fa-sort-alpha-<%- order %>"></span></th>');g.push(" <th>data type</th>");g.push(" <th>size</th>");g.push(" <th>time updated (UTC)</th>");g.push(" </thead>");g.push(' <tbody id="folder_list_body">');g.push(' <tr id="first_folder_item">');g.push(' <td><a href="#<% if (upper_folder_id !== 0){ print("folders/" + upper_folder_id)} %>" title="Go to parent folder" class="btn_open_folder btn btn-default btn-xs">..<a></td>');g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" </tr>");g.push(" </tbody>");g.push("</table>");return _.template(g.join(""))},templateEmptyFolder:function(){var g=[];g.push('<tr id="empty_folder_message">');g.push('<td colspan="6" style="text-align:center">');g.push("This folder is either empty or you do not have proper access permissions to see the contents.");g.push("</td>");g.push("</tr>");return _.template(g.join(""))}});return{FolderListView:b}});
\ No newline at end of file
diff -r 8e2a9de88ddbf091e6462d2b563816028ef0107d -r 861535cf753a61bdc360b04d008dc504a5437e8c static/scripts/packed/mvc/library/library-folderrow-view.js
--- a/static/scripts/packed/mvc/library/library-folderrow-view.js
+++ b/static/scripts/packed/mvc/library/library-folderrow-view.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(b,d,e,c){var a=Backbone.View.extend({lastSelectedHistory:"",events:{"click .library-dataset":"showDatasetDetails"},options:{type:null},initialize:function(f){this.render(f)},render:function(f){var g=null;if(f.get("type")==="folder"){this.options.type="folder";g=this.templateRowFolder()}else{this.options.type="file";g=this.templateRowFile()}this.setElement(g({content_item:f}));this.$el.show();return this},showDatasetDetails:function(i){i.preventDefault();var j=this.id;var h=new c.Item();var g=new c.GalaxyHistories();h.id=j;var f=this;h.fetch({success:function(k){g.fetch({success:function(l){f.renderModalAfterFetch(k,l)},error:function(){e.error("An error occured during fetching histories:(");f.renderModalAfterFetch(k)}})},error:function(){e.error("An error occured during loading dataset details :(")}})},renderModalAfterFetch:function(k,h){var i=this.size_to_string(k.get("file_size"));var j=_.template(this.templateDatasetModal(),{item:k,size:i});var g=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Dataset Details",body:j,buttons:{Import:function(){g.importCurrentIntoHistory()},Download:function(){g.downloadCurrent()},Close:function(){g.modal.hide()}}});$(".peek").html(k.get("peek"));if(typeof history.models!==undefined){var f=_.template(this.templateHistorySelectInModal(),{histories:h.models});$(this.modal.elMain).find(".buttons").prepend(f);if(g.lastSelectedHistory.length>0){$(this.modal.elMain).find("#dataset_import_single").val(g.lastSelectedHistory)}}},size_to_string:function(f){var g="";if(f>=100000000000){f=f/100000000000;g="TB"}else{if(f>=100000000){f=f/100000000;g="GB"}else{if(f>=100000){f=f/100000;g="MB"}else{if(f>=100){f=f/100;g="KB"}else{f=f*10;g="b"}}}}return(Math.round(f)/10)+g},downloadCurrent:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var f=[];f.push($("#id_row").attr("data-id"));var g="/api/libraries/datasets/download/uncompressed";var h={ldda_ids:f};this.processDownload(g,h);this.modal.enableButton("Import");this.modal.enableButton("Download")},processDownload:function(g,h,i){if(g&&h){h=typeof h=="string"?h:$.param(h);var f="";$.each(h.split("&"),function(){var j=this.split("=");f+='<input type="hidden" name="'+j[0]+'" value="'+j[1]+'" />'});$('<form action="'+g+'" method="'+(i||"post")+'">'+f+"</form>").appendTo("body").submit().remove();e.info("Your download will begin soon")}},importCurrentIntoHistory:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var h=$(this.modal.elMain).find("select[name=dataset_import_single] option:selected").val();this.lastSelectedHistory=h;var f=$("#id_row").attr("data-id");var i=new c.HistoryItem();var g=this;i.url=i.urlRoot+h+"/contents";i.save({content:f,source:"library"},{success:function(){e.success("Dataset imported");g.modal.enableButton("Import");g.modal.enableButton("Download")},error:function(){e.error("An error occured! Dataset not imported. Please try again.");g.modal.enableButton("Import");g.modal.enableButton("Download")}})},templateRowFolder:function(){tmpl_array=[];tmpl_array.push('<tr class="folder_row light" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Folder" class="fa fa-folder-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(" <td></td>");tmpl_array.push(" <td>");tmpl_array.push(' <a href="#folders/<%- content_item.id %>"><%- content_item.get("name") %></a>');tmpl_array.push(' <% if (content_item.get("item_count") === 0) { %>');tmpl_array.push(" <span>(empty folder)</span>");tmpl_array.push(" <% } %>");tmpl_array.push(" </td>");tmpl_array.push(" <td>folder</td>");tmpl_array.push(" <td></td>");tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateRowFile:function(){tmpl_array=[];tmpl_array.push('<tr class="dataset_row light" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Dataset" class="fa fa-file-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(' <td style="text-align: center; "><input style="margin: 0;" type="checkbox"></td>');tmpl_array.push(' <td><a href="#" class="library-dataset"><%- content_item.get("name") %><a></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateDatasetModal:function(){var f=[];f.push('<div class="modal_table">');f.push(' <table class="grid table table-striped table-condensed">');f.push(" <tr>");f.push(' <th scope="row" id="id_row" data-id="<%= _.escape(item.get("ldda_id")) %>">Name</th>');f.push(' <td><%= _.escape(item.get("name")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Data type</th>');f.push(' <td><%= _.escape(item.get("data_type")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Genome build</th>');f.push(' <td><%= _.escape(item.get("genome_build")) %></td>');f.push(" </tr>");f.push(' <th scope="row">Size</th>');f.push(" <td><%= _.escape(size) %></td>");f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Date uploaded (UTC)</th>');f.push(' <td><%= _.escape(item.get("date_uploaded")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Uploaded by</th>');f.push(' <td><%= _.escape(item.get("uploaded_by")) %></td>');f.push(" </tr>");f.push(' <tr scope="row">');f.push(' <th scope="row">Data Lines</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_data_lines")) %></td>');f.push(" </tr>");f.push(' <th scope="row">Comment Lines</th>');f.push(' <% if (item.get("metadata_comment_lines") === "") { %>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_comment_lines")) %></td>');f.push(" <% } else { %>");f.push(' <td scope="row">unknown</td>');f.push(" <% } %>");f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Number of Columns</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_columns")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Column Types</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_column_types")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Miscellaneous information</th>');f.push(' <td scope="row"><%= _.escape(item.get("misc_blurb")) %></td>');f.push(" </tr>");f.push(" </table>");f.push(' <pre class="peek">');f.push(" </pre>");f.push("</div>");return f.join("")},templateHistorySelectInModal:function(){var f=[];f.push('<span id="history_modal_combo" style="width:100%; margin-left: 1em; margin-right: 1em; ">');f.push("Select history: ");f.push('<select id="dataset_import_single" name="dataset_import_single" style="width:40%; margin-bottom: 1em; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</span>");return f.join("")}});return{FolderRowView:a}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(b,d,e,c){var a=Backbone.View.extend({lastSelectedHistory:"",events:{"click .library-dataset":"showDatasetDetails"},options:{type:null},initialize:function(f){this.render(f)},render:function(f){var g=null;if(f.get("type")==="folder"){this.options.type="folder";g=this.templateRowFolder()}else{this.options.type="file";if(f.get("deleted")){g=this.templateRowDeletedFile()}else{g=this.templateRowFile()}}this.setElement(g({content_item:f}));this.$el.show();return this},showDatasetDetails:function(i){i.preventDefault();var j=this.id;var h=new c.Item();var g=new c.GalaxyHistories();h.id=j;var f=this;h.fetch({success:function(k){g.fetch({success:function(l){f.renderModalAfterFetch(k,l)},error:function(){e.error("An error occured during fetching histories:(");f.renderModalAfterFetch(k)}})},error:function(){e.error("An error occured during loading dataset details :(")}})},renderModalAfterFetch:function(k,h){var i=this.size_to_string(k.get("file_size"));var j=_.template(this.templateDatasetModal(),{item:k,size:i});var g=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Dataset Details",body:j,buttons:{Import:function(){g.importCurrentIntoHistory()},Download:function(){g.downloadCurrent()},Close:function(){g.modal.hide()}}});$(".peek").html(k.get("peek"));if(typeof history.models!==undefined){var f=_.template(this.templateHistorySelectInModal(),{histories:h.models});$(this.modal.elMain).find(".buttons").prepend(f);if(g.lastSelectedHistory.length>0){$(this.modal.elMain).find("#dataset_import_single").val(g.lastSelectedHistory)}}},size_to_string:function(f){var g="";if(f>=100000000000){f=f/100000000000;g="TB"}else{if(f>=100000000){f=f/100000000;g="GB"}else{if(f>=100000){f=f/100000;g="MB"}else{if(f>=100){f=f/100;g="KB"}else{f=f*10;g="b"}}}}return(Math.round(f)/10)+g},downloadCurrent:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var f=[];f.push($("#id_row").attr("data-id"));var g="/api/libraries/datasets/download/uncompressed";var h={ldda_ids:f};this.processDownload(g,h);this.modal.enableButton("Import");this.modal.enableButton("Download")},processDownload:function(g,h,i){if(g&&h){h=typeof h=="string"?h:$.param(h);var f="";$.each(h.split("&"),function(){var j=this.split("=");f+='<input type="hidden" name="'+j[0]+'" value="'+j[1]+'" />'});$('<form action="'+g+'" method="'+(i||"post")+'">'+f+"</form>").appendTo("body").submit().remove();e.info("Your download will begin soon")}},importCurrentIntoHistory:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var h=$(this.modal.elMain).find("select[name=dataset_import_single] option:selected").val();this.lastSelectedHistory=h;var f=$("#id_row").attr("data-id");var i=new c.HistoryItem();var g=this;i.url=i.urlRoot+h+"/contents";i.save({content:f,source:"library"},{success:function(){e.success("Dataset imported");g.modal.enableButton("Import");g.modal.enableButton("Download")},error:function(){e.error("An error occured! Dataset not imported. Please try again.");g.modal.enableButton("Import");g.modal.enableButton("Download")}})},templateRowFolder:function(){tmpl_array=[];tmpl_array.push('<tr class="folder_row light" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Folder" class="fa fa-folder-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(" <td></td>");tmpl_array.push(" <td>");tmpl_array.push(' <a href="#folders/<%- content_item.id %>"><%- content_item.get("name") %></a>');tmpl_array.push(' <% if (content_item.get("item_count") === 0) { %>');tmpl_array.push(" <span>(empty folder)</span>");tmpl_array.push(" <% } %>");tmpl_array.push(" </td>");tmpl_array.push(" <td>folder</td>");tmpl_array.push(" <td></td>");tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateRowFile:function(){tmpl_array=[];tmpl_array.push('<tr class="dataset_row light" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Dataset" class="fa fa-file-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(' <td style="text-align: center; "><input style="margin: 0;" type="checkbox"></td>');tmpl_array.push(' <td><a href="#" class="library-dataset"><%- content_item.get("name") %><a></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateRowDeletedFile:function(){tmpl_array=[];tmpl_array.push('<tr class="active" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Dataset" class="fa fa-file-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(' <td><span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg"></span></td>');tmpl_array.push(' <td style="color:grey;"><%- content_item.get("name") %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateDatasetModal:function(){var f=[];f.push('<div class="modal_table">');f.push(' <table class="grid table table-striped table-condensed">');f.push(" <tr>");f.push(' <th scope="row" id="id_row" data-id="<%= _.escape(item.get("ldda_id")) %>">Name</th>');f.push(' <td><%= _.escape(item.get("name")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Data type</th>');f.push(' <td><%= _.escape(item.get("data_type")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Genome build</th>');f.push(' <td><%= _.escape(item.get("genome_build")) %></td>');f.push(" </tr>");f.push(' <th scope="row">Size</th>');f.push(" <td><%= _.escape(size) %></td>");f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Date uploaded (UTC)</th>');f.push(' <td><%= _.escape(item.get("date_uploaded")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Uploaded by</th>');f.push(' <td><%= _.escape(item.get("uploaded_by")) %></td>');f.push(" </tr>");f.push(' <tr scope="row">');f.push(' <th scope="row">Data Lines</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_data_lines")) %></td>');f.push(" </tr>");f.push(' <th scope="row">Comment Lines</th>');f.push(' <% if (item.get("metadata_comment_lines") === "") { %>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_comment_lines")) %></td>');f.push(" <% } else { %>");f.push(' <td scope="row">unknown</td>');f.push(" <% } %>");f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Number of Columns</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_columns")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Column Types</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_column_types")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Miscellaneous information</th>');f.push(' <td scope="row"><%= _.escape(item.get("misc_blurb")) %></td>');f.push(" </tr>");f.push(" </table>");f.push(' <pre class="peek">');f.push(" </pre>");f.push("</div>");return f.join("")},templateHistorySelectInModal:function(){var f=[];f.push('<span id="history_modal_combo" style="width:100%; margin-left: 1em; margin-right: 1em; ">');f.push("Select history: ");f.push('<select id="dataset_import_single" name="dataset_import_single" style="width:40%; margin-bottom: 1em; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</span>");return f.join("")}});return{FolderRowView:a}});
\ No newline at end of file
diff -r 8e2a9de88ddbf091e6462d2b563816028ef0107d -r 861535cf753a61bdc360b04d008dc504a5437e8c static/scripts/packed/mvc/library/library-foldertoolbar-view.js
--- a/static/scripts/packed/mvc/library/library-foldertoolbar-view.js
+++ b/static/scripts/packed/mvc/library/library-foldertoolbar-view.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(b,d,e,c){var a=Backbone.View.extend({el:"#center",events:{"click #toolbtn_create_folder":"createFolderFromModal","click #toolbtn_bulk_import":"modalBulkImport","click .toolbtn_add_files":"addFilesToFolderModal"},defaults:{can_add_library_item:false,contains_file:false,chain_call_control:{total_number:0,failed_number:0}},modal:null,histories:null,initialize:function(f){this.options=_.defaults(f||{},this.defaults);this.render()},render:function(f){this.options=_.extend(this.options,f);var h=this.templateToolBar();var g=false;if(Galaxy.currUser){g=Galaxy.currUser.isAdmin()}this.$el.html(h({id:this.options.id,admin_user:g}))},configureElements:function(f){this.options=_.extend(this.options,f);if(this.options.can_add_library_item===true){$("#toolbtn_create_folder").show();$(".toolbtn_add_files").show()}if(this.options.contains_file===true){$("#toolbtn_bulk_import").show();$("#toolbtn_dl").show()}this.$el.find("[data-toggle]").tooltip()},createFolderFromModal:function(){event.preventDefault();event.stopPropagation();var f=this;var g=this.templateNewFolderInModal();this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Create New Folder",body:g(),buttons:{Create:function(){f.create_new_folder_event()},Close:function(){Galaxy.modal.hide()}}})},create_new_folder_event:function(){var f=this.serialize_new_folder();if(this.validate_new_folder(f)){var g=new c.FolderAsModel();url_items=Backbone.history.fragment.split("/");current_folder_id=url_items[url_items.length-1];g.url=g.urlRoot+"/"+current_folder_id;g.save(f,{success:function(h){Galaxy.modal.hide();e.success("Folder created");h.set({type:"folder"});Galaxy.libraries.folderListView.collection.add(h)},error:function(i,h){Galaxy.modal.hide();if(typeof h.responseJSON!=="undefined"){e.error(h.responseJSON.err_msg)}else{e.error("An error ocurred :(")}}})}else{e.error("Folder's name is missing")}return false},serialize_new_folder:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val()}},validate_new_folder:function(f){return f.name!==""},modalBulkImport:function(){var f=$("#folder_table").find(":checked");if(f.length===0){e.info("You have to select some datasets first")}else{this.refreshUserHistoriesList(function(g){var h=g.templateBulkImportInModal();g.modal=Galaxy.modal;g.modal.show({closing_events:true,title:"Import into History",body:h({histories:g.histories.models}),buttons:{Import:function(){g.importAllIntoHistory()},Close:function(){Galaxy.modal.hide()}}})})}},refreshUserHistoriesList:function(g){var f=this;this.histories=new c.GalaxyHistories();this.histories.fetch({success:function(){g(f)},error:function(i,h){if(typeof h.responseJSON!=="undefined"){e.error(h.responseJSON.err_msg)}else{e.error("An error ocurred :(")}}})},importAllIntoHistory:function(){this.modal.disableButton("Import");this.options.chain_call_control.total_number=0;this.options.chain_call_control.failed_number=0;var j=$("select[name=dataset_import_bulk] option:selected").val();this.options.last_used_history_id=j;var m=$("select[name=dataset_import_bulk] option:selected").text();var o=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!==""){o.push(this.parentElement.parentElement.id)}});var n=this.templateImportIntoHistoryProgressBar();this.modal.$el.find(".modal-body").html(n({history_name:m}));var k=100/o.length;this.initProgress(k);var f=[];for(var g=o.length-1;g>=0;g--){var h=o[g];var l=new c.HistoryItem();l.url=l.urlRoot+j+"/contents";l.content=h;l.source="library";f.push(l)}this.options.chain_call_control.total_number=f.length;this.chainCall(f,m)},chainCall:function(g,j){var f=this;var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets imported into history")}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were imported into history.")}else{if(this.options.chain_call_control.failed_number<this.options.chain_call_control.total_number){e.warning("Some of the datasets could not be imported into history")}}}Galaxy.modal.hide();return}var i=$.when(h.save({content:h.content,source:h.source}));i.done(function(){f.updateProgress();f.chainCall(g,j)}).fail(function(){f.options.chain_call_control.failed_number+=1;f.updateProgress();f.chainCall(g,j)})},initProgress:function(f){this.progress=0;this.progressStep=f},updateProgress:function(){this.progress+=this.progressStep;$(".progress-bar-import").width(Math.round(this.progress)+"%");txt_representation=Math.round(this.progress)+"% Complete";$(".completion_span").text(txt_representation)},download:function(f,j){var h=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!==""){h.push(this.parentElement.parentElement.id)}});var g="/api/libraries/datasets/download/"+j;var i={ldda_ids:h};this.processDownload(g,i,"get")},processDownload:function(g,h,i){if(g&&h){h=typeof h==="string"?h:$.param(h);var f="";$.each(h.split("&"),function(){var j=this.split("=");f+='<input type="hidden" name="'+j[0]+'" value="'+j[1]+'" />'});$('<form action="'+g+'" method="'+(i||"post")+'">'+f+"</form>").appendTo("body").submit().remove();e.info("Your download will begin soon")}},addFilesToFolderModal:function(){this.refreshUserHistoriesList(function(f){f.modal=Galaxy.modal;var g=f.templateAddFilesInModal();f.modal.show({closing_events:true,title:"Add datasets from history to "+f.options.folder_name,body:g({histories:f.histories.models}),buttons:{Add:function(){f.addAllDatasetsFromHistory()},Close:function(){Galaxy.modal.hide()}}});if(f.histories.models.length>0){f.fetchAndDisplayHistoryContents(f.histories.models[0].id);$("#dataset_add_bulk").change(function(h){f.fetchAndDisplayHistoryContents(h.target.value)})}else{e.error("An error ocurred :(")}})},fetchAndDisplayHistoryContents:function(h){var g=new c.HistoryContents({id:h});var f=this;g.fetch({success:function(j){var i=f.templateHistoryContents();f.histories.get(h).set({contents:j});f.modal.$el.find("#selected_history_content").html(i({history_contents:j.models.reverse()}))},error:function(){e.error("An error ocurred :(")}})},addAllDatasetsFromHistory:function(){this.modal.disableButton("Add");this.options.chain_call_control.total_number=0;this.options.chain_call_control.failed_number=0;var f=[];this.modal.$el.find("#selected_history_content").find(":checked").each(function(){var i=$(this.parentElement).data("id");if(i){f.push(i)}});var l=this.options.folder_name;var k=this.templateAddingDatasetsProgressBar();this.modal.$el.find(".modal-body").html(k({folder_name:l}));this.progressStep=100/f.length;this.progress=0;var j=[];for(var h=f.length-1;h>=0;h--){history_dataset_id=f[h];var g=new c.Item();g.url="/api/folders/"+this.options.id+"/contents";g.set({from_hda_id:history_dataset_id});j.push(g)}this.options.chain_call_control.total_number=j.length;this.chainCallAddingHdas(j)},chainCallAddingHdas:function(g){var f=this;this.added_hdas=new c.Folder();var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets from history added to the folder")}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were added to the folder.")}else{if(this.options.chain_call_control.failed_number<this.options.chain_call_control.total_number){e.warning("Some of the datasets could not be added to the folder")}}}Galaxy.modal.hide();return this.added_hdas}var i=$.when(h.save({from_hda_id:h.get("from_hda_id")}));i.done(function(j){Galaxy.libraries.folderListView.collection.add(j);f.updateProgress();f.chainCallAddingHdas(g)}).fail(function(){f.options.chain_call_control.failed_number+=1;f.updateProgress();f.chainCallAddingHdas(g)})},templateToolBar:function(){tmpl_array=[];tmpl_array.push('<div class="library_style_container">');tmpl_array.push('<h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fol…" target="_blank">Trello</a>.</h3>');tmpl_array.push('<div id="library_folder_toolbar">');tmpl_array.push('<span data-toggle="tooltip" data-placement="top" title="Include deleted datasets"><input id="include_deleted_datasets_chk" style="margin: 0;" type="checkbox"><span class="fa fa-trash-o fa-lg"></span></input></span>');tmpl_array.push('<div class="btn-group">');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Create New Folder" id="toolbtn_create_folder" class="btn btn-default primary-button" type="button" style="display:none;"><span class="fa fa-plus"></span><span class="fa fa-folder"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Add Datasets to Current Folder" id="toolbtn_add_files" class="btn btn-default toolbtn_add_files primary-button" type="button" style="display:none;"><span class="fa fa-plus"></span><span class="fa fa-file"></span></span></button>');tmpl_array.push("</div>");tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Import selected datasets into history" id="toolbtn_bulk_import" class="primary-button" style="margin-left: 0.5em; " type="button"><span class="fa fa-book"></span> to history</button>');tmpl_array.push(' <div id="toolbtn_dl" class="btn-group" style="margin-left: 0.5em; ">');tmpl_array.push(' <button title="Download selected datasets as archive" id="drop_toggle" type="button" class="primary-button dropdown-toggle" data-toggle="dropdown">');tmpl_array.push(' <span class="fa fa-download"></span> download <span class="caret"></span>');tmpl_array.push(" </button>");tmpl_array.push(' <ul class="dropdown-menu" role="menu">');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/tgz">.tar.gz</a></li>');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/tbz">.tar.bz</a></li>');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/zip">.zip</a></li>');tmpl_array.push(" </ul>");tmpl_array.push(" </div>");tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Mark selected datasets deleted" id="toolbtn_bulk_delete" class="primary-button" style="margin-left: 0.5em; " type="button"><span class="fa fa-trash-o"></span> delete</button>');tmpl_array.push(" </div>");tmpl_array.push(' <div id="folder_items_element">');tmpl_array.push(" </div>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))},templateNewFolderInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_folder_modal">');tmpl_array.push("<form>");tmpl_array.push('<input type="text" name="Name" value="" placeholder="Name">');tmpl_array.push('<input type="text" name="Description" value="" placeholder="Description">');tmpl_array.push("</form>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))},templateBulkImportInModal:function(){var f=[];f.push('<span id="history_modal_combo_bulk" style="width:90%; margin-left: 1em; margin-right: 1em; ">');f.push("Select history: ");f.push('<select id="dataset_import_bulk" name="dataset_import_bulk" style="width:50%; margin-bottom: 1em; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</span>");return _.template(f.join(""))},templateImportIntoHistoryProgressBar:function(){var f=[];f.push('<div class="import_text">');f.push("Importing selected datasets to history <b><%= _.escape(history_name) %></b>");f.push("</div>");f.push('<div class="progress">');f.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');f.push(' <span class="completion_span">0% Complete</span>');f.push(" </div>");f.push("</div>");f.push("");return _.template(f.join(""))},templateAddingDatasetsProgressBar:function(){var f=[];f.push('<div class="import_text">');f.push("Adding selected datasets from history to library folder <b><%= _.escape(folder_name) %></b>");f.push("</div>");f.push('<div class="progress">');f.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');f.push(' <span class="completion_span">0% Complete</span>');f.push(" </div>");f.push("</div>");f.push("");return _.template(f.join(""))},templateAddFilesInModal:function(){var f=[];f.push('<div id="add_files_modal">');f.push('<div id="history_modal_combo_bulk">');f.push("Select history: ");f.push('<select id="dataset_add_bulk" name="dataset_add_bulk" style="width:66%; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</div>");f.push('<div id="selected_history_content">');f.push("</div>");f.push("</div>");return _.template(f.join(""))},templateHistoryContents:function(){var f=[];f.push("Choose the datasets to import:");f.push("<ul>");f.push(" <% _.each(history_contents, function(history_item) { %>");f.push(' <li data-id="<%= _.escape(history_item.get("id")) %>">');f.push(' <input style="margin: 0;" type="checkbox"><%= _.escape(history_item.get("hid")) %>: <%= _.escape(history_item.get("name")) %>');f.push(" </li>");f.push(" <% }); %>");f.push("</ul>");return _.template(f.join(""))}});return{FolderToolbarView:a}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(b,d,e,c){var a=Backbone.View.extend({el:"#center",events:{"click #toolbtn_create_folder":"createFolderFromModal","click #toolbtn_bulk_import":"modalBulkImport","click .toolbtn_add_files":"addFilesToFolderModal","click #include_deleted_datasets_chk":"check_include_deleted"},defaults:{can_add_library_item:false,contains_file:false,chain_call_control:{total_number:0,failed_number:0}},modal:null,histories:null,initialize:function(f){this.options=_.defaults(f||{},this.defaults);this.render()},render:function(f){this.options=_.extend(this.options,f);var h=this.templateToolBar();var g=false;if(Galaxy.currUser){g=Galaxy.currUser.isAdmin()}this.$el.html(h({id:this.options.id,admin_user:g}))},configureElements:function(f){this.options=_.extend(this.options,f);if(this.options.can_add_library_item===true){$("#toolbtn_create_folder").show();$(".toolbtn_add_files").show()}if(this.options.contains_file===true){$("#toolbtn_bulk_import").show();$("#toolbtn_dl").show()}this.$el.find("[data-toggle]").tooltip()},createFolderFromModal:function(){event.preventDefault();event.stopPropagation();var f=this;var g=this.templateNewFolderInModal();this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Create New Folder",body:g(),buttons:{Create:function(){f.create_new_folder_event()},Close:function(){Galaxy.modal.hide()}}})},create_new_folder_event:function(){var f=this.serialize_new_folder();if(this.validate_new_folder(f)){var g=new c.FolderAsModel();url_items=Backbone.history.fragment.split("/");current_folder_id=url_items[url_items.length-1];g.url=g.urlRoot+"/"+current_folder_id;g.save(f,{success:function(h){Galaxy.modal.hide();e.success("Folder created");h.set({type:"folder"});Galaxy.libraries.folderListView.collection.add(h)},error:function(i,h){Galaxy.modal.hide();if(typeof h.responseJSON!=="undefined"){e.error(h.responseJSON.err_msg)}else{e.error("An error ocurred :(")}}})}else{e.error("Folder's name is missing")}return false},serialize_new_folder:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val()}},validate_new_folder:function(f){return f.name!==""},modalBulkImport:function(){var f=$("#folder_table").find(":checked");if(f.length===0){e.info("You have to select some datasets first")}else{this.refreshUserHistoriesList(function(g){var h=g.templateBulkImportInModal();g.modal=Galaxy.modal;g.modal.show({closing_events:true,title:"Import into History",body:h({histories:g.histories.models}),buttons:{Import:function(){g.importAllIntoHistory()},Close:function(){Galaxy.modal.hide()}}})})}},refreshUserHistoriesList:function(g){var f=this;this.histories=new c.GalaxyHistories();this.histories.fetch({success:function(){g(f)},error:function(i,h){if(typeof h.responseJSON!=="undefined"){e.error(h.responseJSON.err_msg)}else{e.error("An error ocurred :(")}}})},importAllIntoHistory:function(){this.modal.disableButton("Import");this.options.chain_call_control.total_number=0;this.options.chain_call_control.failed_number=0;var j=$("select[name=dataset_import_bulk] option:selected").val();this.options.last_used_history_id=j;var m=$("select[name=dataset_import_bulk] option:selected").text();var o=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!==""){o.push(this.parentElement.parentElement.id)}});var n=this.templateImportIntoHistoryProgressBar();this.modal.$el.find(".modal-body").html(n({history_name:m}));var k=100/o.length;this.initProgress(k);var f=[];for(var g=o.length-1;g>=0;g--){var h=o[g];var l=new c.HistoryItem();l.url=l.urlRoot+j+"/contents";l.content=h;l.source="library";f.push(l)}this.options.chain_call_control.total_number=f.length;this.chainCall(f,m)},chainCall:function(g,j){var f=this;var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets imported into history")}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were imported into history.")}else{if(this.options.chain_call_control.failed_number<this.options.chain_call_control.total_number){e.warning("Some of the datasets could not be imported into history")}}}Galaxy.modal.hide();return}var i=$.when(h.save({content:h.content,source:h.source}));i.done(function(){f.updateProgress();f.chainCall(g,j)}).fail(function(){f.options.chain_call_control.failed_number+=1;f.updateProgress();f.chainCall(g,j)})},initProgress:function(f){this.progress=0;this.progressStep=f},updateProgress:function(){this.progress+=this.progressStep;$(".progress-bar-import").width(Math.round(this.progress)+"%");txt_representation=Math.round(this.progress)+"% Complete";$(".completion_span").text(txt_representation)},download:function(f,j){var h=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!==""){h.push(this.parentElement.parentElement.id)}});var g="/api/libraries/datasets/download/"+j;var i={ldda_ids:h};this.processDownload(g,i,"get")},processDownload:function(g,h,i){if(g&&h){h=typeof h==="string"?h:$.param(h);var f="";$.each(h.split("&"),function(){var j=this.split("=");f+='<input type="hidden" name="'+j[0]+'" value="'+j[1]+'" />'});$('<form action="'+g+'" method="'+(i||"post")+'">'+f+"</form>").appendTo("body").submit().remove();e.info("Your download will begin soon")}},addFilesToFolderModal:function(){this.refreshUserHistoriesList(function(f){f.modal=Galaxy.modal;var g=f.templateAddFilesInModal();f.modal.show({closing_events:true,title:"Add datasets from history to "+f.options.folder_name,body:g({histories:f.histories.models}),buttons:{Add:function(){f.addAllDatasetsFromHistory()},Close:function(){Galaxy.modal.hide()}}});if(f.histories.models.length>0){f.fetchAndDisplayHistoryContents(f.histories.models[0].id);$("#dataset_add_bulk").change(function(h){f.fetchAndDisplayHistoryContents(h.target.value)})}else{e.error("An error ocurred :(")}})},fetchAndDisplayHistoryContents:function(h){var g=new c.HistoryContents({id:h});var f=this;g.fetch({success:function(j){var i=f.templateHistoryContents();f.histories.get(h).set({contents:j});f.modal.$el.find("#selected_history_content").html(i({history_contents:j.models.reverse()}))},error:function(){e.error("An error ocurred :(")}})},addAllDatasetsFromHistory:function(){this.modal.disableButton("Add");this.options.chain_call_control.total_number=0;this.options.chain_call_control.failed_number=0;var f=[];this.modal.$el.find("#selected_history_content").find(":checked").each(function(){var i=$(this.parentElement).data("id");if(i){f.push(i)}});var l=this.options.folder_name;var k=this.templateAddingDatasetsProgressBar();this.modal.$el.find(".modal-body").html(k({folder_name:l}));this.progressStep=100/f.length;this.progress=0;var j=[];for(var h=f.length-1;h>=0;h--){history_dataset_id=f[h];var g=new c.Item();g.url="/api/folders/"+this.options.id+"/contents";g.set({from_hda_id:history_dataset_id});j.push(g)}this.options.chain_call_control.total_number=j.length;this.chainCallAddingHdas(j)},chainCallAddingHdas:function(g){var f=this;this.added_hdas=new c.Folder();var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets from history added to the folder")}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were added to the folder.")}else{if(this.options.chain_call_control.failed_number<this.options.chain_call_control.total_number){e.warning("Some of the datasets could not be added to the folder")}}}Galaxy.modal.hide();return this.added_hdas}var i=$.when(h.save({from_hda_id:h.get("from_hda_id")}));i.done(function(j){Galaxy.libraries.folderListView.collection.add(j);f.updateProgress();f.chainCallAddingHdas(g)}).fail(function(){f.options.chain_call_control.failed_number+=1;f.updateProgress();f.chainCallAddingHdas(g)})},check_include_deleted:function(f){if(f.target.checked){Galaxy.libraries.folderListView.collection=new c.Folder();Galaxy.libraries.folderListView.listenTo(Galaxy.libraries.folderListView.collection,"add",Galaxy.libraries.folderListView.renderOne);Galaxy.libraries.folderListView.fetchFolder({include_deleted:true})}else{Galaxy.libraries.folderListView.collection=new c.Folder();Galaxy.libraries.folderListView.listenTo(Galaxy.libraries.folderListView.collection,"add",Galaxy.libraries.folderListView.renderOne);Galaxy.libraries.folderListView.fetchFolder({include_deleted:false})}},templateToolBar:function(){tmpl_array=[];tmpl_array.push('<div class="library_style_container">');tmpl_array.push('<h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fol…" target="_blank">Trello</a>.</h3>');tmpl_array.push('<div id="library_folder_toolbar">');tmpl_array.push('<span data-toggle="tooltip" data-placement="top" title="Include deleted datasets"><input id="include_deleted_datasets_chk" style="margin: 0;" type="checkbox"><span class="fa fa-trash-o fa-lg"></span></input></span>');tmpl_array.push('<div class="btn-group">');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Create New Folder" id="toolbtn_create_folder" class="btn btn-default primary-button" type="button" style="display:none;"><span class="fa fa-plus"></span><span class="fa fa-folder"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Add Datasets to Current Folder" id="toolbtn_add_files" class="btn btn-default toolbtn_add_files primary-button" type="button" style="display:none;"><span class="fa fa-plus"></span><span class="fa fa-file"></span></span></button>');tmpl_array.push("</div>");tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Import selected datasets into history" id="toolbtn_bulk_import" class="primary-button" style="margin-left: 0.5em; " type="button"><span class="fa fa-book"></span> to history</button>');tmpl_array.push(' <div id="toolbtn_dl" class="btn-group" style="margin-left: 0.5em; ">');tmpl_array.push(' <button title="Download selected datasets as archive" id="drop_toggle" type="button" class="primary-button dropdown-toggle" data-toggle="dropdown">');tmpl_array.push(' <span class="fa fa-download"></span> download <span class="caret"></span>');tmpl_array.push(" </button>");tmpl_array.push(' <ul class="dropdown-menu" role="menu">');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/tgz">.tar.gz</a></li>');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/tbz">.tar.bz</a></li>');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/zip">.zip</a></li>');tmpl_array.push(" </ul>");tmpl_array.push(" </div>");tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Mark selected datasets deleted" id="toolbtn_bulk_delete" class="primary-button" style="margin-left: 0.5em; " type="button"><span class="fa fa-trash-o"></span> delete</button>');tmpl_array.push(" </div>");tmpl_array.push(' <div id="folder_items_element">');tmpl_array.push(" </div>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))},templateNewFolderInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_folder_modal">');tmpl_array.push("<form>");tmpl_array.push('<input type="text" name="Name" value="" placeholder="Name">');tmpl_array.push('<input type="text" name="Description" value="" placeholder="Description">');tmpl_array.push("</form>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))},templateBulkImportInModal:function(){var f=[];f.push('<span id="history_modal_combo_bulk" style="width:90%; margin-left: 1em; margin-right: 1em; ">');f.push("Select history: ");f.push('<select id="dataset_import_bulk" name="dataset_import_bulk" style="width:50%; margin-bottom: 1em; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</span>");return _.template(f.join(""))},templateImportIntoHistoryProgressBar:function(){var f=[];f.push('<div class="import_text">');f.push("Importing selected datasets to history <b><%= _.escape(history_name) %></b>");f.push("</div>");f.push('<div class="progress">');f.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');f.push(' <span class="completion_span">0% Complete</span>');f.push(" </div>");f.push("</div>");f.push("");return _.template(f.join(""))},templateAddingDatasetsProgressBar:function(){var f=[];f.push('<div class="import_text">');f.push("Adding selected datasets from history to library folder <b><%= _.escape(folder_name) %></b>");f.push("</div>");f.push('<div class="progress">');f.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');f.push(' <span class="completion_span">0% Complete</span>');f.push(" </div>");f.push("</div>");f.push("");return _.template(f.join(""))},templateAddFilesInModal:function(){var f=[];f.push('<div id="add_files_modal">');f.push('<div id="history_modal_combo_bulk">');f.push("Select history: ");f.push('<select id="dataset_add_bulk" name="dataset_add_bulk" style="width:66%; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</div>");f.push('<div id="selected_history_content">');f.push("</div>");f.push("</div>");return _.template(f.join(""))},templateHistoryContents:function(){var f=[];f.push("Choose the datasets to import:");f.push("<ul>");f.push(" <% _.each(history_contents, function(history_item) { %>");f.push(' <li data-id="<%= _.escape(history_item.get("id")) %>">');f.push(' <input style="margin: 0;" type="checkbox"><%= _.escape(history_item.get("hid")) %>: <%= _.escape(history_item.get("name")) %>');f.push(" </li>");f.push(" <% }); %>");f.push("</ul>");return _.template(f.join(""))}});return{FolderToolbarView:a}});
\ No newline at end of file
diff -r 8e2a9de88ddbf091e6462d2b563816028ef0107d -r 861535cf753a61bdc360b04d008dc504a5437e8c static/scripts/packed/mvc/library/library-libraryrow-view.js
--- a/static/scripts/packed/mvc/library/library-libraryrow-view.js
+++ b/static/scripts/packed/mvc/library/library-libraryrow-view.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr"],function(b,c,d){var a=Backbone.View.extend({events:{"click .edit_library_btn":"edit_button_clicked","click .cancel_library_btn":"cancel_library_modification","click .save_library_btn":"save_library_modification","click .delete_library_btn":"delete_library","click .undelete_library_btn":"undelete_library","click .upload_library_btn":"upload_to_library","click .permission_library_btn":"permissions_on_library"},edit_mode:false,element_visibility_config:{upload_library_btn:false,edit_library_btn:false,permission_library_btn:false,save_library_btn:false,cancel_library_btn:false,delete_library_btn:false,undelete_library_btn:false},initialize:function(e){this.render(e)},render:function(f){if(typeof f==="undefined"){f=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"))}this.prepareButtons(f);var e=this.templateRow();this.setElement(e({library:f,button_config:this.element_visibility_config,edit_mode:this.edit_mode}));this.$el.show();return this},repaint:function(e){$(".tooltip").hide();var f=this.$el;this.render(e);f.replaceWith(this.$el);this.$el.find("[data-toggle]").tooltip()},prepareButtons:function(e){vis_config=this.element_visibility_config;if(this.edit_mode===false){vis_config.save_library_btn=false;vis_config.cancel_library_btn=false;vis_config.delete_library_btn=false;if(e.get("deleted")===true){vis_config.undelete_library_btn=true;vis_config.upload_library_btn=false;vis_config.edit_library_btn=false;vis_config.permission_library_btn=false}else{if(e.get("deleted")===false){vis_config.save_library_btn=false;vis_config.cancel_library_btn=false;vis_config.undelete_library_btn=false;if(e.get("can_user_add")===true){vis_config.upload_library_btn=true}if(e.get("can_user_modify")===true){vis_config.edit_library_btn=true}if(e.get("can_user_manage")===true){vis_config.permission_library_btn=true}}}}else{if(this.edit_mode===true){vis_config.upload_library_btn=false;vis_config.edit_library_btn=false;vis_config.permission_library_btn=false;vis_config.save_library_btn=true;vis_config.cancel_library_btn=true;vis_config.delete_library_btn=true}}this.element_visibility_config=vis_config},upload_to_library:function(){d.info("Coming soon. Stay tuned.")},permissions_on_library:function(){d.info("Coming soon. Stay tuned.")},edit_button_clicked:function(){this.edit_mode=true;this.repaint()},cancel_library_modification:function(){d.info("Modifications canceled");this.edit_mode=false;this.repaint()},save_library_modification:function(){var f=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"));var g=false;var i=this.$el.find(".input_library_name").val();if(typeof i!=="undefined"&&i!==f.get("name")){if(i.length>2){f.set("name",i);g=true}else{d.warning("Library name has to be at least 3 characters long");return}}var h=this.$el.find(".input_library_description").val();if(typeof h!=="undefined"&&h!==f.get("description")){f.set("description",h);g=true}var j=this.$el.find(".input_library_synopsis").val();if(typeof j!=="undefined"&&j!==f.get("synopsis")){f.set("synopsis",j);g=true}if(g){var e=this;f.save(null,{patch:true,success:function(k){e.edit_mode=false;e.repaint(k);d.success("Changes to library saved")},error:function(){d.error("An error occured during updating the library :(")}})}else{this.edit_mode=false;this.repaint(f);d.info("Nothing has changed")}},delete_library:function(){var f=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"));var e=this;f.destroy({success:function(g){g.set("deleted",true);Galaxy.libraries.libraryListView.collection.add(g);e.edit_mode=false;if(Galaxy.libraries.preferences.get("with_deleted")===false){$(".tooltip").hide();e.$el.remove()}else{if(Galaxy.libraries.preferences.get("with_deleted")===true){e.repaint(g)}}d.success("Library has been marked deleted")},error:function(){d.error("An error occured during deleting the library :(")}})},undelete_library:function(){var f=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"));var e=this;f.url=f.urlRoot+f.id+"?undelete=true";f.destroy({success:function(g){g.set("deleted",false);Galaxy.libraries.libraryListView.collection.add(g);e.edit_mode=false;e.repaint(g);d.success("Library has been undeleted")},error:function(){d.error("An error occured while undeleting the library :(")}})},templateRow:function(){tmpl_array=[];tmpl_array.push(' <tr class="<% if(library.get("deleted") === true) { print("active") } %>" style="display:none;" data-id="<%- library.get("id") %>">');tmpl_array.push(" <% if(!edit_mode) { %>");tmpl_array.push(' <td><a href="#folders/<%- library.get("root_folder_id") %>"><%- library.get("name") %></a></td>');tmpl_array.push(' <td><%= _.escape(library.get("description")) %></td>');tmpl_array.push(' <td><%= _.escape(library.get("synopsis")) %></td>');tmpl_array.push(" <% } else if(edit_mode){ %>");tmpl_array.push(' <td><input type="text" class="form-control input_library_name" placeholder="name" value="<%- library.get("name") %>"></td>');tmpl_array.push(' <td><input type="text" class="form-control input_library_description" placeholder="description" value="<%- library.get("description") %>"></td>');tmpl_array.push(' <td><input type="text" class="form-control input_library_synopsis" placeholder="synopsis" value="<%- library.get("synopsis") %>"></td>');tmpl_array.push(" <% } %>");tmpl_array.push(' <td class="right-center">');tmpl_array.push(' <% if(library.get("deleted") === true) { %>');tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg deleted_lib_ico"></span>');tmpl_array.push(' <% } else if(library.get("public") === true) { %>');tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Public" style="color:grey;" class="fa fa-globe fa-lg public_lib_ico"></span>');tmpl_array.push(" <% }%>");tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Modify library" class="primary-button btn-xs edit_library_btn" type="button" style="<% if(button_config.edit_library_btn === false) { print("display:none;") } %>"><span class="fa fa-pencil"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Modify permissions" class="primary-button btn-xs permission_library_btn" type="button" style="<% if(button_config.permission_library_btn === false) { print("display:none;") } %>"><span class="fa fa-group"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Save changes" class="primary-button btn-xs save_library_btn" type="button" style="<% if(button_config.save_library_btn === false) { print("display:none;") } %>"><span class="fa fa-floppy-o"> Save</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Discard changes" class="primary-button btn-xs cancel_library_btn" type="button" style="<% if(button_config.cancel_library_btn === false) { print("display:none;") } %>"><span class="fa fa-times"> Cancel</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Delete library (can be undeleted later)" class="primary-button btn-xs delete_library_btn" type="button" style="<% if(button_config.delete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-trash-o"> Delete</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Undelete library" class="primary-button btn-xs undelete_library_btn" type="button" style="<% if(button_config.undelete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-unlock"> Undelete</span></button>');tmpl_array.push(" </td>");tmpl_array.push(" </tr>");return _.template(tmpl_array.join(""))}});return{LibraryRowView:a}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr"],function(b,c,d){var a=Backbone.View.extend({events:{"click .edit_library_btn":"edit_button_clicked","click .cancel_library_btn":"cancel_library_modification","click .save_library_btn":"save_library_modification","click .delete_library_btn":"delete_library","click .undelete_library_btn":"undelete_library","click .upload_library_btn":"upload_to_library","click .permission_library_btn":"permissions_on_library"},edit_mode:false,element_visibility_config:{upload_library_btn:false,edit_library_btn:false,permission_library_btn:false,save_library_btn:false,cancel_library_btn:false,delete_library_btn:false,undelete_library_btn:false},initialize:function(e){this.render(e)},render:function(f){if(typeof f==="undefined"){f=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"))}this.prepareButtons(f);var e=this.templateRow();this.setElement(e({library:f,button_config:this.element_visibility_config,edit_mode:this.edit_mode}));this.$el.show();return this},repaint:function(e){$(".tooltip").hide();var f=this.$el;this.render(e);f.replaceWith(this.$el);this.$el.find("[data-toggle]").tooltip()},prepareButtons:function(e){vis_config=this.element_visibility_config;if(this.edit_mode===false){vis_config.save_library_btn=false;vis_config.cancel_library_btn=false;vis_config.delete_library_btn=false;if(e.get("deleted")===true){vis_config.undelete_library_btn=true;vis_config.upload_library_btn=false;vis_config.edit_library_btn=false;vis_config.permission_library_btn=false}else{if(e.get("deleted")===false){vis_config.save_library_btn=false;vis_config.cancel_library_btn=false;vis_config.undelete_library_btn=false;if(e.get("can_user_add")===true){vis_config.upload_library_btn=true}if(e.get("can_user_modify")===true){vis_config.edit_library_btn=true}if(e.get("can_user_manage")===true){vis_config.permission_library_btn=true}}}}else{if(this.edit_mode===true){vis_config.upload_library_btn=false;vis_config.edit_library_btn=false;vis_config.permission_library_btn=false;vis_config.save_library_btn=true;vis_config.cancel_library_btn=true;vis_config.delete_library_btn=true}}this.element_visibility_config=vis_config},upload_to_library:function(){d.info("Coming soon. Stay tuned.")},permissions_on_library:function(){d.info("Coming soon. Stay tuned.")},edit_button_clicked:function(){this.edit_mode=true;this.repaint()},cancel_library_modification:function(){d.info("Modifications canceled");this.edit_mode=false;this.repaint()},save_library_modification:function(){var f=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"));var g=false;var i=this.$el.find(".input_library_name").val();if(typeof i!=="undefined"&&i!==f.get("name")){if(i.length>2){f.set("name",i);g=true}else{d.warning("Library name has to be at least 3 characters long");return}}var h=this.$el.find(".input_library_description").val();if(typeof h!=="undefined"&&h!==f.get("description")){f.set("description",h);g=true}var j=this.$el.find(".input_library_synopsis").val();if(typeof j!=="undefined"&&j!==f.get("synopsis")){f.set("synopsis",j);g=true}if(g){var e=this;f.save(null,{patch:true,success:function(k){e.edit_mode=false;e.repaint(k);d.success("Changes to library saved")},error:function(){d.error("An error occured during updating the library :(")}})}else{this.edit_mode=false;this.repaint(f);d.info("Nothing has changed")}},delete_library:function(){var f=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"));var e=this;f.destroy({success:function(g){g.set("deleted",true);Galaxy.libraries.libraryListView.collection.add(g);e.edit_mode=false;if(Galaxy.libraries.preferences.get("with_deleted")===false){$(".tooltip").hide();e.$el.remove()}else{if(Galaxy.libraries.preferences.get("with_deleted")===true){e.repaint(g)}}d.success("Library has been marked deleted")},error:function(){d.error("An error occured during deleting the library :(")}})},undelete_library:function(){var f=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"));var e=this;f.url=f.urlRoot+f.id+"?undelete=true";f.destroy({success:function(g){g.set("deleted",false);Galaxy.libraries.libraryListView.collection.add(g);e.edit_mode=false;e.repaint(g);d.success("Library has been undeleted")},error:function(){d.error("An error occured while undeleting the library :(")}})},templateRow:function(){tmpl_array=[];tmpl_array.push(' <tr class="<% if(library.get("deleted") === true) { print("active") } %>" style="display:none;" data-id="<%- library.get("id") %>">');tmpl_array.push(" <% if(!edit_mode) { %>");tmpl_array.push(' <% if(library.get("deleted")) { %>');tmpl_array.push(' <td style="color:grey;"><%- library.get("name") %></td>');tmpl_array.push(" <% } else { %>");tmpl_array.push(' <td><a href="#folders/<%- library.get("root_folder_id") %>"><%- library.get("name") %></a></td>');tmpl_array.push(" <% } %>");tmpl_array.push(' <td><%= _.escape(library.get("description")) %></td>');tmpl_array.push(' <td><%= _.escape(library.get("synopsis")) %></td>');tmpl_array.push(" <% } else if(edit_mode){ %>");tmpl_array.push(' <td><input type="text" class="form-control input_library_name" placeholder="name" value="<%- library.get("name") %>"></td>');tmpl_array.push(' <td><input type="text" class="form-control input_library_description" placeholder="description" value="<%- library.get("description") %>"></td>');tmpl_array.push(' <td><input type="text" class="form-control input_library_synopsis" placeholder="synopsis" value="<%- library.get("synopsis") %>"></td>');tmpl_array.push(" <% } %>");tmpl_array.push(' <td class="right-center">');tmpl_array.push(' <% if(library.get("deleted")) { %>');tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg deleted_lib_ico"></span>');tmpl_array.push(' <% } else if(library.get("public")) { %>');tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Public" style="color:grey;" class="fa fa-globe fa-lg public_lib_ico"></span>');tmpl_array.push(" <% }%>");tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Modify library" class="primary-button btn-xs edit_library_btn" type="button" style="<% if(button_config.edit_library_btn === false) { print("display:none;") } %>"><span class="fa fa-pencil"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Modify permissions" class="primary-button btn-xs permission_library_btn" type="button" style="<% if(button_config.permission_library_btn === false) { print("display:none;") } %>"><span class="fa fa-group"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Save changes" class="primary-button btn-xs save_library_btn" type="button" style="<% if(button_config.save_library_btn === false) { print("display:none;") } %>"><span class="fa fa-floppy-o"> Save</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Discard changes" class="primary-button btn-xs cancel_library_btn" type="button" style="<% if(button_config.cancel_library_btn === false) { print("display:none;") } %>"><span class="fa fa-times"> Cancel</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Delete library (can be undeleted later)" class="primary-button btn-xs delete_library_btn" type="button" style="<% if(button_config.delete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-trash-o"> Delete</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Undelete library" class="primary-button btn-xs undelete_library_btn" type="button" style="<% if(button_config.undelete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-unlock"> Undelete</span></button>');tmpl_array.push(" </td>");tmpl_array.push(" </tr>");return _.template(tmpl_array.join(""))}});return{LibraryRowView:a}});
\ No newline at end of file
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.
1
0
commit/galaxy-central: martenson: data lirbaries: support for showing deleted datasets in the folderview
by commits-noreply@bitbucket.org 28 Apr '14
by commits-noreply@bitbucket.org 28 Apr '14
28 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5e1f9169837f/
Changeset: 5e1f9169837f
User: martenson
Date: 2014-04-28 21:15:25
Summary: data lirbaries: support for showing deleted datasets in the folderview
Affected #: 10 files
diff -r 8ed5006bfc1f67350834291bc81ace94312ad070 -r 5e1f9169837f41f0cf007228e01b5a3cf1635dba lib/galaxy/webapps/galaxy/api/folder_contents.py
--- a/lib/galaxy/webapps/galaxy/api/folder_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/folder_contents.py
@@ -43,7 +43,7 @@
:raises: MalformedId, InconsistentDatabase, ObjectNotFound,
InternalServerError
"""
- deleted = kwd.get( 'deleted', 'missing' )
+ deleted = kwd.get( 'include_deleted', 'missing' )
try:
deleted = util.asbool( deleted )
except ValueError:
diff -r 8ed5006bfc1f67350834291bc81ace94312ad070 -r 5e1f9169837f41f0cf007228e01b5a3cf1635dba static/scripts/mvc/library/library-folderlist-view.js
--- a/static/scripts/mvc/library/library-folderlist-view.js
+++ b/static/scripts/mvc/library/library-folderlist-view.js
@@ -13,6 +13,9 @@
var FolderListView = Backbone.View.extend({
el : '#folder_items_element',
+ defaults: {
+ 'include_deleted' : false
+ },
// progress percentage
progress: 0,
// progress rate per one item
@@ -38,15 +41,21 @@
this.fetchFolder();
},
- fetchFolder: function(){
+ fetchFolder: function(options){
+ // this.options = _.defaults(this.options, options);
+ var options = options || {};
+ this.options.include_deleted = options.include_deleted;
var that = this;
this.folderContainer = new mod_library_model.FolderContainer({id: this.options.id});
this.folderContainer.url = this.folderContainer.attributes.urlRoot + this.options.id + '/contents';
+ if (this.options.include_deleted){
+ this.folderContainer.url = this.folderContainer.url + '?include_deleted=true';
+ }
this.folderContainer.fetch({
success: function(folder_container) {
that.folder_container = folder_container;
that.render();
- that.addAll(folder_container.get('folder').models)
+ that.addAll(folder_container.get('folder').models);
},
error: function(model, response){
if (typeof response.responseJSON !== "undefined"){
@@ -59,7 +68,7 @@
},
render: function (options) {
- this.options = _.defaults(this.options || {}, options);
+ this.options = _.defaults(this.options, options);
var template = this.templateFolder();
// TODO move to server
@@ -93,6 +102,7 @@
_.each(models.reverse(), function(model) {
Galaxy.libraries.folderListView.collection.add(model);
});
+ $("#center [data-toggle]").tooltip();
this.checkEmptiness();
},
diff -r 8ed5006bfc1f67350834291bc81ace94312ad070 -r 5e1f9169837f41f0cf007228e01b5a3cf1635dba static/scripts/mvc/library/library-folderrow-view.js
--- a/static/scripts/mvc/library/library-folderrow-view.js
+++ b/static/scripts/mvc/library/library-folderrow-view.js
@@ -36,7 +36,11 @@
template = this.templateRowFolder();
} else {
this.options.type = 'file';
- template = this.templateRowFile();
+ if (folder_item.get('deleted')){
+ template = this.templateRowDeletedFile();
+ } else {
+ template = this.templateRowFile();
+ }
}
this.setElement(template({content_item:folder_item}));
this.$el.show();
@@ -227,6 +231,23 @@
tmpl_array.push('</tr>');
return _.template(tmpl_array.join(''));
+ },
+
+ templateRowDeletedFile: function(){
+ tmpl_array = [];
+
+ tmpl_array.push('<tr class="active" id="<%- content_item.id %>">');
+ tmpl_array.push(' <td>');
+ tmpl_array.push(' <span title="Dataset" class="fa fa-file-o"></span>');
+ tmpl_array.push(' </td>');
+ tmpl_array.push(' <td><span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg"></span></td>');
+ tmpl_array.push(' <td style="color:grey;"><%- content_item.get("name") %></td>'); // dataset
+ tmpl_array.push(' <td><%= _.escape(content_item.get("data_type")) %></td>'); // data type
+ tmpl_array.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>'); // size
+ tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>'); // time updated
+ tmpl_array.push('</tr>');
+
+ return _.template(tmpl_array.join(''));
},
templateDatasetModal : function(){
diff -r 8ed5006bfc1f67350834291bc81ace94312ad070 -r 5e1f9169837f41f0cf007228e01b5a3cf1635dba static/scripts/mvc/library/library-foldertoolbar-view.js
--- a/static/scripts/mvc/library/library-foldertoolbar-view.js
+++ b/static/scripts/mvc/library/library-foldertoolbar-view.js
@@ -12,9 +12,10 @@
el: '#center',
events: {
- 'click #toolbtn_create_folder' : 'createFolderFromModal',
- 'click #toolbtn_bulk_import' : 'modalBulkImport',
- 'click .toolbtn_add_files' : 'addFilesToFolderModal'
+ 'click #toolbtn_create_folder' : 'createFolderFromModal',
+ 'click #toolbtn_bulk_import' : 'modalBulkImport',
+ 'click .toolbtn_add_files' : 'addFilesToFolderModal',
+ 'click #include_deleted_datasets_chk' : 'check_include_deleted'
},
defaults: {
@@ -389,6 +390,21 @@
});
},
+ /**
+ * Handles the click on 'show deleted' checkbox
+ */
+ check_include_deleted: function(event){
+ if (event.target.checked){
+ Galaxy.libraries.folderListView.collection = new mod_library_model.Folder();
+ Galaxy.libraries.folderListView.listenTo(Galaxy.libraries.folderListView.collection, 'add', Galaxy.libraries.folderListView.renderOne);
+ Galaxy.libraries.folderListView.fetchFolder({include_deleted: true});
+ } else{
+ Galaxy.libraries.folderListView.collection = new mod_library_model.Folder();
+ Galaxy.libraries.folderListView.listenTo(Galaxy.libraries.folderListView.collection, 'add', Galaxy.libraries.folderListView.renderOne);
+ Galaxy.libraries.folderListView.fetchFolder({include_deleted: false});
+ }
+ },
+
templateToolBar: function(){
tmpl_array = [];
diff -r 8ed5006bfc1f67350834291bc81ace94312ad070 -r 5e1f9169837f41f0cf007228e01b5a3cf1635dba static/scripts/mvc/library/library-libraryrow-view.js
--- a/static/scripts/mvc/library/library-libraryrow-view.js
+++ b/static/scripts/mvc/library/library-libraryrow-view.js
@@ -221,7 +221,11 @@
tmpl_array.push(' <tr class="<% if(library.get("deleted") === true) { print("active") } %>" style="display:none;" data-id="<%- library.get("id") %>">');
tmpl_array.push(' <% if(!edit_mode) { %>');
- tmpl_array.push(' <td><a href="#folders/<%- library.get("root_folder_id") %>"><%- library.get("name") %></a></td>');
+ tmpl_array.push(' <% if(library.get("deleted")) { %>');
+ tmpl_array.push(' <td style="color:grey;"><%- library.get("name") %></td>');
+ tmpl_array.push(' <% } else { %>');
+ tmpl_array.push(' <td><a href="#folders/<%- library.get("root_folder_id") %>"><%- library.get("name") %></a></td>');
+ tmpl_array.push(' <% } %>');
tmpl_array.push(' <td><%= _.escape(library.get("description")) %></td>');
tmpl_array.push(' <td><%= _.escape(library.get("synopsis")) %></td>');
tmpl_array.push(' <% } else if(edit_mode){ %>');
@@ -230,9 +234,9 @@
tmpl_array.push(' <td><input type="text" class="form-control input_library_synopsis" placeholder="synopsis" value="<%- library.get("synopsis") %>"></td>');
tmpl_array.push(' <% } %>');
tmpl_array.push(' <td class="right-center">');
- tmpl_array.push(' <% if(library.get("deleted") === true) { %>');
+ tmpl_array.push(' <% if(library.get("deleted")) { %>');
tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg deleted_lib_ico"></span>');
- tmpl_array.push(' <% } else if(library.get("public") === true) { %>');
+ tmpl_array.push(' <% } else if(library.get("public")) { %>');
tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Public" style="color:grey;" class="fa fa-globe fa-lg public_lib_ico"></span>');
tmpl_array.push(' <% }%>');
// tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Upload to library" class="primary-button btn-xs upload_library_btn" type="button" style="<% if(button_config.upload_library_btn === false) { print("display:none;") } %>"><span class="fa fa-upload"></span></button>');
diff -r 8ed5006bfc1f67350834291bc81ace94312ad070 -r 5e1f9169837f41f0cf007228e01b5a3cf1635dba static/scripts/packed/galaxy.base.js
--- a/static/scripts/packed/galaxy.base.js
+++ b/static/scripts/packed/galaxy.base.js
@@ -1,1 +1,1 @@
-(function(){var b=0;var c=["ms","moz","webkit","o"];for(var a=0;a<c.length&&!window.requestAnimationFrame;++a){window.requestAnimationFrame=window[c[a]+"RequestAnimationFrame"];window.cancelRequestAnimationFrame=window[c[a]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame){window.requestAnimationFrame=function(h,e){var d=new Date().getTime();var f=Math.max(0,16-(d-b));var g=window.setTimeout(function(){h(d+f)},f);b=d+f;return g}}if(!window.cancelAnimationFrame){window.cancelAnimationFrame=function(d){clearTimeout(d)}}}());if(!Array.indexOf){Array.prototype.indexOf=function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]==c){return b}}return -1}}function obj_length(c){if(c.length!==undefined){return c.length}var b=0;for(var a in c){b++}return b}$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function make_popupmenu(b,c){var a=(b.data("menu_options"));b.data("menu_options",c);if(a){return}b.bind("click.show_popup",function(d){$(".popmenu-wrapper").remove();setTimeout(function(){var g=$("<ul class='dropdown-menu' id='"+b.attr("id")+"-menu'></ul>");var f=b.data("menu_options");if(obj_length(f)<=0){$("<li>No Options.</li>").appendTo(g)}$.each(f,function(j,i){if(i){var l=i.action||i;g.append($("<li></li>").append($("<a>").attr("href",i.url).html(j).click(l)))}else{g.append($("<li></li>").addClass("head").append($("<a href='#'></a>").html(j)))}});var h=$("<div class='popmenu-wrapper' style='position: absolute;left: 0; top: -1000;'></div>").append(g).appendTo("body");var e=d.pageX-h.width()/2;e=Math.min(e,$(document).scrollLeft()+$(window).width()-$(h).width()-5);e=Math.max(e,$(document).scrollLeft()+5);h.css({top:d.pageY,left:e})},10);setTimeout(function(){var f=function(h){$(h).bind("click.close_popup",function(){$(".popmenu-wrapper").remove();h.unbind("click.close_popup")})};f($(window.document));f($(window.top.document));for(var e=window.top.frames.length;e--;){var g=$(window.top.frames[e].document);f(g)}},50);return false})}function make_popup_menus(a){a=a||document;$(a).find("div[popupmenu]").each(function(){var b={};var d=$(this);d.find("a").each(function(){var g=$(this),i=g.get(0),e=i.getAttribute("confirm"),f=i.getAttribute("href"),h=i.getAttribute("target");if(!f){b[g.text()]=null}else{b[g.text()]={url:f,action:function(){if(!e||confirm(e)){if(h){window.open(f,h);return false}else{g.click()}}}}}});var c=$(a).find("#"+d.attr("popupmenu"));c.find("a").bind("click",function(f){f.stopPropagation();return true});make_popupmenu(c,b);c.addClass("popup");d.remove()})}function naturalSort(j,h){var p=/(-?[0-9\.]+)/g,k=j.toString().toLowerCase()||"",g=h.toString().toLowerCase()||"",l=String.fromCharCode(0),n=k.replace(p,l+"$1"+l).split(l),e=g.replace(p,l+"$1"+l).split(l),d=(new Date(k)).getTime(),o=d?(new Date(g)).getTime():null;if(o){if(d<o){return -1}else{if(d>o){return 1}}}var m,f;for(var i=0,c=Math.max(n.length,e.length);i<c;i++){m=parseFloat(n[i])||n[i];f=parseFloat(e[i])||e[i];if(m<f){return -1}else{if(m>f){return 1}}}return 0}$.fn.refresh_select2=function(){var b=$(this);var a={width:"resolve",closeOnSelect:!b.is("[MULTIPLE]")};return b.select2(a)};function replace_big_select_inputs(a,c,b){if(!jQuery.fn.select2){return}if(a===undefined){a=20}if(c===undefined){c=3000}b=b||$("select");b.each(function(){var e=$(this);var d=e.find("option").length;if((d<a)||(d>c)){return}if(e.hasClass("no-autocomplete")){return}e.refresh_select2()})}$.fn.make_text_editable=function(g){var d=("num_cols" in g?g.num_cols:30),c=("num_rows" in g?g.num_rows:4),e=("use_textarea" in g?g.use_textarea:false),b=("on_finish" in g?g.on_finish:null),f=("help_text" in g?g.help_text:null);var a=$(this);a.addClass("editable-text").click(function(l){if($(this).children(":input").length>0){return}a.removeClass("editable-text");var i=function(m){a.find(":input").remove();if(m!==""){a.text(m)}else{a.html("<br>")}a.addClass("editable-text");if(b){b(m)}};var h=("cur_text" in g?g.cur_text:a.text()),k,j;if(e){k=$("<textarea/>").attr({rows:c,cols:d}).text($.trim(h)).keyup(function(m){if(m.keyCode===27){i(h)}});j=$("<button/>").text("Done").click(function(){i(k.val());return false})}else{k=$("<input type='text'/>").attr({value:$.trim(h),size:d}).blur(function(){i(h)}).keyup(function(m){if(m.keyCode===27){$(this).trigger("blur")}else{if(m.keyCode===13){i($(this).val())}}})}a.text("");a.append(k);if(j){a.append(j)}k.focus();k.select();l.stopPropagation()});if(f){a.attr("title",f).tooltip()}return a};function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).click(function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text($.trim(k))}else{j=$("<input type='text'></input>").attr({value:$.trim(k),size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){if(o!==""){l.text(o)}else{l.html("<em>None</em>")}if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(d,a,c){var b=function(){try{var e=$.jStorage.get("history_expand_state");if(e){for(var g in e){$("#"+g+" div.historyItemBody").show()}}}catch(f){$.jStorage.deleteKey("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.peek").css("overflow","hidden")}})}d.each(function(){var j=this.id,h=$(this).children("div.historyItemBody"),i=h.find("pre.peek");$(this).find(".historyItemTitleBar > .historyItemTitle").wrap("<a href='javascript:void(0);'></a>").click(function(){var k;if(h.is(":visible")){if($.browser.mozilla){i.css("overflow","hidden")}h.slideUp("fast");if(!c){k=$.jStorage.get("history_expand_state");if(k){delete k[j];$.jStorage.set("history_expand_state",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){k=$.jStorage.get("history_expand_state");if(!k){k={}}k[j]=true;$.jStorage.set("history_expand_state",k)}}return false})});$("#top-links > a.toggle").click(function(){var h=$.jStorage.get("history_expand_state");if(!h){h={}}$("div.historyItemBody:visible").each(function(){if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(h){delete h[$(this).parent().attr("id")]}});$.jStorage.set("history_expand_state",h)}).show()};b()}function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}function reset_tool_search(a){var c=$("#galaxy_tools").contents();if(c.length===0){c=$(document)}$(this).removeClass("search_active");c.find(".toolTitle").removeClass("search_match");c.find(".toolSectionBody").hide();c.find(".toolTitle").show();c.find(".toolPanelLabel").show();c.find(".toolSectionWrapper").each(function(){if($(this).attr("id")!=="recently_used_wrapper"){$(this).show()}else{if($(this).hasClass("user_pref_visible")){$(this).show()}}});c.find("#search-no-results").hide();c.find("#search-spinner").hide();if(a){var b=c.find("#tool-search-query");b.val("search tools")}}var GalaxyAsync=function(a){this.url_dict={};this.log_action=(a===undefined?false:a)};GalaxyAsync.prototype.set_func_url=function(a,b){this.url_dict[a]=b};GalaxyAsync.prototype.set_user_pref=function(a,b){var c=this.url_dict[arguments.callee];if(c===undefined){return false}$.ajax({url:c,data:{pref_name:a,pref_value:b},error:function(){return false},success:function(){return true}})};GalaxyAsync.prototype.log_user_action=function(c,b,d){if(!this.log_action){return}var a=this.url_dict[arguments.callee];if(a===undefined){return false}$.ajax({url:a,data:{action:c,context:b,params:d},error:function(){return false},success:function(){return true}})};function init_refresh_on_change(){$("select[refresh_on_change='true']").off("change").change(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");$(document).trigger("convert_to_values");a.get(0).form.submit()});$(":checkbox[refresh_on_change='true']").off("click").click(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");a.get(0).form.submit()});$("a[confirm]").off("click").click(function(){return confirm($(this).attr("confirm"))})}$(document).ready(function(){init_refresh_on_change();if($.fn.tooltip){$(".unified-panel-header [title]").tooltip({placement:"bottom"});$("[title]").tooltip()}make_popup_menus();replace_big_select_inputs(20,1500);$("a").click(function(){var b=$(this);var c=(parent.frames&&parent.frames.galaxy_main);if((b.attr("target")=="galaxy_main")&&(!c)){var a=b.attr("href");if(a.indexOf("?")==-1){a+="?"}else{a+="&"}a+="use_panels=True";b.attr("href",a);b.attr("target","_self")}return b})});
\ No newline at end of file
+(function(){var b=0;var c=["ms","moz","webkit","o"];for(var a=0;a<c.length&&!window.requestAnimationFrame;++a){window.requestAnimationFrame=window[c[a]+"RequestAnimationFrame"];window.cancelRequestAnimationFrame=window[c[a]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame){window.requestAnimationFrame=function(h,e){var d=new Date().getTime();var f=Math.max(0,16-(d-b));var g=window.setTimeout(function(){h(d+f)},f);b=d+f;return g}}if(!window.cancelAnimationFrame){window.cancelAnimationFrame=function(d){clearTimeout(d)}}}());if(!Array.indexOf){Array.prototype.indexOf=function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]==c){return b}}return -1}}function obj_length(c){if(c.length!==undefined){return c.length}var b=0;for(var a in c){b++}return b}$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function make_popupmenu(b,c){var a=(b.data("menu_options"));b.data("menu_options",c);if(a){return}b.bind("click.show_popup",function(d){$(".popmenu-wrapper").remove();setTimeout(function(){var g=$("<ul class='dropdown-menu' id='"+b.attr("id")+"-menu'></ul>");var f=b.data("menu_options");if(obj_length(f)<=0){$("<li>No Options.</li>").appendTo(g)}$.each(f,function(j,i){if(i){var l=i.action||i;g.append($("<li></li>").append($("<a>").attr("href",i.url).html(j).click(l)))}else{g.append($("<li></li>").addClass("head").append($("<a href='#'></a>").html(j)))}});var h=$("<div class='popmenu-wrapper' style='position: absolute;left: 0; top: -1000;'></div>").append(g).appendTo("body");var e=d.pageX-h.width()/2;e=Math.min(e,$(document).scrollLeft()+$(window).width()-$(h).width()-5);e=Math.max(e,$(document).scrollLeft()+5);h.css({top:d.pageY,left:e})},10);setTimeout(function(){var f=function(h){$(h).bind("click.close_popup",function(){$(".popmenu-wrapper").remove();h.unbind("click.close_popup")})};f($(window.document));f($(window.top.document));for(var e=window.top.frames.length;e--;){var g=$(window.top.frames[e].document);f(g)}},50);return false})}function make_popup_menus(a){a=a||document;$(a).find("div[popupmenu]").each(function(){var b={};var d=$(this);d.find("a").each(function(){var g=$(this),i=g.get(0),e=i.getAttribute("confirm"),f=i.getAttribute("href"),h=i.getAttribute("target");if(!f){b[g.text()]=null}else{b[g.text()]={url:f,action:function(){if(!e||confirm(e)){if(h){window.open(f,h);return false}else{g.click()}}}}}});var c=$(a).find("#"+d.attr("popupmenu"));c.find("a").bind("click",function(f){f.stopPropagation();return true});make_popupmenu(c,b);c.addClass("popup");d.remove()})}function naturalSort(j,h){var p=/(-?[0-9\.]+)/g,k=j.toString().toLowerCase()||"",g=h.toString().toLowerCase()||"",l=String.fromCharCode(0),n=k.replace(p,l+"$1"+l).split(l),e=g.replace(p,l+"$1"+l).split(l),d=(new Date(k)).getTime(),o=d?(new Date(g)).getTime():null;if(o){if(d<o){return -1}else{if(d>o){return 1}}}var m,f;for(var i=0,c=Math.max(n.length,e.length);i<c;i++){m=parseFloat(n[i])||n[i];f=parseFloat(e[i])||e[i];if(m<f){return -1}else{if(m>f){return 1}}}return 0}$.fn.refresh_select2=function(){var b=$(this);var a={width:"resolve",closeOnSelect:!b.is("[MULTIPLE]")};return b.select2(a)};function replace_big_select_inputs(a,c,b){if(!jQuery.fn.select2){return}if(a===undefined){a=20}if(c===undefined){c=3000}b=b||$("select");b.each(function(){var e=$(this);var d=e.find("option").length;if((d<a)||(d>c)){return}if(e.hasClass("no-autocomplete")){return}e.refresh_select2()})}$.fn.make_text_editable=function(g){var d=("num_cols" in g?g.num_cols:30),c=("num_rows" in g?g.num_rows:4),e=("use_textarea" in g?g.use_textarea:false),b=("on_finish" in g?g.on_finish:null),f=("help_text" in g?g.help_text:null);var a=$(this);a.addClass("editable-text").click(function(l){if($(this).children(":input").length>0){return}a.removeClass("editable-text");var i=function(m){a.find(":input").remove();if(m!==""){a.text(m)}else{a.html("<br>")}a.addClass("editable-text");if(b){b(m)}};var h=("cur_text" in g?g.cur_text:a.text()),k,j;if(e){k=$("<textarea/>").attr({rows:c,cols:d}).text($.trim(h)).keyup(function(m){if(m.keyCode===27){i(h)}});j=$("<button/>").text("Done").click(function(){i(k.val());return false})}else{k=$("<input type='text'/>").attr({value:$.trim(h),size:d}).blur(function(){i(h)}).keyup(function(m){if(m.keyCode===27){$(this).trigger("blur")}else{if(m.keyCode===13){i($(this).val())}}m.stopPropagation()})}a.text("");a.append(k);if(j){a.append(j)}k.focus();k.select();l.stopPropagation()});if(f){a.attr("title",f).tooltip()}return a};function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).click(function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text($.trim(k))}else{j=$("<input type='text'></input>").attr({value:$.trim(k),size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){if(o!==""){l.text(o)}else{l.html("<em>None</em>")}if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(d,a,c){var b=function(){try{var e=$.jStorage.get("history_expand_state");if(e){for(var g in e){$("#"+g+" div.historyItemBody").show()}}}catch(f){$.jStorage.deleteKey("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.peek").css("overflow","hidden")}})}d.each(function(){var j=this.id,h=$(this).children("div.historyItemBody"),i=h.find("pre.peek");$(this).find(".historyItemTitleBar > .historyItemTitle").wrap("<a href='javascript:void(0);'></a>").click(function(){var k;if(h.is(":visible")){if($.browser.mozilla){i.css("overflow","hidden")}h.slideUp("fast");if(!c){k=$.jStorage.get("history_expand_state");if(k){delete k[j];$.jStorage.set("history_expand_state",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){k=$.jStorage.get("history_expand_state");if(!k){k={}}k[j]=true;$.jStorage.set("history_expand_state",k)}}return false})});$("#top-links > a.toggle").click(function(){var h=$.jStorage.get("history_expand_state");if(!h){h={}}$("div.historyItemBody:visible").each(function(){if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(h){delete h[$(this).parent().attr("id")]}});$.jStorage.set("history_expand_state",h)}).show()};b()}function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}function reset_tool_search(a){var c=$("#galaxy_tools").contents();if(c.length===0){c=$(document)}$(this).removeClass("search_active");c.find(".toolTitle").removeClass("search_match");c.find(".toolSectionBody").hide();c.find(".toolTitle").show();c.find(".toolPanelLabel").show();c.find(".toolSectionWrapper").each(function(){if($(this).attr("id")!=="recently_used_wrapper"){$(this).show()}else{if($(this).hasClass("user_pref_visible")){$(this).show()}}});c.find("#search-no-results").hide();c.find("#search-spinner").hide();if(a){var b=c.find("#tool-search-query");b.val("search tools")}}var GalaxyAsync=function(a){this.url_dict={};this.log_action=(a===undefined?false:a)};GalaxyAsync.prototype.set_func_url=function(a,b){this.url_dict[a]=b};GalaxyAsync.prototype.set_user_pref=function(a,b){var c=this.url_dict[arguments.callee];if(c===undefined){return false}$.ajax({url:c,data:{pref_name:a,pref_value:b},error:function(){return false},success:function(){return true}})};GalaxyAsync.prototype.log_user_action=function(c,b,d){if(!this.log_action){return}var a=this.url_dict[arguments.callee];if(a===undefined){return false}$.ajax({url:a,data:{action:c,context:b,params:d},error:function(){return false},success:function(){return true}})};function init_refresh_on_change(){$("select[refresh_on_change='true']").off("change").change(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");$(document).trigger("convert_to_values");a.get(0).form.submit()});$(":checkbox[refresh_on_change='true']").off("click").click(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");a.get(0).form.submit()});$("a[confirm]").off("click").click(function(){return confirm($(this).attr("confirm"))})}$(document).ready(function(){init_refresh_on_change();if($.fn.tooltip){$(".unified-panel-header [title]").tooltip({placement:"bottom"});$("[title]").tooltip()}make_popup_menus();replace_big_select_inputs(20,1500);$("a").click(function(){var b=$(this);var c=(parent.frames&&parent.frames.galaxy_main);if((b.attr("target")=="galaxy_main")&&(!c)){var a=b.attr("href");if(a.indexOf("?")==-1){a+="?"}else{a+="&"}a+="use_panels=True";b.attr("href",a);b.attr("target","_self")}return b})});
\ No newline at end of file
diff -r 8ed5006bfc1f67350834291bc81ace94312ad070 -r 5e1f9169837f41f0cf007228e01b5a3cf1635dba static/scripts/packed/mvc/library/library-folderlist-view.js
--- a/static/scripts/packed/mvc/library/library-folderlist-view.js
+++ b/static/scripts/packed/mvc/library/library-folderlist-view.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model","mvc/library/library-folderrow-view"],function(c,e,f,d,a){var b=Backbone.View.extend({el:"#folder_items_element",progress:0,progressStep:1,modal:null,folderContainer:null,sort:"asc",events:{"click #select-all-checkboxes":"selectAll","click .dataset_row":"selectClickedRow","click .sort-folder-link":"sort_clicked"},initialize:function(g){this.options=_.defaults(this.options||{},g);this.collection=new d.Folder();this.listenTo(this.collection,"add",this.renderOne);this.fetchFolder()},fetchFolder:function(){var g=this;this.folderContainer=new d.FolderContainer({id:this.options.id});this.folderContainer.url=this.folderContainer.attributes.urlRoot+this.options.id+"/contents";this.folderContainer.fetch({success:function(h){g.folder_container=h;g.render();g.addAll(h.get("folder").models)},error:function(i,h){if(typeof h.responseJSON!=="undefined"){f.error(h.responseJSON.err_msg)}else{f.error("An error ocurred :(")}}})},render:function(g){this.options=_.defaults(this.options||{},g);var i=this.templateFolder();var j=this.folderContainer.attributes.metadata.full_path;var k;if(j.length===1){k=0}else{k=j[j.length-2][0]}this.$el.html(i({path:this.folderContainer.attributes.metadata.full_path,id:this.options.id,upper_folder_id:k,order:this.sort}));var h=this.folderContainer.attributes.metadata;h.contains_file=this.options.contains_file;Galaxy.libraries.folderToolbarView.configureElements(h);$("#center [data-toggle]").tooltip();$("#center").css("overflow","auto")},addAll:function(g){_.each(g.reverse(),function(h){Galaxy.libraries.folderListView.collection.add(h)});this.checkEmptiness()},renderAll:function(){var g=this;_.each(this.collection.models.reverse(),function(h){g.renderOne(h)})},renderOne:function(h){if(h.get("data_type")!=="folder"){this.options.contains_file=true;h.set("readable_size",this.size_to_string(h.get("file_size")))}var g=new a.FolderRowView(h);this.$el.find("#first_folder_item").after(g.el);this.checkEmptiness()},checkEmptiness:function(){if((this.$el.find(".dataset_row").length===0)&&(this.$el.find(".folder_row").length===0)){var g=this.templateEmptyFolder();this.$el.find("#folder_list_body").append(g())}else{this.$el.find("#empty_folder_message").remove()}},sort_clicked:function(g){g.preventDefault();if(this.sort==="asc"){this.sortFolder("name","desc");this.sort="desc"}else{this.sortFolder("name","asc");this.sort="asc"}this.render();this.renderAll()},sortFolder:function(h,g){if(h==="name"){if(g==="asc"){return this.collection.sortByNameAsc()}else{if(g==="desc"){return this.collection.sortByNameDesc()}}}},size_to_string:function(g){var h="";if(g>=100000000000){g=g/100000000000;h="TB"}else{if(g>=100000000){g=g/100000000;h="GB"}else{if(g>=100000){g=g/100000;h="MB"}else{if(g>=100){g=g/100;h="KB"}else{g=g*10;h="b"}}}}return(Math.round(g)/10)+h},selectAll:function(h){var g=h.target.checked;that=this;$(":checkbox").each(function(){this.checked=g;$row=$(this.parentElement.parentElement);if(g){that.makeDarkRow($row)}else{that.makeWhiteRow($row)}})},selectClickedRow:function(h){var j="";var g;var i;if(h.target.localName==="input"){j=h.target;g=$(h.target.parentElement.parentElement);i="input"}else{if(h.target.localName==="td"){j=$("#"+h.target.parentElement.id).find(":checkbox")[0];g=$(h.target.parentElement);i="td"}}if(j.checked){if(i==="td"){j.checked="";this.makeWhiteRow(g)}else{if(i==="input"){this.makeDarkRow(g)}}}else{if(i==="td"){j.checked="selected";this.makeDarkRow(g)}else{if(i==="input"){this.makeWhiteRow(g)}}}},makeDarkRow:function(g){g.removeClass("light");g.find("a").removeClass("light");g.addClass("dark");g.find("a").addClass("dark");g.find("span").removeClass("fa-file-o");g.find("span").addClass("fa-file")},makeWhiteRow:function(g){g.removeClass("dark");g.find("a").removeClass("dark");g.addClass("light");g.find("a").addClass("light");g.find("span").addClass("fa-file-o");g.find("span").removeClass("fa-file")},templateFolder:function(){var g=[];g.push('<ol class="breadcrumb">');g.push(' <li><a title="Return to the list of libraries" href="#">Libraries</a></li>');g.push(" <% _.each(path, function(path_item) { %>");g.push(" <% if (path_item[0] != id) { %>");g.push(' <li><a title="Return to this folder" href="#/folders/<%- path_item[0] %>"><%- path_item[1] %></a></li> ');g.push("<% } else { %>");g.push(' <li class="active"><span title="You are in this folder"><%- path_item[1] %></span></li>');g.push(" <% } %>");g.push(" <% }); %>");g.push("</ol>");g.push('<table id="folder_table" class="grid table table-condensed">');g.push(" <thead>");g.push(' <th class="button_heading"></th>');g.push(' <th style="text-align: center; width: 20px; " title="Check to select all datasets"><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');g.push(' <th><a class="sort-folder-link" title="Click to reverse order" href="#">name</a><span title="Sorted alphabetically" class="fa fa-sort-alpha-<%- order %>"></span></th>');g.push(" <th>data type</th>");g.push(" <th>size</th>");g.push(" <th>time updated (UTC)</th>");g.push(" </thead>");g.push(' <tbody id="folder_list_body">');g.push(' <tr id="first_folder_item">');g.push(' <td><a href="#<% if (upper_folder_id !== 0){ print("folders/" + upper_folder_id)} %>" title="Go to parent folder" class="btn_open_folder btn btn-default btn-xs">..<a></td>');g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" </tr>");g.push(" </tbody>");g.push("</table>");return _.template(g.join(""))},templateEmptyFolder:function(){var g=[];g.push('<tr id="empty_folder_message">');g.push('<td colspan="6" style="text-align:center">');g.push("This folder is either empty or you do not have proper access permissions to see the contents.");g.push("</td>");g.push("</tr>");return _.template(g.join(""))}});return{FolderListView:b}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model","mvc/library/library-folderrow-view"],function(c,e,f,d,a){var b=Backbone.View.extend({el:"#folder_items_element",defaults:{include_deleted:false},progress:0,progressStep:1,modal:null,folderContainer:null,sort:"asc",events:{"click #select-all-checkboxes":"selectAll","click .dataset_row":"selectClickedRow","click .sort-folder-link":"sort_clicked"},initialize:function(g){this.options=_.defaults(this.options||{},g);this.collection=new d.Folder();this.listenTo(this.collection,"add",this.renderOne);this.fetchFolder()},fetchFolder:function(g){var g=g||{};this.options.include_deleted=g.include_deleted;var h=this;this.folderContainer=new d.FolderContainer({id:this.options.id});this.folderContainer.url=this.folderContainer.attributes.urlRoot+this.options.id+"/contents";if(this.options.include_deleted){this.folderContainer.url=this.folderContainer.url+"?include_deleted=true"}this.folderContainer.fetch({success:function(i){h.folder_container=i;h.render();h.addAll(i.get("folder").models)},error:function(j,i){if(typeof i.responseJSON!=="undefined"){f.error(i.responseJSON.err_msg)}else{f.error("An error ocurred :(")}}})},render:function(g){this.options=_.defaults(this.options,g);var i=this.templateFolder();var j=this.folderContainer.attributes.metadata.full_path;var k;if(j.length===1){k=0}else{k=j[j.length-2][0]}this.$el.html(i({path:this.folderContainer.attributes.metadata.full_path,id:this.options.id,upper_folder_id:k,order:this.sort}));var h=this.folderContainer.attributes.metadata;h.contains_file=this.options.contains_file;Galaxy.libraries.folderToolbarView.configureElements(h);$("#center [data-toggle]").tooltip();$("#center").css("overflow","auto")},addAll:function(g){_.each(g.reverse(),function(h){Galaxy.libraries.folderListView.collection.add(h)});$("#center [data-toggle]").tooltip();this.checkEmptiness()},renderAll:function(){var g=this;_.each(this.collection.models.reverse(),function(h){g.renderOne(h)})},renderOne:function(h){if(h.get("data_type")!=="folder"){this.options.contains_file=true;h.set("readable_size",this.size_to_string(h.get("file_size")))}var g=new a.FolderRowView(h);this.$el.find("#first_folder_item").after(g.el);this.checkEmptiness()},checkEmptiness:function(){if((this.$el.find(".dataset_row").length===0)&&(this.$el.find(".folder_row").length===0)){var g=this.templateEmptyFolder();this.$el.find("#folder_list_body").append(g())}else{this.$el.find("#empty_folder_message").remove()}},sort_clicked:function(g){g.preventDefault();if(this.sort==="asc"){this.sortFolder("name","desc");this.sort="desc"}else{this.sortFolder("name","asc");this.sort="asc"}this.render();this.renderAll()},sortFolder:function(h,g){if(h==="name"){if(g==="asc"){return this.collection.sortByNameAsc()}else{if(g==="desc"){return this.collection.sortByNameDesc()}}}},size_to_string:function(g){var h="";if(g>=100000000000){g=g/100000000000;h="TB"}else{if(g>=100000000){g=g/100000000;h="GB"}else{if(g>=100000){g=g/100000;h="MB"}else{if(g>=100){g=g/100;h="KB"}else{g=g*10;h="b"}}}}return(Math.round(g)/10)+h},selectAll:function(h){var g=h.target.checked;that=this;$(":checkbox").each(function(){this.checked=g;$row=$(this.parentElement.parentElement);if(g){that.makeDarkRow($row)}else{that.makeWhiteRow($row)}})},selectClickedRow:function(h){var j="";var g;var i;if(h.target.localName==="input"){j=h.target;g=$(h.target.parentElement.parentElement);i="input"}else{if(h.target.localName==="td"){j=$("#"+h.target.parentElement.id).find(":checkbox")[0];g=$(h.target.parentElement);i="td"}}if(j.checked){if(i==="td"){j.checked="";this.makeWhiteRow(g)}else{if(i==="input"){this.makeDarkRow(g)}}}else{if(i==="td"){j.checked="selected";this.makeDarkRow(g)}else{if(i==="input"){this.makeWhiteRow(g)}}}},makeDarkRow:function(g){g.removeClass("light");g.find("a").removeClass("light");g.addClass("dark");g.find("a").addClass("dark");g.find("span").removeClass("fa-file-o");g.find("span").addClass("fa-file")},makeWhiteRow:function(g){g.removeClass("dark");g.find("a").removeClass("dark");g.addClass("light");g.find("a").addClass("light");g.find("span").addClass("fa-file-o");g.find("span").removeClass("fa-file")},templateFolder:function(){var g=[];g.push('<ol class="breadcrumb">');g.push(' <li><a title="Return to the list of libraries" href="#">Libraries</a></li>');g.push(" <% _.each(path, function(path_item) { %>");g.push(" <% if (path_item[0] != id) { %>");g.push(' <li><a title="Return to this folder" href="#/folders/<%- path_item[0] %>"><%- path_item[1] %></a></li> ');g.push("<% } else { %>");g.push(' <li class="active"><span title="You are in this folder"><%- path_item[1] %></span></li>');g.push(" <% } %>");g.push(" <% }); %>");g.push("</ol>");g.push('<table id="folder_table" class="grid table table-condensed">');g.push(" <thead>");g.push(' <th class="button_heading"></th>');g.push(' <th style="text-align: center; width: 20px; " title="Check to select all datasets"><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');g.push(' <th><a class="sort-folder-link" title="Click to reverse order" href="#">name</a><span title="Sorted alphabetically" class="fa fa-sort-alpha-<%- order %>"></span></th>');g.push(" <th>data type</th>");g.push(" <th>size</th>");g.push(" <th>time updated (UTC)</th>");g.push(" </thead>");g.push(' <tbody id="folder_list_body">');g.push(' <tr id="first_folder_item">');g.push(' <td><a href="#<% if (upper_folder_id !== 0){ print("folders/" + upper_folder_id)} %>" title="Go to parent folder" class="btn_open_folder btn btn-default btn-xs">..<a></td>');g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" <td></td>");g.push(" </tr>");g.push(" </tbody>");g.push("</table>");return _.template(g.join(""))},templateEmptyFolder:function(){var g=[];g.push('<tr id="empty_folder_message">');g.push('<td colspan="6" style="text-align:center">');g.push("This folder is either empty or you do not have proper access permissions to see the contents.");g.push("</td>");g.push("</tr>");return _.template(g.join(""))}});return{FolderListView:b}});
\ No newline at end of file
diff -r 8ed5006bfc1f67350834291bc81ace94312ad070 -r 5e1f9169837f41f0cf007228e01b5a3cf1635dba static/scripts/packed/mvc/library/library-folderrow-view.js
--- a/static/scripts/packed/mvc/library/library-folderrow-view.js
+++ b/static/scripts/packed/mvc/library/library-folderrow-view.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(b,d,e,c){var a=Backbone.View.extend({lastSelectedHistory:"",events:{"click .library-dataset":"showDatasetDetails"},options:{type:null},initialize:function(f){this.render(f)},render:function(f){var g=null;if(f.get("type")==="folder"){this.options.type="folder";g=this.templateRowFolder()}else{this.options.type="file";g=this.templateRowFile()}this.setElement(g({content_item:f}));this.$el.show();return this},showDatasetDetails:function(i){i.preventDefault();var j=this.id;var h=new c.Item();var g=new c.GalaxyHistories();h.id=j;var f=this;h.fetch({success:function(k){g.fetch({success:function(l){f.renderModalAfterFetch(k,l)},error:function(){e.error("An error occured during fetching histories:(");f.renderModalAfterFetch(k)}})},error:function(){e.error("An error occured during loading dataset details :(")}})},renderModalAfterFetch:function(k,h){var i=this.size_to_string(k.get("file_size"));var j=_.template(this.templateDatasetModal(),{item:k,size:i});var g=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Dataset Details",body:j,buttons:{Import:function(){g.importCurrentIntoHistory()},Download:function(){g.downloadCurrent()},Close:function(){g.modal.hide()}}});$(".peek").html(k.get("peek"));if(typeof history.models!==undefined){var f=_.template(this.templateHistorySelectInModal(),{histories:h.models});$(this.modal.elMain).find(".buttons").prepend(f);if(g.lastSelectedHistory.length>0){$(this.modal.elMain).find("#dataset_import_single").val(g.lastSelectedHistory)}}},size_to_string:function(f){var g="";if(f>=100000000000){f=f/100000000000;g="TB"}else{if(f>=100000000){f=f/100000000;g="GB"}else{if(f>=100000){f=f/100000;g="MB"}else{if(f>=100){f=f/100;g="KB"}else{f=f*10;g="b"}}}}return(Math.round(f)/10)+g},downloadCurrent:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var f=[];f.push($("#id_row").attr("data-id"));var g="/api/libraries/datasets/download/uncompressed";var h={ldda_ids:f};this.processDownload(g,h);this.modal.enableButton("Import");this.modal.enableButton("Download")},processDownload:function(g,h,i){if(g&&h){h=typeof h=="string"?h:$.param(h);var f="";$.each(h.split("&"),function(){var j=this.split("=");f+='<input type="hidden" name="'+j[0]+'" value="'+j[1]+'" />'});$('<form action="'+g+'" method="'+(i||"post")+'">'+f+"</form>").appendTo("body").submit().remove();e.info("Your download will begin soon")}},importCurrentIntoHistory:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var h=$(this.modal.elMain).find("select[name=dataset_import_single] option:selected").val();this.lastSelectedHistory=h;var f=$("#id_row").attr("data-id");var i=new c.HistoryItem();var g=this;i.url=i.urlRoot+h+"/contents";i.save({content:f,source:"library"},{success:function(){e.success("Dataset imported");g.modal.enableButton("Import");g.modal.enableButton("Download")},error:function(){e.error("An error occured! Dataset not imported. Please try again.");g.modal.enableButton("Import");g.modal.enableButton("Download")}})},templateRowFolder:function(){tmpl_array=[];tmpl_array.push('<tr class="folder_row light" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Folder" class="fa fa-folder-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(" <td></td>");tmpl_array.push(" <td>");tmpl_array.push(' <a href="#folders/<%- content_item.id %>"><%- content_item.get("name") %></a>');tmpl_array.push(' <% if (content_item.get("item_count") === 0) { %>');tmpl_array.push(" <span>(empty folder)</span>");tmpl_array.push(" <% } %>");tmpl_array.push(" </td>");tmpl_array.push(" <td>folder</td>");tmpl_array.push(" <td></td>");tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateRowFile:function(){tmpl_array=[];tmpl_array.push('<tr class="dataset_row light" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Dataset" class="fa fa-file-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(' <td style="text-align: center; "><input style="margin: 0;" type="checkbox"></td>');tmpl_array.push(' <td><a href="#" class="library-dataset"><%- content_item.get("name") %><a></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateDatasetModal:function(){var f=[];f.push('<div class="modal_table">');f.push(' <table class="grid table table-striped table-condensed">');f.push(" <tr>");f.push(' <th scope="row" id="id_row" data-id="<%= _.escape(item.get("ldda_id")) %>">Name</th>');f.push(' <td><%= _.escape(item.get("name")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Data type</th>');f.push(' <td><%= _.escape(item.get("data_type")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Genome build</th>');f.push(' <td><%= _.escape(item.get("genome_build")) %></td>');f.push(" </tr>");f.push(' <th scope="row">Size</th>');f.push(" <td><%= _.escape(size) %></td>");f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Date uploaded (UTC)</th>');f.push(' <td><%= _.escape(item.get("date_uploaded")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Uploaded by</th>');f.push(' <td><%= _.escape(item.get("uploaded_by")) %></td>');f.push(" </tr>");f.push(' <tr scope="row">');f.push(' <th scope="row">Data Lines</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_data_lines")) %></td>');f.push(" </tr>");f.push(' <th scope="row">Comment Lines</th>');f.push(' <% if (item.get("metadata_comment_lines") === "") { %>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_comment_lines")) %></td>');f.push(" <% } else { %>");f.push(' <td scope="row">unknown</td>');f.push(" <% } %>");f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Number of Columns</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_columns")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Column Types</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_column_types")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Miscellaneous information</th>');f.push(' <td scope="row"><%= _.escape(item.get("misc_blurb")) %></td>');f.push(" </tr>");f.push(" </table>");f.push(' <pre class="peek">');f.push(" </pre>");f.push("</div>");return f.join("")},templateHistorySelectInModal:function(){var f=[];f.push('<span id="history_modal_combo" style="width:100%; margin-left: 1em; margin-right: 1em; ">');f.push("Select history: ");f.push('<select id="dataset_import_single" name="dataset_import_single" style="width:40%; margin-bottom: 1em; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</span>");return f.join("")}});return{FolderRowView:a}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(b,d,e,c){var a=Backbone.View.extend({lastSelectedHistory:"",events:{"click .library-dataset":"showDatasetDetails"},options:{type:null},initialize:function(f){this.render(f)},render:function(f){var g=null;if(f.get("type")==="folder"){this.options.type="folder";g=this.templateRowFolder()}else{this.options.type="file";if(f.get("deleted")){g=this.templateRowDeletedFile()}else{g=this.templateRowFile()}}this.setElement(g({content_item:f}));this.$el.show();return this},showDatasetDetails:function(i){i.preventDefault();var j=this.id;var h=new c.Item();var g=new c.GalaxyHistories();h.id=j;var f=this;h.fetch({success:function(k){g.fetch({success:function(l){f.renderModalAfterFetch(k,l)},error:function(){e.error("An error occured during fetching histories:(");f.renderModalAfterFetch(k)}})},error:function(){e.error("An error occured during loading dataset details :(")}})},renderModalAfterFetch:function(k,h){var i=this.size_to_string(k.get("file_size"));var j=_.template(this.templateDatasetModal(),{item:k,size:i});var g=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Dataset Details",body:j,buttons:{Import:function(){g.importCurrentIntoHistory()},Download:function(){g.downloadCurrent()},Close:function(){g.modal.hide()}}});$(".peek").html(k.get("peek"));if(typeof history.models!==undefined){var f=_.template(this.templateHistorySelectInModal(),{histories:h.models});$(this.modal.elMain).find(".buttons").prepend(f);if(g.lastSelectedHistory.length>0){$(this.modal.elMain).find("#dataset_import_single").val(g.lastSelectedHistory)}}},size_to_string:function(f){var g="";if(f>=100000000000){f=f/100000000000;g="TB"}else{if(f>=100000000){f=f/100000000;g="GB"}else{if(f>=100000){f=f/100000;g="MB"}else{if(f>=100){f=f/100;g="KB"}else{f=f*10;g="b"}}}}return(Math.round(f)/10)+g},downloadCurrent:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var f=[];f.push($("#id_row").attr("data-id"));var g="/api/libraries/datasets/download/uncompressed";var h={ldda_ids:f};this.processDownload(g,h);this.modal.enableButton("Import");this.modal.enableButton("Download")},processDownload:function(g,h,i){if(g&&h){h=typeof h=="string"?h:$.param(h);var f="";$.each(h.split("&"),function(){var j=this.split("=");f+='<input type="hidden" name="'+j[0]+'" value="'+j[1]+'" />'});$('<form action="'+g+'" method="'+(i||"post")+'">'+f+"</form>").appendTo("body").submit().remove();e.info("Your download will begin soon")}},importCurrentIntoHistory:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var h=$(this.modal.elMain).find("select[name=dataset_import_single] option:selected").val();this.lastSelectedHistory=h;var f=$("#id_row").attr("data-id");var i=new c.HistoryItem();var g=this;i.url=i.urlRoot+h+"/contents";i.save({content:f,source:"library"},{success:function(){e.success("Dataset imported");g.modal.enableButton("Import");g.modal.enableButton("Download")},error:function(){e.error("An error occured! Dataset not imported. Please try again.");g.modal.enableButton("Import");g.modal.enableButton("Download")}})},templateRowFolder:function(){tmpl_array=[];tmpl_array.push('<tr class="folder_row light" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Folder" class="fa fa-folder-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(" <td></td>");tmpl_array.push(" <td>");tmpl_array.push(' <a href="#folders/<%- content_item.id %>"><%- content_item.get("name") %></a>');tmpl_array.push(' <% if (content_item.get("item_count") === 0) { %>');tmpl_array.push(" <span>(empty folder)</span>");tmpl_array.push(" <% } %>");tmpl_array.push(" </td>");tmpl_array.push(" <td>folder</td>");tmpl_array.push(" <td></td>");tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateRowFile:function(){tmpl_array=[];tmpl_array.push('<tr class="dataset_row light" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Dataset" class="fa fa-file-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(' <td style="text-align: center; "><input style="margin: 0;" type="checkbox"></td>');tmpl_array.push(' <td><a href="#" class="library-dataset"><%- content_item.get("name") %><a></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateRowDeletedFile:function(){tmpl_array=[];tmpl_array.push('<tr class="active" id="<%- content_item.id %>">');tmpl_array.push(" <td>");tmpl_array.push(' <span title="Dataset" class="fa fa-file-o"></span>');tmpl_array.push(" </td>");tmpl_array.push(' <td><span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg"></span></td>');tmpl_array.push(' <td style="color:grey;"><%- content_item.get("name") %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');tmpl_array.push(' <td><%= _.escape(content_item.get("update_time")) %></td>');tmpl_array.push("</tr>");return _.template(tmpl_array.join(""))},templateDatasetModal:function(){var f=[];f.push('<div class="modal_table">');f.push(' <table class="grid table table-striped table-condensed">');f.push(" <tr>");f.push(' <th scope="row" id="id_row" data-id="<%= _.escape(item.get("ldda_id")) %>">Name</th>');f.push(' <td><%= _.escape(item.get("name")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Data type</th>');f.push(' <td><%= _.escape(item.get("data_type")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Genome build</th>');f.push(' <td><%= _.escape(item.get("genome_build")) %></td>');f.push(" </tr>");f.push(' <th scope="row">Size</th>');f.push(" <td><%= _.escape(size) %></td>");f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Date uploaded (UTC)</th>');f.push(' <td><%= _.escape(item.get("date_uploaded")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Uploaded by</th>');f.push(' <td><%= _.escape(item.get("uploaded_by")) %></td>');f.push(" </tr>");f.push(' <tr scope="row">');f.push(' <th scope="row">Data Lines</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_data_lines")) %></td>');f.push(" </tr>");f.push(' <th scope="row">Comment Lines</th>');f.push(' <% if (item.get("metadata_comment_lines") === "") { %>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_comment_lines")) %></td>');f.push(" <% } else { %>");f.push(' <td scope="row">unknown</td>');f.push(" <% } %>");f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Number of Columns</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_columns")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Column Types</th>');f.push(' <td scope="row"><%= _.escape(item.get("metadata_column_types")) %></td>');f.push(" </tr>");f.push(" <tr>");f.push(' <th scope="row">Miscellaneous information</th>');f.push(' <td scope="row"><%= _.escape(item.get("misc_blurb")) %></td>');f.push(" </tr>");f.push(" </table>");f.push(' <pre class="peek">');f.push(" </pre>");f.push("</div>");return f.join("")},templateHistorySelectInModal:function(){var f=[];f.push('<span id="history_modal_combo" style="width:100%; margin-left: 1em; margin-right: 1em; ">');f.push("Select history: ");f.push('<select id="dataset_import_single" name="dataset_import_single" style="width:40%; margin-bottom: 1em; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</span>");return f.join("")}});return{FolderRowView:a}});
\ No newline at end of file
diff -r 8ed5006bfc1f67350834291bc81ace94312ad070 -r 5e1f9169837f41f0cf007228e01b5a3cf1635dba static/scripts/packed/mvc/library/library-foldertoolbar-view.js
--- a/static/scripts/packed/mvc/library/library-foldertoolbar-view.js
+++ b/static/scripts/packed/mvc/library/library-foldertoolbar-view.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(b,d,e,c){var a=Backbone.View.extend({el:"#center",events:{"click #toolbtn_create_folder":"createFolderFromModal","click #toolbtn_bulk_import":"modalBulkImport","click .toolbtn_add_files":"addFilesToFolderModal"},defaults:{can_add_library_item:false,contains_file:false,chain_call_control:{total_number:0,failed_number:0}},modal:null,histories:null,initialize:function(f){this.options=_.defaults(f||{},this.defaults);this.render()},render:function(f){this.options=_.extend(this.options,f);var h=this.templateToolBar();var g=false;if(Galaxy.currUser){g=Galaxy.currUser.isAdmin()}this.$el.html(h({id:this.options.id,admin_user:g}))},configureElements:function(f){this.options=_.extend(this.options,f);if(this.options.can_add_library_item===true){$("#toolbtn_create_folder").show();$(".toolbtn_add_files").show()}if(this.options.contains_file===true){$("#toolbtn_bulk_import").show();$("#toolbtn_dl").show()}this.$el.find("[data-toggle]").tooltip()},createFolderFromModal:function(){event.preventDefault();event.stopPropagation();var f=this;var g=this.templateNewFolderInModal();this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Create New Folder",body:g(),buttons:{Create:function(){f.create_new_folder_event()},Close:function(){Galaxy.modal.hide()}}})},create_new_folder_event:function(){var f=this.serialize_new_folder();if(this.validate_new_folder(f)){var g=new c.FolderAsModel();url_items=Backbone.history.fragment.split("/");current_folder_id=url_items[url_items.length-1];g.url=g.urlRoot+"/"+current_folder_id;g.save(f,{success:function(h){Galaxy.modal.hide();e.success("Folder created");h.set({type:"folder"});Galaxy.libraries.folderListView.collection.add(h)},error:function(i,h){Galaxy.modal.hide();if(typeof h.responseJSON!=="undefined"){e.error(h.responseJSON.err_msg)}else{e.error("An error ocurred :(")}}})}else{e.error("Folder's name is missing")}return false},serialize_new_folder:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val()}},validate_new_folder:function(f){return f.name!==""},modalBulkImport:function(){var f=$("#folder_table").find(":checked");if(f.length===0){e.info("You have to select some datasets first")}else{this.refreshUserHistoriesList(function(g){var h=g.templateBulkImportInModal();g.modal=Galaxy.modal;g.modal.show({closing_events:true,title:"Import into History",body:h({histories:g.histories.models}),buttons:{Import:function(){g.importAllIntoHistory()},Close:function(){Galaxy.modal.hide()}}})})}},refreshUserHistoriesList:function(g){var f=this;this.histories=new c.GalaxyHistories();this.histories.fetch({success:function(){g(f)},error:function(i,h){if(typeof h.responseJSON!=="undefined"){e.error(h.responseJSON.err_msg)}else{e.error("An error ocurred :(")}}})},importAllIntoHistory:function(){this.modal.disableButton("Import");this.options.chain_call_control.total_number=0;this.options.chain_call_control.failed_number=0;var j=$("select[name=dataset_import_bulk] option:selected").val();this.options.last_used_history_id=j;var m=$("select[name=dataset_import_bulk] option:selected").text();var o=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!==""){o.push(this.parentElement.parentElement.id)}});var n=this.templateImportIntoHistoryProgressBar();this.modal.$el.find(".modal-body").html(n({history_name:m}));var k=100/o.length;this.initProgress(k);var f=[];for(var g=o.length-1;g>=0;g--){var h=o[g];var l=new c.HistoryItem();l.url=l.urlRoot+j+"/contents";l.content=h;l.source="library";f.push(l)}this.options.chain_call_control.total_number=f.length;this.chainCall(f,m)},chainCall:function(g,j){var f=this;var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets imported into history")}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were imported into history.")}else{if(this.options.chain_call_control.failed_number<this.options.chain_call_control.total_number){e.warning("Some of the datasets could not be imported into history")}}}Galaxy.modal.hide();return}var i=$.when(h.save({content:h.content,source:h.source}));i.done(function(){f.updateProgress();f.chainCall(g,j)}).fail(function(){f.options.chain_call_control.failed_number+=1;f.updateProgress();f.chainCall(g,j)})},initProgress:function(f){this.progress=0;this.progressStep=f},updateProgress:function(){this.progress+=this.progressStep;$(".progress-bar-import").width(Math.round(this.progress)+"%");txt_representation=Math.round(this.progress)+"% Complete";$(".completion_span").text(txt_representation)},download:function(f,j){var h=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!==""){h.push(this.parentElement.parentElement.id)}});var g="/api/libraries/datasets/download/"+j;var i={ldda_ids:h};this.processDownload(g,i,"get")},processDownload:function(g,h,i){if(g&&h){h=typeof h==="string"?h:$.param(h);var f="";$.each(h.split("&"),function(){var j=this.split("=");f+='<input type="hidden" name="'+j[0]+'" value="'+j[1]+'" />'});$('<form action="'+g+'" method="'+(i||"post")+'">'+f+"</form>").appendTo("body").submit().remove();e.info("Your download will begin soon")}},addFilesToFolderModal:function(){this.refreshUserHistoriesList(function(f){f.modal=Galaxy.modal;var g=f.templateAddFilesInModal();f.modal.show({closing_events:true,title:"Add datasets from history to "+f.options.folder_name,body:g({histories:f.histories.models}),buttons:{Add:function(){f.addAllDatasetsFromHistory()},Close:function(){Galaxy.modal.hide()}}});if(f.histories.models.length>0){f.fetchAndDisplayHistoryContents(f.histories.models[0].id);$("#dataset_add_bulk").change(function(h){f.fetchAndDisplayHistoryContents(h.target.value)})}else{e.error("An error ocurred :(")}})},fetchAndDisplayHistoryContents:function(h){var g=new c.HistoryContents({id:h});var f=this;g.fetch({success:function(j){var i=f.templateHistoryContents();f.histories.get(h).set({contents:j});f.modal.$el.find("#selected_history_content").html(i({history_contents:j.models.reverse()}))},error:function(){e.error("An error ocurred :(")}})},addAllDatasetsFromHistory:function(){this.modal.disableButton("Add");this.options.chain_call_control.total_number=0;this.options.chain_call_control.failed_number=0;var f=[];this.modal.$el.find("#selected_history_content").find(":checked").each(function(){var i=$(this.parentElement).data("id");if(i){f.push(i)}});var l=this.options.folder_name;var k=this.templateAddingDatasetsProgressBar();this.modal.$el.find(".modal-body").html(k({folder_name:l}));this.progressStep=100/f.length;this.progress=0;var j=[];for(var h=f.length-1;h>=0;h--){history_dataset_id=f[h];var g=new c.Item();g.url="/api/folders/"+this.options.id+"/contents";g.set({from_hda_id:history_dataset_id});j.push(g)}this.options.chain_call_control.total_number=j.length;this.chainCallAddingHdas(j)},chainCallAddingHdas:function(g){var f=this;this.added_hdas=new c.Folder();var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets from history added to the folder")}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were added to the folder.")}else{if(this.options.chain_call_control.failed_number<this.options.chain_call_control.total_number){e.warning("Some of the datasets could not be added to the folder")}}}Galaxy.modal.hide();return this.added_hdas}var i=$.when(h.save({from_hda_id:h.get("from_hda_id")}));i.done(function(j){Galaxy.libraries.folderListView.collection.add(j);f.updateProgress();f.chainCallAddingHdas(g)}).fail(function(){f.options.chain_call_control.failed_number+=1;f.updateProgress();f.chainCallAddingHdas(g)})},templateToolBar:function(){tmpl_array=[];tmpl_array.push('<div class="library_style_container">');tmpl_array.push('<h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fol…" target="_blank">Trello</a>.</h3>');tmpl_array.push('<div id="library_folder_toolbar">');tmpl_array.push('<span data-toggle="tooltip" data-placement="top" title="Include deleted datasets"><input id="include_deleted_datasets_chk" style="margin: 0;" type="checkbox"><span class="fa fa-trash-o fa-lg"></span></input></span>');tmpl_array.push('<div class="btn-group">');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Create New Folder" id="toolbtn_create_folder" class="btn btn-default primary-button" type="button" style="display:none;"><span class="fa fa-plus"></span><span class="fa fa-folder"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Add Datasets to Current Folder" id="toolbtn_add_files" class="btn btn-default toolbtn_add_files primary-button" type="button" style="display:none;"><span class="fa fa-plus"></span><span class="fa fa-file"></span></span></button>');tmpl_array.push("</div>");tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Import selected datasets into history" id="toolbtn_bulk_import" class="primary-button" style="margin-left: 0.5em; " type="button"><span class="fa fa-book"></span> to history</button>');tmpl_array.push(' <div id="toolbtn_dl" class="btn-group" style="margin-left: 0.5em; ">');tmpl_array.push(' <button title="Download selected datasets as archive" id="drop_toggle" type="button" class="primary-button dropdown-toggle" data-toggle="dropdown">');tmpl_array.push(' <span class="fa fa-download"></span> download <span class="caret"></span>');tmpl_array.push(" </button>");tmpl_array.push(' <ul class="dropdown-menu" role="menu">');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/tgz">.tar.gz</a></li>');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/tbz">.tar.bz</a></li>');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/zip">.zip</a></li>');tmpl_array.push(" </ul>");tmpl_array.push(" </div>");tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Mark selected datasets deleted" id="toolbtn_bulk_delete" class="primary-button" style="margin-left: 0.5em; " type="button"><span class="fa fa-trash-o"></span> delete</button>');tmpl_array.push(" </div>");tmpl_array.push(' <div id="folder_items_element">');tmpl_array.push(" </div>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))},templateNewFolderInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_folder_modal">');tmpl_array.push("<form>");tmpl_array.push('<input type="text" name="Name" value="" placeholder="Name">');tmpl_array.push('<input type="text" name="Description" value="" placeholder="Description">');tmpl_array.push("</form>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))},templateBulkImportInModal:function(){var f=[];f.push('<span id="history_modal_combo_bulk" style="width:90%; margin-left: 1em; margin-right: 1em; ">');f.push("Select history: ");f.push('<select id="dataset_import_bulk" name="dataset_import_bulk" style="width:50%; margin-bottom: 1em; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</span>");return _.template(f.join(""))},templateImportIntoHistoryProgressBar:function(){var f=[];f.push('<div class="import_text">');f.push("Importing selected datasets to history <b><%= _.escape(history_name) %></b>");f.push("</div>");f.push('<div class="progress">');f.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');f.push(' <span class="completion_span">0% Complete</span>');f.push(" </div>");f.push("</div>");f.push("");return _.template(f.join(""))},templateAddingDatasetsProgressBar:function(){var f=[];f.push('<div class="import_text">');f.push("Adding selected datasets from history to library folder <b><%= _.escape(folder_name) %></b>");f.push("</div>");f.push('<div class="progress">');f.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');f.push(' <span class="completion_span">0% Complete</span>');f.push(" </div>");f.push("</div>");f.push("");return _.template(f.join(""))},templateAddFilesInModal:function(){var f=[];f.push('<div id="add_files_modal">');f.push('<div id="history_modal_combo_bulk">');f.push("Select history: ");f.push('<select id="dataset_add_bulk" name="dataset_add_bulk" style="width:66%; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</div>");f.push('<div id="selected_history_content">');f.push("</div>");f.push("</div>");return _.template(f.join(""))},templateHistoryContents:function(){var f=[];f.push("Choose the datasets to import:");f.push("<ul>");f.push(" <% _.each(history_contents, function(history_item) { %>");f.push(' <li data-id="<%= _.escape(history_item.get("id")) %>">');f.push(' <input style="margin: 0;" type="checkbox"><%= _.escape(history_item.get("hid")) %>: <%= _.escape(history_item.get("name")) %>');f.push(" </li>");f.push(" <% }); %>");f.push("</ul>");return _.template(f.join(""))}});return{FolderToolbarView:a}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr","mvc/library/library-model"],function(b,d,e,c){var a=Backbone.View.extend({el:"#center",events:{"click #toolbtn_create_folder":"createFolderFromModal","click #toolbtn_bulk_import":"modalBulkImport","click .toolbtn_add_files":"addFilesToFolderModal","click #include_deleted_datasets_chk":"check_include_deleted"},defaults:{can_add_library_item:false,contains_file:false,chain_call_control:{total_number:0,failed_number:0}},modal:null,histories:null,initialize:function(f){this.options=_.defaults(f||{},this.defaults);this.render()},render:function(f){this.options=_.extend(this.options,f);var h=this.templateToolBar();var g=false;if(Galaxy.currUser){g=Galaxy.currUser.isAdmin()}this.$el.html(h({id:this.options.id,admin_user:g}))},configureElements:function(f){this.options=_.extend(this.options,f);if(this.options.can_add_library_item===true){$("#toolbtn_create_folder").show();$(".toolbtn_add_files").show()}if(this.options.contains_file===true){$("#toolbtn_bulk_import").show();$("#toolbtn_dl").show()}this.$el.find("[data-toggle]").tooltip()},createFolderFromModal:function(){event.preventDefault();event.stopPropagation();var f=this;var g=this.templateNewFolderInModal();this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Create New Folder",body:g(),buttons:{Create:function(){f.create_new_folder_event()},Close:function(){Galaxy.modal.hide()}}})},create_new_folder_event:function(){var f=this.serialize_new_folder();if(this.validate_new_folder(f)){var g=new c.FolderAsModel();url_items=Backbone.history.fragment.split("/");current_folder_id=url_items[url_items.length-1];g.url=g.urlRoot+"/"+current_folder_id;g.save(f,{success:function(h){Galaxy.modal.hide();e.success("Folder created");h.set({type:"folder"});Galaxy.libraries.folderListView.collection.add(h)},error:function(i,h){Galaxy.modal.hide();if(typeof h.responseJSON!=="undefined"){e.error(h.responseJSON.err_msg)}else{e.error("An error ocurred :(")}}})}else{e.error("Folder's name is missing")}return false},serialize_new_folder:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val()}},validate_new_folder:function(f){return f.name!==""},modalBulkImport:function(){var f=$("#folder_table").find(":checked");if(f.length===0){e.info("You have to select some datasets first")}else{this.refreshUserHistoriesList(function(g){var h=g.templateBulkImportInModal();g.modal=Galaxy.modal;g.modal.show({closing_events:true,title:"Import into History",body:h({histories:g.histories.models}),buttons:{Import:function(){g.importAllIntoHistory()},Close:function(){Galaxy.modal.hide()}}})})}},refreshUserHistoriesList:function(g){var f=this;this.histories=new c.GalaxyHistories();this.histories.fetch({success:function(){g(f)},error:function(i,h){if(typeof h.responseJSON!=="undefined"){e.error(h.responseJSON.err_msg)}else{e.error("An error ocurred :(")}}})},importAllIntoHistory:function(){this.modal.disableButton("Import");this.options.chain_call_control.total_number=0;this.options.chain_call_control.failed_number=0;var j=$("select[name=dataset_import_bulk] option:selected").val();this.options.last_used_history_id=j;var m=$("select[name=dataset_import_bulk] option:selected").text();var o=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!==""){o.push(this.parentElement.parentElement.id)}});var n=this.templateImportIntoHistoryProgressBar();this.modal.$el.find(".modal-body").html(n({history_name:m}));var k=100/o.length;this.initProgress(k);var f=[];for(var g=o.length-1;g>=0;g--){var h=o[g];var l=new c.HistoryItem();l.url=l.urlRoot+j+"/contents";l.content=h;l.source="library";f.push(l)}this.options.chain_call_control.total_number=f.length;this.chainCall(f,m)},chainCall:function(g,j){var f=this;var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets imported into history")}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were imported into history.")}else{if(this.options.chain_call_control.failed_number<this.options.chain_call_control.total_number){e.warning("Some of the datasets could not be imported into history")}}}Galaxy.modal.hide();return}var i=$.when(h.save({content:h.content,source:h.source}));i.done(function(){f.updateProgress();f.chainCall(g,j)}).fail(function(){f.options.chain_call_control.failed_number+=1;f.updateProgress();f.chainCall(g,j)})},initProgress:function(f){this.progress=0;this.progressStep=f},updateProgress:function(){this.progress+=this.progressStep;$(".progress-bar-import").width(Math.round(this.progress)+"%");txt_representation=Math.round(this.progress)+"% Complete";$(".completion_span").text(txt_representation)},download:function(f,j){var h=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!==""){h.push(this.parentElement.parentElement.id)}});var g="/api/libraries/datasets/download/"+j;var i={ldda_ids:h};this.processDownload(g,i,"get")},processDownload:function(g,h,i){if(g&&h){h=typeof h==="string"?h:$.param(h);var f="";$.each(h.split("&"),function(){var j=this.split("=");f+='<input type="hidden" name="'+j[0]+'" value="'+j[1]+'" />'});$('<form action="'+g+'" method="'+(i||"post")+'">'+f+"</form>").appendTo("body").submit().remove();e.info("Your download will begin soon")}},addFilesToFolderModal:function(){this.refreshUserHistoriesList(function(f){f.modal=Galaxy.modal;var g=f.templateAddFilesInModal();f.modal.show({closing_events:true,title:"Add datasets from history to "+f.options.folder_name,body:g({histories:f.histories.models}),buttons:{Add:function(){f.addAllDatasetsFromHistory()},Close:function(){Galaxy.modal.hide()}}});if(f.histories.models.length>0){f.fetchAndDisplayHistoryContents(f.histories.models[0].id);$("#dataset_add_bulk").change(function(h){f.fetchAndDisplayHistoryContents(h.target.value)})}else{e.error("An error ocurred :(")}})},fetchAndDisplayHistoryContents:function(h){var g=new c.HistoryContents({id:h});var f=this;g.fetch({success:function(j){var i=f.templateHistoryContents();f.histories.get(h).set({contents:j});f.modal.$el.find("#selected_history_content").html(i({history_contents:j.models.reverse()}))},error:function(){e.error("An error ocurred :(")}})},addAllDatasetsFromHistory:function(){this.modal.disableButton("Add");this.options.chain_call_control.total_number=0;this.options.chain_call_control.failed_number=0;var f=[];this.modal.$el.find("#selected_history_content").find(":checked").each(function(){var i=$(this.parentElement).data("id");if(i){f.push(i)}});var l=this.options.folder_name;var k=this.templateAddingDatasetsProgressBar();this.modal.$el.find(".modal-body").html(k({folder_name:l}));this.progressStep=100/f.length;this.progress=0;var j=[];for(var h=f.length-1;h>=0;h--){history_dataset_id=f[h];var g=new c.Item();g.url="/api/folders/"+this.options.id+"/contents";g.set({from_hda_id:history_dataset_id});j.push(g)}this.options.chain_call_control.total_number=j.length;this.chainCallAddingHdas(j)},chainCallAddingHdas:function(g){var f=this;this.added_hdas=new c.Folder();var h=g.pop();if(typeof h==="undefined"){if(this.options.chain_call_control.failed_number===0){e.success("Selected datasets from history added to the folder")}else{if(this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number){e.error("There was an error and no datasets were added to the folder.")}else{if(this.options.chain_call_control.failed_number<this.options.chain_call_control.total_number){e.warning("Some of the datasets could not be added to the folder")}}}Galaxy.modal.hide();return this.added_hdas}var i=$.when(h.save({from_hda_id:h.get("from_hda_id")}));i.done(function(j){Galaxy.libraries.folderListView.collection.add(j);f.updateProgress();f.chainCallAddingHdas(g)}).fail(function(){f.options.chain_call_control.failed_number+=1;f.updateProgress();f.chainCallAddingHdas(g)})},check_include_deleted:function(f){if(f.target.checked){Galaxy.libraries.folderListView.collection=new c.Folder();Galaxy.libraries.folderListView.listenTo(Galaxy.libraries.folderListView.collection,"add",Galaxy.libraries.folderListView.renderOne);Galaxy.libraries.folderListView.fetchFolder({include_deleted:true})}else{Galaxy.libraries.folderListView.collection=new c.Folder();Galaxy.libraries.folderListView.listenTo(Galaxy.libraries.folderListView.collection,"add",Galaxy.libraries.folderListView.renderOne);Galaxy.libraries.folderListView.fetchFolder({include_deleted:false})}},templateToolBar:function(){tmpl_array=[];tmpl_array.push('<div class="library_style_container">');tmpl_array.push('<h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fol…" target="_blank">Trello</a>.</h3>');tmpl_array.push('<div id="library_folder_toolbar">');tmpl_array.push('<span data-toggle="tooltip" data-placement="top" title="Include deleted datasets"><input id="include_deleted_datasets_chk" style="margin: 0;" type="checkbox"><span class="fa fa-trash-o fa-lg"></span></input></span>');tmpl_array.push('<div class="btn-group">');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Create New Folder" id="toolbtn_create_folder" class="btn btn-default primary-button" type="button" style="display:none;"><span class="fa fa-plus"></span><span class="fa fa-folder"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Add Datasets to Current Folder" id="toolbtn_add_files" class="btn btn-default toolbtn_add_files primary-button" type="button" style="display:none;"><span class="fa fa-plus"></span><span class="fa fa-file"></span></span></button>');tmpl_array.push("</div>");tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Import selected datasets into history" id="toolbtn_bulk_import" class="primary-button" style="margin-left: 0.5em; " type="button"><span class="fa fa-book"></span> to history</button>');tmpl_array.push(' <div id="toolbtn_dl" class="btn-group" style="margin-left: 0.5em; ">');tmpl_array.push(' <button title="Download selected datasets as archive" id="drop_toggle" type="button" class="primary-button dropdown-toggle" data-toggle="dropdown">');tmpl_array.push(' <span class="fa fa-download"></span> download <span class="caret"></span>');tmpl_array.push(" </button>");tmpl_array.push(' <ul class="dropdown-menu" role="menu">');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/tgz">.tar.gz</a></li>');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/tbz">.tar.bz</a></li>');tmpl_array.push(' <li id="download_archive"><a href="#/folders/<%= id %>/download/zip">.zip</a></li>');tmpl_array.push(" </ul>");tmpl_array.push(" </div>");tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Mark selected datasets deleted" id="toolbtn_bulk_delete" class="primary-button" style="margin-left: 0.5em; " type="button"><span class="fa fa-trash-o"></span> delete</button>');tmpl_array.push(" </div>");tmpl_array.push(' <div id="folder_items_element">');tmpl_array.push(" </div>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))},templateNewFolderInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_folder_modal">');tmpl_array.push("<form>");tmpl_array.push('<input type="text" name="Name" value="" placeholder="Name">');tmpl_array.push('<input type="text" name="Description" value="" placeholder="Description">');tmpl_array.push("</form>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))},templateBulkImportInModal:function(){var f=[];f.push('<span id="history_modal_combo_bulk" style="width:90%; margin-left: 1em; margin-right: 1em; ">');f.push("Select history: ");f.push('<select id="dataset_import_bulk" name="dataset_import_bulk" style="width:50%; margin-bottom: 1em; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</span>");return _.template(f.join(""))},templateImportIntoHistoryProgressBar:function(){var f=[];f.push('<div class="import_text">');f.push("Importing selected datasets to history <b><%= _.escape(history_name) %></b>");f.push("</div>");f.push('<div class="progress">');f.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');f.push(' <span class="completion_span">0% Complete</span>');f.push(" </div>");f.push("</div>");f.push("");return _.template(f.join(""))},templateAddingDatasetsProgressBar:function(){var f=[];f.push('<div class="import_text">');f.push("Adding selected datasets from history to library folder <b><%= _.escape(folder_name) %></b>");f.push("</div>");f.push('<div class="progress">');f.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');f.push(' <span class="completion_span">0% Complete</span>');f.push(" </div>");f.push("</div>");f.push("");return _.template(f.join(""))},templateAddFilesInModal:function(){var f=[];f.push('<div id="add_files_modal">');f.push('<div id="history_modal_combo_bulk">');f.push("Select history: ");f.push('<select id="dataset_add_bulk" name="dataset_add_bulk" style="width:66%; "> ');f.push(" <% _.each(histories, function(history) { %>");f.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');f.push(" <% }); %>");f.push("</select>");f.push("</div>");f.push('<div id="selected_history_content">');f.push("</div>");f.push("</div>");return _.template(f.join(""))},templateHistoryContents:function(){var f=[];f.push("Choose the datasets to import:");f.push("<ul>");f.push(" <% _.each(history_contents, function(history_item) { %>");f.push(' <li data-id="<%= _.escape(history_item.get("id")) %>">');f.push(' <input style="margin: 0;" type="checkbox"><%= _.escape(history_item.get("hid")) %>: <%= _.escape(history_item.get("name")) %>');f.push(" </li>");f.push(" <% }); %>");f.push("</ul>");return _.template(f.join(""))}});return{FolderToolbarView:a}});
\ No newline at end of file
diff -r 8ed5006bfc1f67350834291bc81ace94312ad070 -r 5e1f9169837f41f0cf007228e01b5a3cf1635dba static/scripts/packed/mvc/library/library-libraryrow-view.js
--- a/static/scripts/packed/mvc/library/library-libraryrow-view.js
+++ b/static/scripts/packed/mvc/library/library-libraryrow-view.js
@@ -1,1 +1,1 @@
-define(["galaxy.masthead","utils/utils","libs/toastr"],function(b,c,d){var a=Backbone.View.extend({events:{"click .edit_library_btn":"edit_button_clicked","click .cancel_library_btn":"cancel_library_modification","click .save_library_btn":"save_library_modification","click .delete_library_btn":"delete_library","click .undelete_library_btn":"undelete_library","click .upload_library_btn":"upload_to_library","click .permission_library_btn":"permissions_on_library"},edit_mode:false,element_visibility_config:{upload_library_btn:false,edit_library_btn:false,permission_library_btn:false,save_library_btn:false,cancel_library_btn:false,delete_library_btn:false,undelete_library_btn:false},initialize:function(e){this.render(e)},render:function(f){if(typeof f==="undefined"){f=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"))}this.prepareButtons(f);var e=this.templateRow();this.setElement(e({library:f,button_config:this.element_visibility_config,edit_mode:this.edit_mode}));this.$el.show();return this},repaint:function(e){$(".tooltip").hide();var f=this.$el;this.render(e);f.replaceWith(this.$el);this.$el.find("[data-toggle]").tooltip()},prepareButtons:function(e){vis_config=this.element_visibility_config;if(this.edit_mode===false){vis_config.save_library_btn=false;vis_config.cancel_library_btn=false;vis_config.delete_library_btn=false;if(e.get("deleted")===true){vis_config.undelete_library_btn=true;vis_config.upload_library_btn=false;vis_config.edit_library_btn=false;vis_config.permission_library_btn=false}else{if(e.get("deleted")===false){vis_config.save_library_btn=false;vis_config.cancel_library_btn=false;vis_config.undelete_library_btn=false;if(e.get("can_user_add")===true){vis_config.upload_library_btn=true}if(e.get("can_user_modify")===true){vis_config.edit_library_btn=true}if(e.get("can_user_manage")===true){vis_config.permission_library_btn=true}}}}else{if(this.edit_mode===true){vis_config.upload_library_btn=false;vis_config.edit_library_btn=false;vis_config.permission_library_btn=false;vis_config.save_library_btn=true;vis_config.cancel_library_btn=true;vis_config.delete_library_btn=true}}this.element_visibility_config=vis_config},upload_to_library:function(){d.info("Coming soon. Stay tuned.")},permissions_on_library:function(){d.info("Coming soon. Stay tuned.")},edit_button_clicked:function(){this.edit_mode=true;this.repaint()},cancel_library_modification:function(){d.info("Modifications canceled");this.edit_mode=false;this.repaint()},save_library_modification:function(){var f=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"));var g=false;var i=this.$el.find(".input_library_name").val();if(typeof i!=="undefined"&&i!==f.get("name")){if(i.length>2){f.set("name",i);g=true}else{d.warning("Library name has to be at least 3 characters long");return}}var h=this.$el.find(".input_library_description").val();if(typeof h!=="undefined"&&h!==f.get("description")){f.set("description",h);g=true}var j=this.$el.find(".input_library_synopsis").val();if(typeof j!=="undefined"&&j!==f.get("synopsis")){f.set("synopsis",j);g=true}if(g){var e=this;f.save(null,{patch:true,success:function(k){e.edit_mode=false;e.repaint(k);d.success("Changes to library saved")},error:function(){d.error("An error occured during updating the library :(")}})}else{this.edit_mode=false;this.repaint(f);d.info("Nothing has changed")}},delete_library:function(){var f=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"));var e=this;f.destroy({success:function(g){g.set("deleted",true);Galaxy.libraries.libraryListView.collection.add(g);e.edit_mode=false;if(Galaxy.libraries.preferences.get("with_deleted")===false){$(".tooltip").hide();e.$el.remove()}else{if(Galaxy.libraries.preferences.get("with_deleted")===true){e.repaint(g)}}d.success("Library has been marked deleted")},error:function(){d.error("An error occured during deleting the library :(")}})},undelete_library:function(){var f=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"));var e=this;f.url=f.urlRoot+f.id+"?undelete=true";f.destroy({success:function(g){g.set("deleted",false);Galaxy.libraries.libraryListView.collection.add(g);e.edit_mode=false;e.repaint(g);d.success("Library has been undeleted")},error:function(){d.error("An error occured while undeleting the library :(")}})},templateRow:function(){tmpl_array=[];tmpl_array.push(' <tr class="<% if(library.get("deleted") === true) { print("active") } %>" style="display:none;" data-id="<%- library.get("id") %>">');tmpl_array.push(" <% if(!edit_mode) { %>");tmpl_array.push(' <td><a href="#folders/<%- library.get("root_folder_id") %>"><%- library.get("name") %></a></td>');tmpl_array.push(' <td><%= _.escape(library.get("description")) %></td>');tmpl_array.push(' <td><%= _.escape(library.get("synopsis")) %></td>');tmpl_array.push(" <% } else if(edit_mode){ %>");tmpl_array.push(' <td><input type="text" class="form-control input_library_name" placeholder="name" value="<%- library.get("name") %>"></td>');tmpl_array.push(' <td><input type="text" class="form-control input_library_description" placeholder="description" value="<%- library.get("description") %>"></td>');tmpl_array.push(' <td><input type="text" class="form-control input_library_synopsis" placeholder="synopsis" value="<%- library.get("synopsis") %>"></td>');tmpl_array.push(" <% } %>");tmpl_array.push(' <td class="right-center">');tmpl_array.push(' <% if(library.get("deleted") === true) { %>');tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg deleted_lib_ico"></span>');tmpl_array.push(' <% } else if(library.get("public") === true) { %>');tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Public" style="color:grey;" class="fa fa-globe fa-lg public_lib_ico"></span>');tmpl_array.push(" <% }%>");tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Modify library" class="primary-button btn-xs edit_library_btn" type="button" style="<% if(button_config.edit_library_btn === false) { print("display:none;") } %>"><span class="fa fa-pencil"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Modify permissions" class="primary-button btn-xs permission_library_btn" type="button" style="<% if(button_config.permission_library_btn === false) { print("display:none;") } %>"><span class="fa fa-group"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Save changes" class="primary-button btn-xs save_library_btn" type="button" style="<% if(button_config.save_library_btn === false) { print("display:none;") } %>"><span class="fa fa-floppy-o"> Save</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Discard changes" class="primary-button btn-xs cancel_library_btn" type="button" style="<% if(button_config.cancel_library_btn === false) { print("display:none;") } %>"><span class="fa fa-times"> Cancel</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Delete library (can be undeleted later)" class="primary-button btn-xs delete_library_btn" type="button" style="<% if(button_config.delete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-trash-o"> Delete</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Undelete library" class="primary-button btn-xs undelete_library_btn" type="button" style="<% if(button_config.undelete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-unlock"> Undelete</span></button>');tmpl_array.push(" </td>");tmpl_array.push(" </tr>");return _.template(tmpl_array.join(""))}});return{LibraryRowView:a}});
\ No newline at end of file
+define(["galaxy.masthead","utils/utils","libs/toastr"],function(b,c,d){var a=Backbone.View.extend({events:{"click .edit_library_btn":"edit_button_clicked","click .cancel_library_btn":"cancel_library_modification","click .save_library_btn":"save_library_modification","click .delete_library_btn":"delete_library","click .undelete_library_btn":"undelete_library","click .upload_library_btn":"upload_to_library","click .permission_library_btn":"permissions_on_library"},edit_mode:false,element_visibility_config:{upload_library_btn:false,edit_library_btn:false,permission_library_btn:false,save_library_btn:false,cancel_library_btn:false,delete_library_btn:false,undelete_library_btn:false},initialize:function(e){this.render(e)},render:function(f){if(typeof f==="undefined"){f=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"))}this.prepareButtons(f);var e=this.templateRow();this.setElement(e({library:f,button_config:this.element_visibility_config,edit_mode:this.edit_mode}));this.$el.show();return this},repaint:function(e){$(".tooltip").hide();var f=this.$el;this.render(e);f.replaceWith(this.$el);this.$el.find("[data-toggle]").tooltip()},prepareButtons:function(e){vis_config=this.element_visibility_config;if(this.edit_mode===false){vis_config.save_library_btn=false;vis_config.cancel_library_btn=false;vis_config.delete_library_btn=false;if(e.get("deleted")===true){vis_config.undelete_library_btn=true;vis_config.upload_library_btn=false;vis_config.edit_library_btn=false;vis_config.permission_library_btn=false}else{if(e.get("deleted")===false){vis_config.save_library_btn=false;vis_config.cancel_library_btn=false;vis_config.undelete_library_btn=false;if(e.get("can_user_add")===true){vis_config.upload_library_btn=true}if(e.get("can_user_modify")===true){vis_config.edit_library_btn=true}if(e.get("can_user_manage")===true){vis_config.permission_library_btn=true}}}}else{if(this.edit_mode===true){vis_config.upload_library_btn=false;vis_config.edit_library_btn=false;vis_config.permission_library_btn=false;vis_config.save_library_btn=true;vis_config.cancel_library_btn=true;vis_config.delete_library_btn=true}}this.element_visibility_config=vis_config},upload_to_library:function(){d.info("Coming soon. Stay tuned.")},permissions_on_library:function(){d.info("Coming soon. Stay tuned.")},edit_button_clicked:function(){this.edit_mode=true;this.repaint()},cancel_library_modification:function(){d.info("Modifications canceled");this.edit_mode=false;this.repaint()},save_library_modification:function(){var f=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"));var g=false;var i=this.$el.find(".input_library_name").val();if(typeof i!=="undefined"&&i!==f.get("name")){if(i.length>2){f.set("name",i);g=true}else{d.warning("Library name has to be at least 3 characters long");return}}var h=this.$el.find(".input_library_description").val();if(typeof h!=="undefined"&&h!==f.get("description")){f.set("description",h);g=true}var j=this.$el.find(".input_library_synopsis").val();if(typeof j!=="undefined"&&j!==f.get("synopsis")){f.set("synopsis",j);g=true}if(g){var e=this;f.save(null,{patch:true,success:function(k){e.edit_mode=false;e.repaint(k);d.success("Changes to library saved")},error:function(){d.error("An error occured during updating the library :(")}})}else{this.edit_mode=false;this.repaint(f);d.info("Nothing has changed")}},delete_library:function(){var f=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"));var e=this;f.destroy({success:function(g){g.set("deleted",true);Galaxy.libraries.libraryListView.collection.add(g);e.edit_mode=false;if(Galaxy.libraries.preferences.get("with_deleted")===false){$(".tooltip").hide();e.$el.remove()}else{if(Galaxy.libraries.preferences.get("with_deleted")===true){e.repaint(g)}}d.success("Library has been marked deleted")},error:function(){d.error("An error occured during deleting the library :(")}})},undelete_library:function(){var f=Galaxy.libraries.libraryListView.collection.get(this.$el.data("id"));var e=this;f.url=f.urlRoot+f.id+"?undelete=true";f.destroy({success:function(g){g.set("deleted",false);Galaxy.libraries.libraryListView.collection.add(g);e.edit_mode=false;e.repaint(g);d.success("Library has been undeleted")},error:function(){d.error("An error occured while undeleting the library :(")}})},templateRow:function(){tmpl_array=[];tmpl_array.push(' <tr class="<% if(library.get("deleted") === true) { print("active") } %>" style="display:none;" data-id="<%- library.get("id") %>">');tmpl_array.push(" <% if(!edit_mode) { %>");tmpl_array.push(' <% if(library.get("deleted")) { %>');tmpl_array.push(' <td style="color:grey;"><%- library.get("name") %></td>');tmpl_array.push(" <% } else { %>");tmpl_array.push(' <td><a href="#folders/<%- library.get("root_folder_id") %>"><%- library.get("name") %></a></td>');tmpl_array.push(" <% } %>");tmpl_array.push(' <td><%= _.escape(library.get("description")) %></td>');tmpl_array.push(' <td><%= _.escape(library.get("synopsis")) %></td>');tmpl_array.push(" <% } else if(edit_mode){ %>");tmpl_array.push(' <td><input type="text" class="form-control input_library_name" placeholder="name" value="<%- library.get("name") %>"></td>');tmpl_array.push(' <td><input type="text" class="form-control input_library_description" placeholder="description" value="<%- library.get("description") %>"></td>');tmpl_array.push(' <td><input type="text" class="form-control input_library_synopsis" placeholder="synopsis" value="<%- library.get("synopsis") %>"></td>');tmpl_array.push(" <% } %>");tmpl_array.push(' <td class="right-center">');tmpl_array.push(' <% if(library.get("deleted")) { %>');tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg deleted_lib_ico"></span>');tmpl_array.push(' <% } else if(library.get("public")) { %>');tmpl_array.push(' <span data-toggle="tooltip" data-placement="top" title="Public" style="color:grey;" class="fa fa-globe fa-lg public_lib_ico"></span>');tmpl_array.push(" <% }%>");tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Modify library" class="primary-button btn-xs edit_library_btn" type="button" style="<% if(button_config.edit_library_btn === false) { print("display:none;") } %>"><span class="fa fa-pencil"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Modify permissions" class="primary-button btn-xs permission_library_btn" type="button" style="<% if(button_config.permission_library_btn === false) { print("display:none;") } %>"><span class="fa fa-group"></span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Save changes" class="primary-button btn-xs save_library_btn" type="button" style="<% if(button_config.save_library_btn === false) { print("display:none;") } %>"><span class="fa fa-floppy-o"> Save</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Discard changes" class="primary-button btn-xs cancel_library_btn" type="button" style="<% if(button_config.cancel_library_btn === false) { print("display:none;") } %>"><span class="fa fa-times"> Cancel</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Delete library (can be undeleted later)" class="primary-button btn-xs delete_library_btn" type="button" style="<% if(button_config.delete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-trash-o"> Delete</span></button>');tmpl_array.push(' <button data-toggle="tooltip" data-placement="top" title="Undelete library" class="primary-button btn-xs undelete_library_btn" type="button" style="<% if(button_config.undelete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-unlock"> Undelete</span></button>');tmpl_array.push(" </td>");tmpl_array.push(" </tr>");return _.template(tmpl_array.join(""))}});return{LibraryRowView:a}});
\ No newline at end of file
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.
1
0
commit/galaxy-central: dan: Allow specifying a specific python version when using setup_virtualenv.
by commits-noreply@bitbucket.org 28 Apr '14
by commits-noreply@bitbucket.org 28 Apr '14
28 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8ed5006bfc1f/
Changeset: 8ed5006bfc1f
User: dan
Date: 2014-04-28 21:12:13
Summary: Allow specifying a specific python version when using setup_virtualenv.
Affected #: 1 file
diff -r a4a71a03ed7a11ccea7d889bd566fb003932647b -r 8ed5006bfc1f67350834291bc81ace94312ad070 lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
@@ -1133,8 +1133,9 @@
with open( requirements_path, "w" ) as f:
f.write( requirements )
venv_directory = os.path.join( install_dir, "venv" )
+ python_cmd = action_dict[ 'python' ]
# TODO: Consider making --no-site-packages optional.
- setup_command = "python %s/virtualenv.py --no-site-packages '%s'" % (venv_src_directory, venv_directory)
+ setup_command = "%s %s/virtualenv.py --no-site-packages '%s'" % ( python_cmd, venv_src_directory, venv_directory )
# POSIXLY_CORRECT forces shell commands . and source to have the same
# and well defined behavior in bash/zsh.
activate_command = "POSIXLY_CORRECT=1; . %s" % os.path.join( venv_directory, "bin", "activate" )
@@ -1183,6 +1184,7 @@
# lxml==2.3.0</action>
## Manually specify contents of requirements.txt file to create dynamically.
action_dict[ 'requirements' ] = td_common_util.evaluate_template( action_elem.text or 'requirements.txt', install_dir )
+ action_dict[ 'python' ] = action_elem.get( 'python', 'python' )
return action_dict
class ShellCommand( RecipeStep ):
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.
1
0
commit/galaxy-central: dan: Fix directory variable name in setup_virtualenv.
by commits-noreply@bitbucket.org 28 Apr '14
by commits-noreply@bitbucket.org 28 Apr '14
28 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a4a71a03ed7a/
Changeset: a4a71a03ed7a
User: dan
Date: 2014-04-28 21:06:55
Summary: Fix directory variable name in setup_virtualenv.
Affected #: 1 file
diff -r 8877489b446d73aaad93cbb1569866a9b824ac5a -r a4a71a03ed7a11ccea7d889bd566fb003932647b lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
@@ -1124,7 +1124,7 @@
log.debug( 'Unable to install virtualenv' )
return tool_dependency, None, None
requirements = action_dict[ 'requirements' ]
- if os.path.exists( os.path.join( dir, requirements ) ):
+ if os.path.exists( os.path.join( install_dir, requirements ) ):
# requirements specified as path to a file
requirements_path = requirements
else:
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.
1
0
commit/galaxy-central: dan: Fix naming of install action 'setup_virtual_env' --> 'setup_virtualenv'.
by commits-noreply@bitbucket.org 28 Apr '14
by commits-noreply@bitbucket.org 28 Apr '14
28 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8877489b446d/
Changeset: 8877489b446d
User: dan
Date: 2014-04-28 21:05:32
Summary: Fix naming of install action 'setup_virtual_env' --> 'setup_virtualenv'.
Affected #: 2 files
diff -r 197878e9908c647916f460d4d110a90940c8317e -r 8877489b446d73aaad93cbb1569866a9b824ac5a lib/tool_shed/galaxy_install/tool_dependencies/recipe/recipe_manager.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/recipe/recipe_manager.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/recipe/recipe_manager.py
@@ -434,7 +434,7 @@
setup_perl_environment=step_handler.SetupPerlEnvironment(),
setup_r_environment=step_handler.SetupREnvironment(),
setup_ruby_environment=step_handler.SetupRubyEnvironment(),
- setup_virtual_env=step_handler.SetupVirtualEnv(),
+ setup_virtualenv=step_handler.SetupVirtualEnv(),
shell_command=step_handler.ShellCommand(),
template_command=step_handler.TemplateCommand() )
return step_handlers_by_type
@@ -453,4 +453,4 @@
install_dir=install_dir,
is_binary_download=is_binary_download )
return action_dict
-
\ No newline at end of file
+
diff -r 197878e9908c647916f460d4d110a90940c8317e -r 8877489b446d73aaad93cbb1569866a9b824ac5a lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
@@ -1106,7 +1106,7 @@
class SetupVirtualEnv( RecipeStep ):
def __init__( self ):
- self.type = 'setup_virtual_env'
+ self.type = 'setup_virtualenv'
def execute_step( self, app, tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder,
install_environment, work_dir, install_dir, current_dir=None, initial_download=False ):
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.
1
0
commit/galaxy-central: carlfeberhard: Bugfixes: do not render entire document from grid_base if embedded, use embedded in published grids, fix permission issue in visualization/saved
by commits-noreply@bitbucket.org 28 Apr '14
by commits-noreply@bitbucket.org 28 Apr '14
28 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/197878e9908c/
Changeset: 197878e9908c
User: carlfeberhard
Date: 2014-04-28 20:59:25
Summary: Bugfixes: do not render entire document from grid_base if embedded, use embedded in published grids, fix permission issue in visualization/saved
Affected #: 14 files
diff -r 8f6cba970f9ee28477a4e763218d0cce73cb9a21 -r 197878e9908c647916f460d4d110a90940c8317e lib/galaxy/web/base/controller.py
--- a/lib/galaxy/web/base/controller.py
+++ b/lib/galaxy/web/base/controller.py
@@ -1295,6 +1295,7 @@
else:
decoded_id = trans.security.decode_id( id )
vis = session.query( trans.model.Visualization ).get( decoded_id )
+ #TODO: security check?
# Create new VisualizationRevision that will be attached to the viz
vis_rev = trans.model.VisualizationRevision()
diff -r 8f6cba970f9ee28477a4e763218d0cce73cb9a21 -r 197878e9908c647916f460d4d110a90940c8317e lib/galaxy/webapps/galaxy/controllers/history.py
--- a/lib/galaxy/webapps/galaxy/controllers/history.py
+++ b/lib/galaxy/webapps/galaxy/controllers/history.py
@@ -208,12 +208,14 @@
@web.expose
def list_published( self, trans, **kwargs ):
+ if 'async' in kwargs:
+ kwargs[ 'embedded' ] = True
+ return self.published_list_grid( trans, **kwargs )
+
+ kwargs[ 'embedded' ] = True
grid = self.published_list_grid( trans, **kwargs )
- if 'async' in kwargs:
- return grid
- else:
- # Render grid wrapped in panels
- return trans.fill_template( "history/list_published.mako", grid=grid )
+ return trans.fill_template( "history/list_published.mako", embedded_grid=grid )
+
@web.expose
@web.require_login( "work with multiple histories" )
diff -r 8f6cba970f9ee28477a4e763218d0cce73cb9a21 -r 197878e9908c647916f460d4d110a90940c8317e lib/galaxy/webapps/galaxy/controllers/page.py
--- a/lib/galaxy/webapps/galaxy/controllers/page.py
+++ b/lib/galaxy/webapps/galaxy/controllers/page.py
@@ -302,6 +302,8 @@
return self.sharing( trans, **kwargs )
session.flush()
+ #HACK: to prevent the insertion of an entire html document inside another
+ kwargs[ 'embedded' ] = True
# Build grid HTML.
grid = self._page_list( trans, *args, **kwargs )
@@ -315,16 +317,17 @@
.all()
# Render grid wrapped in panels
- return trans.fill_template( "page/index.mako", grid=grid, shared_by_others=shared_by_others )
+ return trans.fill_template( "page/index.mako", embedded_grid=grid, shared_by_others=shared_by_others )
@web.expose
def list_published( self, trans, *args, **kwargs ):
+ kwargs[ 'embedded' ] = True
grid = self._all_published_list( trans, *args, **kwargs )
if 'async' in kwargs:
return grid
- else:
- # Render grid wrapped in panels
- return trans.fill_template( "page/list_published.mako", grid=grid )
+
+ # Render grid wrapped in panels
+ return trans.fill_template( "page/list_published.mako", embedded_grid=grid )
@web.expose
diff -r 8f6cba970f9ee28477a4e763218d0cce73cb9a21 -r 197878e9908c647916f460d4d110a90940c8317e lib/galaxy/webapps/galaxy/controllers/root.py
--- a/lib/galaxy/webapps/galaxy/controllers/root.py
+++ b/lib/galaxy/webapps/galaxy/controllers/root.py
@@ -541,3 +541,8 @@
raise HTTPBadGateway()
trans.response.status = code
return { 'error': 'Fake error!' }
+
+ @web.expose
+ def test( self, trans, **kwargs ):
+ #trans.response.headers[ 'Content-Type' ] = 'text/plain'
+ return trans.fill_template( 'test/test.mako', **kwargs )
diff -r 8f6cba970f9ee28477a4e763218d0cce73cb9a21 -r 197878e9908c647916f460d4d110a90940c8317e lib/galaxy/webapps/galaxy/controllers/visualization.py
--- a/lib/galaxy/webapps/galaxy/controllers/visualization.py
+++ b/lib/galaxy/webapps/galaxy/controllers/visualization.py
@@ -340,7 +340,6 @@
@web.require_login( "see all available datasets" )
def list_datasets( self, trans, **kwargs ):
"""List all datasets that can be added as tracks"""
-
# Render the list view
return self._data_grid( trans, **kwargs )
@@ -350,12 +349,13 @@
@web.expose
def list_published( self, trans, *args, **kwargs ):
+ kwargs[ 'embedded' ] = True
grid = self._published_list_grid( trans, **kwargs )
if 'async' in kwargs:
return grid
- else:
- # Render grid wrapped in panels
- return trans.fill_template( "visualization/list_published.mako", grid=grid )
+
+ # Render grid wrapped in panels
+ return trans.fill_template( "visualization/list_published.mako", embedded_grid=grid )
@web.expose
@web.require_login( "use Galaxy visualizations", use_panels=True )
@@ -385,7 +385,9 @@
.order_by( desc( model.Visualization.update_time ) ) \
.all()
- return trans.fill_template( "visualization/list.mako", grid=self._user_list_grid( trans, *args, **kwargs ), shared_by_others=shared_by_others )
+ kwargs[ 'embedded' ] = True
+ grid = self._user_list_grid( trans, *args, **kwargs )
+ return trans.fill_template( "visualization/list.mako", embedded_grid=grid, shared_by_others=shared_by_others )
#
# -- Functions for operating on visualizations. --
@@ -571,7 +573,7 @@
raise web.httpexceptions.HTTPNotFound()
# Security check raises error if user cannot access visualization.
- self.security_check( trans, visualization, False, True)
+ self.security_check( trans, visualization, check_ownership=False, check_accessible=True )
# Get rating data.
user_item_rating = 0
@@ -747,8 +749,15 @@
if isinstance( config, basestring ):
config = from_json_string( config )
title = title or DEFAULT_VISUALIZATION_NAME
+
#TODO: allow saving to (updating) a specific revision - should be part of UsesVisualization
#TODO: would be easier if this returned the visualization directly
+ # check security if posting to existing visualization
+ if id is not None:
+ visualization = self.get_visualization( trans, id, check_ownership=True, check_accessible=False )
+ #??: on not owner: error raised, but not returned (status = 200)
+
+ #TODO: there's no security check in save visualization (if passed an id)
returned = self.save_visualization( trans, config, type, id, title )
# redirect to GET to prevent annoying 'Do you want to post again?' dialog on page reload
@@ -760,7 +769,8 @@
# render the saved visualization by passing to render, sending latest revision config
#TODO: allow loading a specific revision - should be part of UsesVisualization
- visualization = self.get_visualization( trans, id, check_ownership=True, check_accessible=False )
+ #visualization = self.get_visualization( trans, id, check_ownership=True, check_accessible=False )
+ visualization = self.get_visualization( trans, id, check_ownership=False, check_accessible=True )
config = copy.copy( visualization.latest_revision.config )
# re-add title to kwargs for passing to render
diff -r 8f6cba970f9ee28477a4e763218d0cce73cb9a21 -r 197878e9908c647916f460d4d110a90940c8317e lib/galaxy/webapps/galaxy/controllers/workflow.py
--- a/lib/galaxy/webapps/galaxy/controllers/workflow.py
+++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py
@@ -216,12 +216,13 @@
@web.expose
def list_published( self, trans, **kwargs ):
+ kwargs[ 'embedded' ] = True
grid = self.published_list_grid( trans, **kwargs )
if 'async' in kwargs:
return grid
- else:
- # Render grid wrapped in panels
- return trans.fill_template( "workflow/list_published.mako", grid=grid )
+
+ # Render grid wrapped in panels
+ return trans.fill_template( "workflow/list_published.mako", embedded_grid=grid )
@web.expose
def display_by_username_and_slug( self, trans, username, slug, format='html' ):
diff -r 8f6cba970f9ee28477a4e763218d0cce73cb9a21 -r 197878e9908c647916f460d4d110a90940c8317e templates/grid_base.mako
--- a/templates/grid_base.mako
+++ b/templates/grid_base.mako
@@ -1,6 +1,12 @@
<%!
from galaxy.web.framework.helpers.grids import TextColumn
+
def inherit(context):
+ kwargs = context.get( 'kwargs', {} )
+ if kwargs.get( 'embedded', False ):
+ # No inheritance - using only embeddable content (self.body)
+ return None
+
if context.get('use_panels'):
if context.get('webapp'):
webapp = context.get('webapp')
@@ -10,17 +16,39 @@
else:
return '/base.mako'
%>
-
-## import/inherit makos
<%inherit file="${inherit(context)}"/><%namespace file="/display_common.mako" import="get_class_plural" />
+##
+## Override methods from base.mako and base_panels.mako
+##
+
+<%def name="init( embedded=False, insert=None )">
+<%
+ self.has_left_panel = False
+ self.has_right_panel = False
+ self.message_box_visible = False
+ self.overlay_visible = False
+ self.active_view = 'user'
+%>
+</%def>
+
+## render title
+<%def name="title()">${grid.title}</%def>
+
+## render in center panel
+<%def name="center_panel()">
+ ${self.load()}
+</%def>
+
+## render in body
+<%def name="body()">
+ ${self.load()}
+</%def>
+
## creates grid
-<%def name="load(embedded=False, insert=None)">
-
- ## create dictionary
- ${self.init(embedded, insert)}
-
+<%def name="load( embedded=False, insert=None )">
+ <!-- grid_base.mako -->
## imports
${h.css( "autocomplete_tagging", "jquery.rating" )}
${h.js("libs/jquery/jquery.autocomplete", "galaxy.autocom_tagging", "libs/jquery/jquery.rating" )}
@@ -31,37 +59,29 @@
## load javascript
<script type="text/javascript">
var gridView = null;
- function add_tag_to_grid_filter (tag_name, tag_value)
- {
- ## Put tag name and value together.
- var tag = tag_name + (tag_value !== undefined && tag_value !== "" ? ":" + tag_value : "");
- var advanced_search = $('#advanced-search').is(":visible");
- if (!advanced_search)
- {
+ function add_tag_to_grid_filter( tag_name, tag_value ){
+ // Put tag name and value together.
+ var tag = tag_name + ( tag_value !== undefined && tag_value !== "" ? ":" + tag_value : "" );
+ var advanced_search = $( '#advanced-search').is(":visible" );
+ if( !advanced_search ){
$('#standard-search').slideToggle('fast');
$('#advanced-search').slideToggle('fast');
}
- gridView.add_filter_condition("tags", tag);
+ gridView.add_filter_condition( "tags", tag );
};
- ## load grid viewer
- $(function() {
- require(['mvc/grid/grid-view'], function(GridView) {
- gridView = new GridView(${h.to_json_string(self.grid_config)});
+ // load grid viewer
+ require(['mvc/grid/grid-view'], function(GridView) {
+ $(function() {
+ gridView = new GridView( ${ h.to_json_string( self.grid_config() ) } );
});
});
</script></%def>
+<%def name="grid_config( embedded=False, insert=None )">
## generates dictionary
-<%def name="init(embedded=False, insert=None)"><%
- self.has_left_panel = False
- self.has_right_panel = False
- self.message_box_visible = False
- self.overlay_visible = False
- self.active_view = 'user'
-
self.grid_config = {
'title' : grid.title,
'url_base' : trans.request.path_url,
@@ -108,7 +128,7 @@
## column
for column in grid.columns:
-
+
## add column sort links
href = None
extra = ''
@@ -138,7 +158,7 @@
'extra' : extra
})
endfor
-
+
## operations
for operation in grid.operations:
self.grid_config['operations'].append({
@@ -152,7 +172,7 @@
})
if operation.allow_multiple:
self.grid_config['show_item_checkboxes'] = True
-
+
if operation.global_operation:
self.grid_config['global_operation'] = url( ** (operation.global_operation()) )
endfor
@@ -177,7 +197,7 @@
self.grid_config['categorical_filters'][column.key] = dict([ (filter.label, filter.args) for filter in column.get_accepted_filters() ])
endif
endfor
-
+
# items
for i, item in enumerate( query ):
item_dict = {
@@ -230,22 +250,8 @@
## add item to list
self.grid_config['items'].append(item_dict)
endfor
+
+ return self.grid_config
%></%def>
-##
-## Override methods from base.mako and base_panels.mako
-##
-
-## render title
-<%def name="title()">${self.grid_config['title']}</%def>
-
-## render in center panel
-<%def name="center_panel()">
- ${self.load()}
-</%def>
-
-## render in body
-<%def name="body()">
- ${self.load()}
-</%def>
diff -r 8f6cba970f9ee28477a4e763218d0cce73cb9a21 -r 197878e9908c647916f460d4d110a90940c8317e templates/webapps/galaxy/history/list_published.mako
--- a/templates/webapps/galaxy/history/list_published.mako
+++ b/templates/webapps/galaxy/history/list_published.mako
@@ -23,12 +23,10 @@
</%def><%def name="center_panel()">
-
<div style="overflow: auto; height: 100%;"><div class="page-container" style="padding: 10px;">
- ${h.to_unicode( grid )}
+ <!-- embedded grid -->
+ ${h.to_unicode( embedded_grid )}
</div></div>
-
-
</%def>
diff -r 8f6cba970f9ee28477a4e763218d0cce73cb9a21 -r 197878e9908c647916f460d4d110a90940c8317e templates/webapps/galaxy/page/index.mako
--- a/templates/webapps/galaxy/page/index.mako
+++ b/templates/webapps/galaxy/page/index.mako
@@ -13,7 +13,8 @@
<div style="overflow: auto; height: 100%;"><div class="page-container" style="padding: 10px;">
- ${h.to_unicode( grid )}
+ <!-- embedded grid -->
+ ${h.to_unicode( embedded_grid )}
<br><br><h2>Pages shared with you by others</h2>
diff -r 8f6cba970f9ee28477a4e763218d0cce73cb9a21 -r 197878e9908c647916f460d4d110a90940c8317e templates/webapps/galaxy/page/list_published.mako
--- a/templates/webapps/galaxy/page/list_published.mako
+++ b/templates/webapps/galaxy/page/list_published.mako
@@ -26,7 +26,8 @@
<div style="overflow: auto; height: 100%;"><div class="page-container" style="padding: 10px;">
- ${h.to_unicode( grid )}
+ <!-- embedded grid -->
+ ${h.to_unicode( embedded_grid )}
</div></div></%def>
diff -r 8f6cba970f9ee28477a4e763218d0cce73cb9a21 -r 197878e9908c647916f460d4d110a90940c8317e templates/webapps/galaxy/root/index.mako
--- a/templates/webapps/galaxy/root/index.mako
+++ b/templates/webapps/galaxy/root/index.mako
@@ -17,6 +17,9 @@
<%def name="javascripts()">
${parent.javascripts()}
${tool_menu_javascripts()}
+ ${h.js(
+ "utils/LazyDataLoader"
+ )}
</%def><%def name="late_javascripts()">
diff -r 8f6cba970f9ee28477a4e763218d0cce73cb9a21 -r 197878e9908c647916f460d4d110a90940c8317e templates/webapps/galaxy/visualization/list.mako
--- a/templates/webapps/galaxy/visualization/list.mako
+++ b/templates/webapps/galaxy/visualization/list.mako
@@ -26,7 +26,8 @@
</div>
%endif
- ${h.to_unicode( grid )}
+ <!-- embedded grid -->
+ ${h.to_unicode( embedded_grid )}
<br><br><h2>Visualizations shared with you by others</h2>
diff -r 8f6cba970f9ee28477a4e763218d0cce73cb9a21 -r 197878e9908c647916f460d4d110a90940c8317e templates/webapps/galaxy/visualization/list_published.mako
--- a/templates/webapps/galaxy/visualization/list_published.mako
+++ b/templates/webapps/galaxy/visualization/list_published.mako
@@ -26,7 +26,8 @@
<div style="overflow: auto; height: 100%;"><div class="page-container" style="padding: 10px;">
- ${h.to_unicode( grid )}
+ <!-- embedded grid -->
+ ${h.to_unicode( embedded_grid )}
</div></div>
diff -r 8f6cba970f9ee28477a4e763218d0cce73cb9a21 -r 197878e9908c647916f460d4d110a90940c8317e templates/webapps/galaxy/workflow/list_published.mako
--- a/templates/webapps/galaxy/workflow/list_published.mako
+++ b/templates/webapps/galaxy/workflow/list_published.mako
@@ -23,12 +23,10 @@
</%def><%def name="center_panel()">
-
<div style="overflow: auto; height: 100%;"><div class="page-container" style="padding: 10px;">
- ${h.to_unicode( grid )}
+ <!-- embedded grid -->
+ ${h.to_unicode( embedded_grid )}
</div></div>
-
-
</%def>
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.
1
0
28 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8f6cba970f9e/
Changeset: 8f6cba970f9e
User: davebgx
Date: 2014-04-28 19:20:00
Summary: Merge fix from stable.
Affected #: 1 file
diff -r d10b0cdffb0f8dda2a7cb5344ec0152f3e678818 -r 8f6cba970f9ee28477a4e763218d0cce73cb9a21 templates/admin/tool_shed_repository/install_tool_dependencies_with_update.mako
--- a/templates/admin/tool_shed_repository/install_tool_dependencies_with_update.mako
+++ b/templates/admin/tool_shed_repository/install_tool_dependencies_with_update.mako
@@ -53,16 +53,21 @@
%for key, requirements_dict in tool_dependencies_dict.items():
<%
readme_text = None
- key_items = key.split( '/' )
- key_name = key_items[ 0 ]
- key_version = key_items[ 1 ]
- readme_text = requirements_dict.get( 'readme', None )
- install_dir = os.path.join( trans.app.config.tool_dependency_dir,
- key_name,
- key_version,
- repository.owner,
- repository.name,
- repository.installed_changeset_revision )
+ if key == 'set_environment':
+ key_name = ', '.join( [ environment_variable[ 'name' ] for environment_variable in requirements_dict ] )
+ key_version = ''
+ install_dir = ''
+ else:
+ key_items = key.split( '/' )
+ key_name = key_items[ 0 ]
+ key_version = key_items[ 1 ]
+ readme_text = requirements_dict.get( 'readme', None )
+ install_dir = os.path.join( trans.app.config.tool_dependency_dir,
+ key_name,
+ key_version,
+ repository.owner,
+ repository.name,
+ repository.installed_changeset_revision )
%>
%if not os.path.exists( install_dir ):
<tr>
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.
1
0
commit/galaxy-central: davebgx: Fix server error when attempting to update a repository that defines set_environment tool dependency types.
by commits-noreply@bitbucket.org 28 Apr '14
by commits-noreply@bitbucket.org 28 Apr '14
28 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/61b4a993d39c/
Changeset: 61b4a993d39c
Branch: stable
User: davebgx
Date: 2014-04-23 22:24:11
Summary: Fix server error when attempting to update a repository that defines set_environment tool dependency types.
Affected #: 1 file
diff -r 3b42725359224832317a066d95dff596f93ab33f -r 61b4a993d39c5341afea857859221a4f5b94334f templates/admin/tool_shed_repository/install_tool_dependencies_with_update.mako
--- a/templates/admin/tool_shed_repository/install_tool_dependencies_with_update.mako
+++ b/templates/admin/tool_shed_repository/install_tool_dependencies_with_update.mako
@@ -56,16 +56,21 @@
%for key, requirements_dict in tool_dependencies_dict.items():
<%
readme_text = None
- key_items = key.split( '/' )
- key_name = key_items[ 0 ]
- key_version = key_items[ 1 ]
- readme_text = requirements_dict.get( 'readme', None )
- install_dir = os.path.join( trans.app.config.tool_dependency_dir,
- key_name,
- key_version,
- repository.owner,
- repository.name,
- repository.installed_changeset_revision )
+ if key == 'set_environment':
+ key_name = ', '.join( [ environment_variable[ 'name' ] for environment_variable in requirements_dict ] )
+ key_version = ''
+ install_dir = ''
+ else:
+ key_items = key.split( '/' )
+ key_name = key_items[ 0 ]
+ key_version = key_items[ 1 ]
+ readme_text = requirements_dict.get( 'readme', None )
+ install_dir = os.path.join( trans.app.config.tool_dependency_dir,
+ key_name,
+ key_version,
+ repository.owner,
+ repository.name,
+ repository.installed_changeset_revision )
%>
%if not os.path.exists( install_dir ):
<tr>
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.
1
0
28 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d10b0cdffb0f/
Changeset: d10b0cdffb0f
User: dan
Date: 2014-04-28 19:15:50
Summary: Fix for DatasetListWrapper.
Affected #: 1 file
diff -r 28b307e0c08791b3073dd27c0189fdd28083045d -r d10b0cdffb0f8dda2a7cb5344ec0152f3e678818 lib/galaxy/tools/wrappers.py
--- a/lib/galaxy/tools/wrappers.py
+++ b/lib/galaxy/tools/wrappers.py
@@ -215,3 +215,5 @@
return DatasetFilenameWrapper( dataset, **wrapper_kwds )
list.__init__( self, map( to_wrapper, datasets ) )
+ def __str__( self ):
+ return ','.join( map( str, self ) )
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.
1
0
4 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9dd03dd46d04/
Changeset: 9dd03dd46d04
User: jmchilton
Date: 2014-04-28 18:48:51
Summary: Create run_tests.sh to replace run_functional_tests.sh
Should be backward compatible but features better argument handling - things can appear in other orders (-id x -data_managers is the same as -data_managers -id x for instance), better error messages if arguments are missing, and more standard short argument with single dash or long argument with double dash variants of each argument are available.
Affected #: 1 file
diff -r 4a6cd1da30d0c4e3f8e0ed7b1c1e6342bed20e44 -r 9dd03dd46d04b83aeb270ebe538d6075facb5379 run_tests.sh
--- /dev/null
+++ b/run_tests.sh
@@ -0,0 +1,149 @@
+#!/bin/sh
+
+# A good place to look for nose info: http://somethingaboutorange.com/mrl/projects/nose/
+rm -f run_functional_tests.log
+
+show_help() {
+cat <<EOF
+'${0##*/}' for testing all the tools in functional directory
+'${0##*/} aaa' for testing one test case of 'aaa' ('aaa' is the file name with path)
+'${0##*/} -id bbb' for testing one tool with id 'bbb' ('bbb' is the tool id)
+'${0##*/} -sid ccc' for testing one section with sid 'ccc' ('ccc' is the string after 'section::')
+'${0##*/} -list' for listing all the tool ids
+'${0##*/} -toolshed' for running all the test scripts in the ./test/tool_shed/functional directory
+'${0##*/} -toolshed testscriptname' for running one test script named testscriptname in the .test/tool_shed/functional directory
+'${0##*/} -workflow test.xml' for running a workflow test case as defined by supplied workflow xml test file (experimental)
+'${0##*/} -framework' for running through example tool tests testing framework features in test/functional/tools"
+'${0##*/} -framework -id toolid' for testing one framework tool (in test/functional/tools/) with id 'toolid'
+'${0##*/} -data_managers -id data_manager_id' for testing one Data Manager with id 'data_manager_id'
+EOF
+}
+
+show_list() {
+ python tool_list.py
+ echo "==========================================================================================================================================="
+ echo "'${0##*/} -id bbb' for testing one tool with id 'bbb' ('bbb' is the tool id)"
+ echo "'${0##*/} -sid ccc' for testing one section with sid 'ccc' ('ccc' is the string after 'section::')"
+}
+
+test_script="./scripts/functional_tests.py"
+report_file="run_functional_tests.html"
+
+while :
+do
+ case "$1" in
+ -h|--help|-\?)
+ show_help
+ exit 0
+ ;;
+ -l|-list|--list)
+ show_list
+ exit 0
+ ;;
+ -id|--id)
+ if [ $# -gt 1 ]; then
+ test_id=$2;
+ shift 2
+ else
+ echo "--id requires an argument" 1>&2
+ exit 1
+ fi
+ ;;
+ -s|-sid|--sid)
+ if [ $# -gt 1 ]; then
+ section_id=$2
+ shift 2
+ else
+ echo "--sid requires an argument" 1>&2
+ exit 1
+ fi
+ ;;
+ -t|-toolshed|--toolshed)
+ test_script="./test/tool_shed/functional_tests.py"
+ report_file="./test/tool_shed/run_functional_tests.html"
+ if [ $# -gt 1 ]; then
+ toolshed_script=$2
+ shift 2
+ else
+ toolshed_script="./test/tool_shed/functional"
+ shift 1
+ fi
+ ;;
+ -w|-workflow|--workflow)
+ if [ $# -gt 1 ]; then
+ workflow_file=$2
+ workflow_test=1
+ shift 2
+ else
+ echo "--workflow requires an argument" 1>&2
+ exit 1
+ fi
+ ;;
+ -f|-framework|--framework)
+ framework_test=1;
+ shift 1
+ ;;
+ -d|-data_managers|--data_managers)
+ data_managers_test=1;
+ shift 1
+ ;;
+ -m|-migrated|--migrated)
+ migrated_test=1;
+ shift
+ ;;
+ -i|-installed|--installed)
+ installed_test=1;
+ shift
+ ;;
+ -r|--report_file)
+ if [ $# -gt 1 ]; then
+ report_file=$2
+ shift 2
+ else
+ echo "--report_file requires an argument" 1>&2
+ exit 1
+ fi
+ ;;
+ --)
+ shift
+ break
+ ;;
+ -*)
+ echo "invalid option: $1" 1>&2;
+ show_help
+ exit 1
+ ;;
+ *)
+ break;
+ ;;
+ esac
+done
+
+if [ -n "$migrated_test" ] ; then
+ [ -n "$test_id" ] && class=":TestForTool_$test_id" || class=""
+ extra_args="functional.test_toolbox$class -migrated"
+elif [ -n "$installed_test" ] ; then
+ [ -n "$test_id" ] && class=":TestForTool_$test_id" || class=""
+ extra_args="functional.test_toolbox$class -installed"
+elif [ -n "$framework_test" ] ; then
+ [ -n "$test_id" ] && class=":TestForTool_$test_id" || class=""
+ extra_args="functional.test_toolbox$class -framework"
+elif [ -n "$data_managers_test" ] ; then
+ [ -n "$test_id" ] && class=":TestForDataManagerTool_$test_id" || class=""
+ extra_args="functional.test_data_managers$class -data_managers"
+elif [ -n "$workflow_test" ]; then
+ extra_args="functional.workflow:WorkflowTestCase $workflow_file"
+elif [ -n "$toolshed_script" ]; then
+ extra_args="$toolshed_script"
+elif [ -n "$section_id" ]; then
+ extra_args=`python tool_list.py $section_id`
+elif [ -n "$test_id" ]; then
+ class=":TestForTool_$test_id"
+ extra_args="functional.test_toolbox$class"
+elif [ -n "$1" ] ; then
+ extra_args="$1"
+else
+ extra_args='--exclude="^get" functional'
+fi
+
+python $test_script $coverage_arg -v --with-nosehtml --html-report-file $report_file $extra_args
https://bitbucket.org/galaxy/galaxy-central/commits/08754cf82e62/
Changeset: 08754cf82e62
User: jmchilton
Date: 2014-04-28 18:48:51
Summary: Add unit tests to run_tests.sh.
Affected #: 1 file
diff -r 9dd03dd46d04b83aeb270ebe538d6075facb5379 -r 08754cf82e625cb6c6fa88aeb6e4195b222da64b run_tests.sh
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -16,6 +16,8 @@
'${0##*/} -framework' for running through example tool tests testing framework features in test/functional/tools"
'${0##*/} -framework -id toolid' for testing one framework tool (in test/functional/tools/) with id 'toolid'
'${0##*/} -data_managers -id data_manager_id' for testing one Data Manager with id 'data_manager_id'
+'${0##*/} -unit' for running all unit tests (doctests in lib and tests in test/unit)
+'${0##*/} -unit testscriptath' running particular tests scripts
EOF
}
@@ -104,6 +106,24 @@
exit 1
fi
;;
+ -c|--coverage)
+ # Must have coverage installed (try `which coverage`) - only valid with --unit
+ # for now. Would be great to get this to work with functional tests though.
+ coverage_arg="--with-coverage"
+ NOSE_WITH_COVERAGE=true
+ shift
+ ;;
+ -u|-unit|--unit)
+ report_file="run_unit_tests.html"
+ test_script="./scripts/nosetests.py"
+ if [ $# -gt 1 ]; then
+ unit_extra=$2
+ shift 2
+ else
+ unit_extra='--exclude=functional --exclude="^get" --exclude=controllers --exclude=runners lib test/unit'
+ shift 1
+ fi
+ ;;
--)
shift
break
@@ -140,6 +160,8 @@
elif [ -n "$test_id" ]; then
class=":TestForTool_$test_id"
extra_args="functional.test_toolbox$class"
+elif [ -n "$unit_extra" ]; then
+ extra_args="--with-doctest $unit_extra"
elif [ -n "$1" ] ; then
extra_args="$1"
else
https://bitbucket.org/galaxy/galaxy-central/commits/e8047b8f1e24/
Changeset: e8047b8f1e24
User: jmchilton
Date: 2014-04-28 18:48:51
Summary: Add qunit test options to new run_tests.sh script.
Can target specific tests or all tests and can optionally watch tests using Carl's work on 'grunt watch'.
Affected #: 1 file
diff -r 08754cf82e625cb6c6fa88aeb6e4195b222da64b -r e8047b8f1e24a4815138e5862f24096dfc4d9c79 run_tests.sh
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -18,6 +18,8 @@
'${0##*/} -data_managers -id data_manager_id' for testing one Data Manager with id 'data_manager_id'
'${0##*/} -unit' for running all unit tests (doctests in lib and tests in test/unit)
'${0##*/} -unit testscriptath' running particular tests scripts
+'${0##*/} -qunit' for running qunit JavaScript tests
+'${0##*/} -qunit testname' for running single JavaScript test with given name
EOF
}
@@ -31,6 +33,8 @@
test_script="./scripts/functional_tests.py"
report_file="run_functional_tests.html"
+driver="python"
+
while :
do
case "$1" in
@@ -124,6 +128,24 @@
shift 1
fi
;;
+ -q|-qunit|--qunit)
+ # Requires grunt installed and dependencies configured see
+ # test/qunit/README.txt for more information.
+ driver="grunt"
+ gruntfile="./test/qunit/Gruntfile.js"
+ if [ $# -gt 1 ]; then
+ qunit_name=$2
+ shift 2
+ else
+ shift 1
+ fi
+ ;;
+ -watch|--watch)
+ # Have grunt watch test or directory for changes, only
+ # valid for javascript testing.
+ watch=1
+ shift
+ ;;
--)
shift
break
@@ -168,4 +190,21 @@
extra_args='--exclude="^get" functional'
fi
-python $test_script $coverage_arg -v --with-nosehtml --html-report-file $report_file $extra_args
+if [ "$driver" = "python" ]; then
+ python $test_script $coverage_arg -v --with-nosehtml --html-report-file $report_file $extra_args
+else
+ if [ -n "$watch" ]; then
+ grunt_task="watch"
+ else
+ grunt_task=""
+ fi
+ if [ -n "$qunit_name" ]; then
+ grunt_args="--test=$qunit_name"
+ else
+ grunt_args=""
+ fi
+ # TODO: Exapnd javascript helpers to include setting up
+ # grunt deps in npm, "watch"ing directory, and running casper
+ # functional tests.
+ grunt --gruntfile=$gruntfile $grunt_task $grunt_args
+fi
https://bitbucket.org/galaxy/galaxy-central/commits/28b307e0c087/
Changeset: 28b307e0c087
User: jmchilton
Date: 2014-04-28 18:48:51
Summary: Rework test framework testing and tools.
-framework will still cause just a small set of non-default, non-user facing tools to be tested and exerise various aspects of the tool and test frameworks, but now an argument can be passed in -with_framework_test_tools to allow these tools to be used as part of the normal test framework (i.e. when not using -framework). This serves two purposes - to ensure the feature coverage of existing tests remains high as the tests are migrated out of the distribution and to allow a set of tests to be available for functional (e.g. API tests) that users don't need to see.
Affected #: 15 files
diff -r e8047b8f1e24a4815138e5862f24096dfc4d9c79 -r 28b307e0c08791b3073dd27c0189fdd28083045d run_tests.sh
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -32,6 +32,7 @@
test_script="./scripts/functional_tests.py"
report_file="run_functional_tests.html"
+with_framework_test_tools_arg=""
driver="python"
@@ -75,6 +76,10 @@
shift 1
fi
;;
+ -with_framework_test_tools|--with_framework_test_tools)
+ with_framework_test_tools_arg="-with_framework_test_tools"
+ shift
+ ;;
-w|-workflow|--workflow)
if [ $# -gt 1 ]; then
workflow_file=$2
@@ -191,7 +196,7 @@
fi
if [ "$driver" = "python" ]; then
- python $test_script $coverage_arg -v --with-nosehtml --html-report-file $report_file $extra_args
+ python $test_script $coverage_arg -v --with-nosehtml --html-report-file $report_file $with_framework_test_tools_arg $extra_args
else
if [ -n "$watch" ]; then
grunt_task="watch"
diff -r e8047b8f1e24a4815138e5862f24096dfc4d9c79 -r 28b307e0c08791b3073dd27c0189fdd28083045d scripts/functional_tests.py
--- a/scripts/functional_tests.py
+++ b/scripts/functional_tests.py
@@ -217,16 +217,19 @@
# Exclude all files except test_toolbox.py.
ignore_files = ( re.compile( r'^test_[adghlmsu]*' ), re.compile( r'^test_ta*' ) )
else:
+ framework_tool_dir = os.path.join('test', 'functional', 'tools')
framework_test = __check_arg( '-framework' ) # Run through suite of tests testing framework.
if framework_test:
- framework_tool_dir = os.path.join('test', 'functional', 'tools')
tool_conf = os.path.join( framework_tool_dir, 'samples_tool_conf.xml' )
datatypes_conf_override = os.path.join( framework_tool_dir, 'sample_datatypes_conf.xml' )
- test_dir = os.path.join( framework_tool_dir, 'test-data')
else:
# Use tool_conf.xml toolbox.
tool_conf = 'tool_conf.xml'
- test_dir = default_galaxy_test_file_dir
+ if __check_arg( '-with_framework_test_tools' ):
+ # Some of these tools will not work without swapping
+ # default interactor to point to test.
+ tool_conf = "%s,%s" % ( tool_conf, os.path.join( framework_tool_dir, 'samples_tool_conf.xml' ) )
+ test_dir = default_galaxy_test_file_dir
tool_config_file = os.environ.get( 'GALAXY_TEST_TOOL_CONF', tool_conf )
galaxy_test_file_dir = os.environ.get( 'GALAXY_TEST_FILE_DIR', test_dir )
if not os.path.isabs( galaxy_test_file_dir ):
diff -r e8047b8f1e24a4815138e5862f24096dfc4d9c79 -r 28b307e0c08791b3073dd27c0189fdd28083045d test-data/simple_line.txt
--- /dev/null
+++ b/test-data/simple_line.txt
@@ -0,0 +1,1 @@
+This is a line of text.
diff -r e8047b8f1e24a4815138e5862f24096dfc4d9c79 -r 28b307e0c08791b3073dd27c0189fdd28083045d test-data/simple_line_alternative.txt
--- /dev/null
+++ b/test-data/simple_line_alternative.txt
@@ -0,0 +1,1 @@
+This is a different line of text.
\ No newline at end of file
diff -r e8047b8f1e24a4815138e5862f24096dfc4d9c79 -r 28b307e0c08791b3073dd27c0189fdd28083045d test-data/simple_line_x2.txt
--- /dev/null
+++ b/test-data/simple_line_x2.txt
@@ -0,0 +1,2 @@
+This is a line of text.
+This is a line of text.
diff -r e8047b8f1e24a4815138e5862f24096dfc4d9c79 -r 28b307e0c08791b3073dd27c0189fdd28083045d test-data/simple_line_x3.txt
--- /dev/null
+++ b/test-data/simple_line_x3.txt
@@ -0,0 +1,3 @@
+This is a line of text.
+This is a line of text.
+This is a line of text.
diff -r e8047b8f1e24a4815138e5862f24096dfc4d9c79 -r 28b307e0c08791b3073dd27c0189fdd28083045d test-data/simple_line_x5.txt
--- /dev/null
+++ b/test-data/simple_line_x5.txt
@@ -0,0 +1,5 @@
+This is a line of text.
+This is a line of text.
+This is a line of text.
+This is a line of text.
+This is a line of text.
diff -r e8047b8f1e24a4815138e5862f24096dfc4d9c79 -r 28b307e0c08791b3073dd27c0189fdd28083045d test-data/simple_lines_interleaved.txt
--- /dev/null
+++ b/test-data/simple_lines_interleaved.txt
@@ -0,0 +1,4 @@
+This is a line of text.
+This is a different line of text.
+This is a line of text.
+This is a different line of text.
\ No newline at end of file
diff -r e8047b8f1e24a4815138e5862f24096dfc4d9c79 -r 28b307e0c08791b3073dd27c0189fdd28083045d test/functional/tools/test-data/simple_line.txt
--- a/test/functional/tools/test-data/simple_line.txt
+++ /dev/null
@@ -1,1 +0,0 @@
-This is a line of text.
diff -r e8047b8f1e24a4815138e5862f24096dfc4d9c79 -r 28b307e0c08791b3073dd27c0189fdd28083045d test/functional/tools/test-data/simple_line_alternative.txt
--- a/test/functional/tools/test-data/simple_line_alternative.txt
+++ /dev/null
@@ -1,1 +0,0 @@
-This is a different line of text.
\ No newline at end of file
diff -r e8047b8f1e24a4815138e5862f24096dfc4d9c79 -r 28b307e0c08791b3073dd27c0189fdd28083045d test/functional/tools/test-data/simple_line_x2.txt
--- a/test/functional/tools/test-data/simple_line_x2.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This is a line of text.
-This is a line of text.
diff -r e8047b8f1e24a4815138e5862f24096dfc4d9c79 -r 28b307e0c08791b3073dd27c0189fdd28083045d test/functional/tools/test-data/simple_line_x3.txt
--- a/test/functional/tools/test-data/simple_line_x3.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-This is a line of text.
-This is a line of text.
-This is a line of text.
diff -r e8047b8f1e24a4815138e5862f24096dfc4d9c79 -r 28b307e0c08791b3073dd27c0189fdd28083045d test/functional/tools/test-data/simple_line_x5.txt
--- a/test/functional/tools/test-data/simple_line_x5.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-This is a line of text.
-This is a line of text.
-This is a line of text.
-This is a line of text.
-This is a line of text.
diff -r e8047b8f1e24a4815138e5862f24096dfc4d9c79 -r 28b307e0c08791b3073dd27c0189fdd28083045d test/functional/tools/test-data/simple_lines_interleaved.txt
--- a/test/functional/tools/test-data/simple_lines_interleaved.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This is a line of text.
-This is a different line of text.
-This is a line of text.
-This is a different line of text.
\ No newline at end of file
diff -r e8047b8f1e24a4815138e5862f24096dfc4d9c79 -r 28b307e0c08791b3073dd27c0189fdd28083045d test/functional/tools/test-data/velveth_test1
--- a/test/functional/tools/test-data/velveth_test1
+++ /dev/null
@@ -1,1 +0,0 @@
-../../../../test-data/velveth_test1
\ No newline at end of file
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.
1
0
commit/galaxy-central: davebgx: Twill test framework cleanup. Update install and test methods to reflect changes in base twilltestcase.py.
by commits-noreply@bitbucket.org 28 Apr '14
by commits-noreply@bitbucket.org 28 Apr '14
28 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4a6cd1da30d0/
Changeset: 4a6cd1da30d0
User: davebgx
Date: 2014-04-28 17:22:17
Summary: Twill test framework cleanup. Update install and test methods to reflect changes in base twilltestcase.py.
Affected #: 2 files
diff -r fe0df2e688999aa7e0087cbb95c0a7257e9ae6d2 -r 4a6cd1da30d0c4e3f8e0ed7b1c1e6342bed20e44 test/base/twilltestcase.py
--- a/test/base/twilltestcase.py
+++ b/test/base/twilltestcase.py
@@ -1769,10 +1769,11 @@
tc.submit( "edit_external_service_button" )
for check_str in strings_displayed_after_submit:
self.check_page_for_string( check_str )
+
# Sample tracking stuff
def check_request_grid( self, cntrller, state, deleted=False, strings_displayed=[] ):
- self.visit_url( '%s/%s/browse_requests?sort=create_time&f-state=%s&f-deleted=%s' % \
- ( self.url, cntrller, state.replace( ' ', '+' ), str( deleted ) ) )
+ params = { 'f-state': state, 'f-deleted': deleted, 'sort': 'create_time' }
+ self.visit_url( '/%s/browse_requests' % cntrller )
for check_str in strings_displayed:
self.check_page_for_string( check_str )
def create_request_type( self, name, desc, request_form_id, sample_form_id, states, strings_displayed=[], strings_displayed_after_submit=[] ):
@@ -1967,8 +1968,8 @@
for check_str in strings_displayed:
self.check_page_for_string( check_str )
for sample_id in sample_ids:
- tc.fv( "1", "select_sample_%i" % sample_id, True )
- tc.fv( "1", "sample_operation", 'Select data library and folder' )
+ tc.fv( "edit_samples", "select_sample_%i" % sample_id, True )
+ tc.fv( "edit_samples", "sample_operation", 'Select data library and folder' )
# refresh on change to show the data libraries selectfield
self.refresh_form( "sample_operation", 'Select data library and folder' )
self.check_page_for_string( "Select data library:" )
diff -r fe0df2e688999aa7e0087cbb95c0a7257e9ae6d2 -r 4a6cd1da30d0c4e3f8e0ed7b1c1e6342bed20e44 test/install_and_test_tool_shed_repositories/base/twilltestcase.py
--- a/test/install_and_test_tool_shed_repositories/base/twilltestcase.py
+++ b/test/install_and_test_tool_shed_repositories/base/twilltestcase.py
@@ -3,7 +3,6 @@
import re
import test_db_util
import time
-import urllib
import galaxy.model as model
import galaxy.model.tool_shed_install as install_model
@@ -72,22 +71,22 @@
encoded_repository_id = repository_info_dict[ 'repository_id' ]
tool_shed_url = repository_info_dict[ 'tool_shed_url' ]
# Pass galaxy_url to the tool shed in order to set cookies and redirects correctly.
- install_params = urllib.urlencode( dict( repository_ids=encoded_repository_id,
- changeset_revisions=changeset_revision,
- galaxy_url=self.url ) )
+ install_params = dict( repository_ids=encoded_repository_id,
+ changeset_revisions=changeset_revision,
+ galaxy_url=self.url )
# If the tool shed does not have the same hostname as the Galaxy server being used for these tests,
# twill will not carry over previously set cookies for the Galaxy server when following the
# install_repositories_by_revision redirect, so we have to include 403 in the allowed HTTP
# status codes and log in again.
- url = '%s/repository/install_repositories_by_revision?%s' % ( tool_shed_url, install_params )
- self.visit_url( url, allowed_codes=[ 200, 403 ] )
+ url = '%s/repository/install_repositories_by_revision' % tool_shed_url
+ self.visit_url( url, params=install_params, allowed_codes=[ 200, 403 ] )
self.logout()
self.login( email='test(a)bx.psu.edu', username='test' )
- install_params = urllib.urlencode( dict( repository_ids=encoded_repository_id,
- changeset_revisions=changeset_revision,
- tool_shed_url=tool_shed_url ) )
- url = '/admin_toolshed/prepare_for_install?%s' % install_params
- self.visit_url( url )
+ install_params = dict( repository_ids=encoded_repository_id,
+ changeset_revisions=changeset_revision,
+ tool_shed_url=tool_shed_url )
+ url = '/admin_toolshed/prepare_for_install'
+ self.visit_url( url, params=install_params )
# This section is tricky, due to the way twill handles form submission. The tool dependency checkbox needs to
# be hacked in through tc.browser, putting the form field in kwd doesn't work.
form = tc.browser.get_form( 'select_tool_panel_section' )
@@ -124,13 +123,6 @@
del( kwd[ field_name ] )
return kwd
- def visit_url( self, url, allowed_codes=[ 200 ] ):
- new_url = tc.go( url )
- return_code = tc.browser.get_code()
- assert return_code in allowed_codes, 'Invalid HTTP return code %s, allowed codes: %s' % \
- ( return_code, ', '.join( str( code ) for code in allowed_codes ) )
- return new_url
-
def wait_for_repository_installation( self, repository_ids ):
final_states = [ install_model.ToolShedRepository.installation_status.ERROR,
install_model.ToolShedRepository.installation_status.INSTALLED ]
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.
1
0
commit/galaxy-central: jmchilton: Merged in jmchilton/galaxy-central-fork-1 (pull request #378)
by commits-noreply@bitbucket.org 28 Apr '14
by commits-noreply@bitbucket.org 28 Apr '14
28 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4d554f1875eb/
Changeset: 4d554f1875eb
User: jmchilton
Date: 2014-04-28 16:53:07
Summary: Merged in jmchilton/galaxy-central-fork-1 (pull request #378)
Allow specification of environment variables for job destinations
Affected #: 9 files
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee job_conf.xml.sample_advanced
--- a/job_conf.xml.sample_advanced
+++ b/job_conf.xml.sample_advanced
@@ -74,6 +74,23 @@
<param id="Resource_List">walltime=72:00:00</param></destination><destination id="remote_cluster" runner="drmaa" tags="longjobs"/>
+ <destination id="java_cluster" runner="drmaa">
+ <!-- set arbitrary environment variables at runtime - like metrics
+ doesn't yet work with local or CLI runners. But should work with
+ DRMAA/SLURM, PBS, Condor, and LWR. General dependencies for tools
+ should be configured via tool_depednency_dir and package options
+ and these options should be reserved for defining cluster specific
+ options.
+ -->
+ <env id="_JAVA_OPTIONS">-Xmx=6GB</env>
+ <env id="ANOTHER_OPTION" raw="true">'5'</env><!-- raw disables auto quoting -->
+ <env file="/mnt/java_cluster/environment_setup.sh" /><!-- will be sourced -->
+ <env exec="module load javastuff/2.10" /><!-- will be sourced -->
+ <!-- files to source and exec statements will be handled on remote
+ clusters. These don't need to be available on the Galaxy server
+ itself.
+ -->
+ </destination><destination id="real_user_cluster" runner="drmaa"><!-- TODO: The real user options should maybe not be considered runner params. --><param id="galaxy_external_runjob_script">scripts/drmaa_external_runner.py</param>
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee lib/galaxy/jobs/__init__.py
--- a/lib/galaxy/jobs/__init__.py
+++ b/lib/galaxy/jobs/__init__.py
@@ -179,6 +179,7 @@
job_metrics.set_destination_conf_element( id, metrics_elements[ 0 ] )
job_destination = JobDestination(**dict(destination.items()))
job_destination['params'] = self.__get_params(destination)
+ job_destination['env'] = self.__get_envs(destination)
self.destinations[id] = (job_destination,)
if job_destination.tags is not None:
for tag in job_destination.tags:
@@ -350,6 +351,25 @@
rval[param.get('id')] = param.text
return rval
+ def __get_envs(self, parent):
+ """Parses any child <env> tags in to a dictionary suitable for persistence.
+
+ :param parent: Parent element in which to find child <param> tags.
+ :type parent: ``xml.etree.ElementTree.Element``
+
+ :returns: dict
+ """
+ rval = []
+ for param in parent.findall('env'):
+ rval.append( dict(
+ name=param.get('id'),
+ file=param.get('file'),
+ execute=param.get('exec'),
+ value=param.text,
+ raw=util.asbool(param.get('raw', 'false'))
+ ) )
+ return rval
+
@property
def default_job_tool_configuration(self):
"""The default JobToolConfiguration, used if a tool does not have an explicit defintion in the configuration. It consists of a reference to the default handler and default destination.
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee lib/galaxy/jobs/runners/__init__.py
--- a/lib/galaxy/jobs/runners/__init__.py
+++ b/lib/galaxy/jobs/runners/__init__.py
@@ -17,6 +17,7 @@
from galaxy.util import DATABASE_MAX_STRING_SIZE, shrink_stream_by_size
from galaxy.util import in_directory
from galaxy.jobs.runners.util.job_script import job_script
+from galaxy.jobs.runners.util.env import env_to_statement
log = logging.getLogger( __name__ )
@@ -253,10 +254,17 @@
def get_job_file(self, job_wrapper, **kwds):
job_metrics = job_wrapper.app.job_metrics
job_instrumenter = job_metrics.job_instrumenters[ job_wrapper.job_destination.id ]
+
+ env_setup_commands = kwds.get( 'env_setup_commands', [] )
+ env_setup_commands.append( job_wrapper.get_env_setup_clause() or '' )
+ destination = job_wrapper.job_destination or {}
+ envs = destination.get( "env", [] )
+ for env in envs:
+ env_setup_commands.append( env_to_statement( env ) )
options = dict(
job_instrumenter=job_instrumenter,
galaxy_lib=job_wrapper.galaxy_lib_dir,
- env_setup_commands=job_wrapper.get_env_setup_clause(),
+ env_setup_commands=env_setup_commands,
working_directory=os.path.abspath( job_wrapper.working_directory ),
command=job_wrapper.runner_command_line,
)
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee lib/galaxy/jobs/runners/lwr.py
--- a/lib/galaxy/jobs/runners/lwr.py
+++ b/lib/galaxy/jobs/runners/lwr.py
@@ -134,6 +134,7 @@
tool=job_wrapper.tool,
config_files=job_wrapper.extra_filenames,
requirements=requirements,
+ env=client.env,
rewrite_paths=rewrite_paths,
arbitrary_files=unstructured_path_rewrites,
)
@@ -222,14 +223,15 @@
for key, value in params.iteritems():
if value:
params[key] = model.User.expand_user_properties( job_wrapper.get_job().user, value )
- return self.get_client( params, job_id )
+ env = getattr( job_wrapper.job_destination, "env", [] )
+ return self.get_client( params, job_id, env )
def get_client_from_state(self, job_state):
job_destination_params = job_state.job_destination.params
job_id = job_state.job_id
return self.get_client( job_destination_params, job_id )
- def get_client( self, job_destination_params, job_id ):
+ def get_client( self, job_destination_params, job_id, env=[] ):
# Cannot use url_for outside of web thread.
#files_endpoint = url_for( controller="job_files", job_id=encoded_job_id )
@@ -243,6 +245,7 @@
get_client_kwds = dict(
job_id=str( job_id ),
files_endpoint=files_endpoint,
+ env=env
)
return self.client_manager.get_client( job_destination_params, **get_client_kwds )
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee lib/galaxy/jobs/runners/lwr_client/client.py
--- a/lib/galaxy/jobs/runners/lwr_client/client.py
+++ b/lib/galaxy/jobs/runners/lwr_client/client.py
@@ -41,6 +41,7 @@
job_directory = None
self.env = destination_params.get( "env", [] )
self.files_endpoint = destination_params.get("files_endpoint", None)
+ self.env = destination_params.get("env", [])
self.job_directory = job_directory
self.default_file_action = self.destination_params.get("default_file_action", "transfer")
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee lib/galaxy/jobs/runners/pbs.py
--- a/lib/galaxy/jobs/runners/pbs.py
+++ b/lib/galaxy/jobs/runners/pbs.py
@@ -296,7 +296,7 @@
else:
stage_commands = ''
- env_setup_commands = '%s\n%s' % (stage_commands, job_wrapper.get_env_setup_clause())
+ env_setup_commands = [ stage_commands ]
script = self.get_job_file(job_wrapper, exit_code_path=ecfile, env_setup_commands=env_setup_commands)
job_file = "%s/%s.sh" % (self.app.config.cluster_files_directory, job_wrapper.job_id)
fh = file(job_file, "w")
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee lib/galaxy/jobs/runners/util/env.py
--- /dev/null
+++ b/lib/galaxy/jobs/runners/util/env.py
@@ -0,0 +1,40 @@
+
+RAW_VALUE_BY_DEFAULT = False
+
+
+def env_to_statement(env):
+ ''' Return the abstraction description of an environment variable definition
+ into a statement for shell script.
+
+ >>> env_to_statement(dict(name='X', value='Y'))
+ 'X="Y"; export X'
+ >>> env_to_statement(dict(name='X', value='Y', raw=True))
+ 'X=Y; export X'
+ >>> env_to_statement(dict(name='X', value='"A","B","C"'))
+ 'X="\\\\"A\\\\",\\\\"B\\\\",\\\\"C\\\\""; export X'
+ >>> env_to_statement(dict(file="Y"))
+ '. "Y"'
+ >>> env_to_statement(dict(file="'RAW $FILE'", raw=True))
+ ". 'RAW $FILE'"
+ >>> # Source file takes precedence
+ >>> env_to_statement(dict(name='X', value='"A","B","C"', file="S"))
+ '. "S"'
+ >>> env_to_statement(dict(execute="module load java/1.5.1"))
+ 'module load java/1.5.1'
+ '''
+ source_file = env.get('file', None)
+ if source_file:
+ return '. %s' % __escape(source_file, env)
+ execute = env.get('execute', None)
+ if execute:
+ return execute
+ name = env['name']
+ value = __escape(env['value'], env)
+ return '%s=%s; export %s' % (name, value, name)
+
+
+def __escape(value, env):
+ raw = env.get('raw', RAW_VALUE_BY_DEFAULT)
+ if not raw:
+ value = '"' + value.replace('"', '\\"') + '"'
+ return value
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee lib/galaxy/jobs/runners/util/job_script/__init__.py
--- a/lib/galaxy/jobs/runners/util/job_script/__init__.py
+++ b/lib/galaxy/jobs/runners/util/job_script/__init__.py
@@ -16,7 +16,7 @@
OPTIONAL_TEMPLATE_PARAMS = {
'galaxy_lib': None,
'headers': '',
- 'env_setup_commands': '',
+ 'env_setup_commands': [],
'slots_statement': SLOTS_STATEMENT_CLUSTER_DEFAULT,
'instrument_pre_commands': '',
'instrument_post_commands': '',
@@ -51,13 +51,15 @@
raise Exception("Failed to create job_script, a required parameter is missing.")
job_instrumenter = kwds.get("job_instrumenter", None)
if job_instrumenter:
- del kwds[ "job_instrumenter" ]
+ del kwds["job_instrumenter"]
working_directory = kwds["working_directory"]
kwds["instrument_pre_commands"] = job_instrumenter.pre_execute_commands(working_directory) or ''
kwds["instrument_post_commands"] = job_instrumenter.post_execute_commands(working_directory) or ''
template_params = OPTIONAL_TEMPLATE_PARAMS.copy()
template_params.update(**kwds)
+ env_setup_commands_str = "\n".join(template_params["env_setup_commands"])
+ template_params["env_setup_commands"] = env_setup_commands_str
if not isinstance(template, Template):
template = Template(template)
return template.safe_substitute(template_params)
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee test/unit/jobs/test_job_configuration.py
--- a/test/unit/jobs/test_job_configuration.py
+++ b/test/unit/jobs/test_job_configuration.py
@@ -111,6 +111,20 @@
assert limits.concurrent_jobs[ "longjobs" ] == 1
assert limits.walltime_delta == datetime.timedelta( 0, 0, 0, 0, 0, 24 )
+ def test_env_parsing( self ):
+ self.__with_advanced_config()
+ env_dest = self.job_config.destinations[ "java_cluster" ][ 0 ]
+ assert len( env_dest.env ) == 4, len( env_dest.env )
+ assert env_dest.env[ 0 ][ "name" ] == "_JAVA_OPTIONS"
+ assert env_dest.env[ 0 ][ "value" ] == '-Xmx=6GB'
+
+ assert env_dest.env[ 1 ][ "name" ] == "ANOTHER_OPTION"
+ assert env_dest.env[ 1 ][ "raw" ] is True
+
+ assert env_dest.env[ 2 ][ "file" ] == "/mnt/java_cluster/environment_setup.sh"
+
+ assert env_dest.env[ 3 ][ "execute" ] == "module load javastuff/2.10"
+
# TODO: Add job metrics parsing test.
@property
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.
1
0
4 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d48a5868cd1d/
Changeset: d48a5868cd1d
User: jmchilton
Date: 2014-04-24 07:36:54
Summary: Jobs - Convert job_script's env_setup_commands to list.
Affected #: 3 files
diff -r 641f7063ce3c5dcf375aafdd9a65a2e3f7ccfa4c -r d48a5868cd1dc986b1f9ea2b0b8931407e124733 lib/galaxy/jobs/runners/__init__.py
--- a/lib/galaxy/jobs/runners/__init__.py
+++ b/lib/galaxy/jobs/runners/__init__.py
@@ -253,10 +253,13 @@
def get_job_file(self, job_wrapper, **kwds):
job_metrics = job_wrapper.app.job_metrics
job_instrumenter = job_metrics.job_instrumenters[ job_wrapper.job_destination.id ]
+
+ env_setup_commands = kwds.get( 'env_setup_commands', [] )
+ env_setup_commands.append( job_wrapper.get_env_setup_clause() or '' )
options = dict(
job_instrumenter=job_instrumenter,
galaxy_lib=job_wrapper.galaxy_lib_dir,
- env_setup_commands=job_wrapper.get_env_setup_clause(),
+ env_setup_commands=[job_wrapper.get_env_setup_clause()],
working_directory=os.path.abspath( job_wrapper.working_directory ),
command=job_wrapper.runner_command_line,
)
diff -r 641f7063ce3c5dcf375aafdd9a65a2e3f7ccfa4c -r d48a5868cd1dc986b1f9ea2b0b8931407e124733 lib/galaxy/jobs/runners/pbs.py
--- a/lib/galaxy/jobs/runners/pbs.py
+++ b/lib/galaxy/jobs/runners/pbs.py
@@ -296,7 +296,7 @@
else:
stage_commands = ''
- env_setup_commands = '%s\n%s' % (stage_commands, job_wrapper.get_env_setup_clause())
+ env_setup_commands = [ stage_commands ]
script = self.get_job_file(job_wrapper, exit_code_path=ecfile, env_setup_commands=env_setup_commands)
job_file = "%s/%s.sh" % (self.app.config.cluster_files_directory, job_wrapper.job_id)
fh = file(job_file, "w")
diff -r 641f7063ce3c5dcf375aafdd9a65a2e3f7ccfa4c -r d48a5868cd1dc986b1f9ea2b0b8931407e124733 lib/galaxy/jobs/runners/util/job_script/__init__.py
--- a/lib/galaxy/jobs/runners/util/job_script/__init__.py
+++ b/lib/galaxy/jobs/runners/util/job_script/__init__.py
@@ -16,7 +16,7 @@
OPTIONAL_TEMPLATE_PARAMS = {
'galaxy_lib': None,
'headers': '',
- 'env_setup_commands': '',
+ 'env_setup_commands': [],
'slots_statement': SLOTS_STATEMENT_CLUSTER_DEFAULT,
'instrument_pre_commands': '',
'instrument_post_commands': '',
@@ -58,6 +58,8 @@
template_params = OPTIONAL_TEMPLATE_PARAMS.copy()
template_params.update(**kwds)
+ env_setup_commands_str = "\n".join(template_params["env_setup_commands"])
+ template_params["env_setup_commands"] = env_setup_commands_str
if not isinstance(template, Template):
template = Template(template)
return template.safe_substitute(template_params)
https://bitbucket.org/galaxy/galaxy-central/commits/63d6d9a9af79/
Changeset: 63d6d9a9af79
User: jmchilton
Date: 2014-04-24 07:36:54
Summary: Jobs - Allow destinations to declare arbitrary envirnoment variables.
See job_conf.xml.sample_advanced for examples.
Affected #: 8 files
diff -r d48a5868cd1dc986b1f9ea2b0b8931407e124733 -r 63d6d9a9af796d66f44e5105d306e3c46ff09549 job_conf.xml.sample_advanced
--- a/job_conf.xml.sample_advanced
+++ b/job_conf.xml.sample_advanced
@@ -74,6 +74,13 @@
<param id="Resource_List">walltime=72:00:00</param></destination><destination id="remote_cluster" runner="drmaa" tags="longjobs"/>
+ <destination id="java_cluster" runner="drmaa">
+ <!-- set arbitrary environment variables at runtime - like metrics
+ doesn't yet work with local or CLI runners. But should work with
+ DRMAA/SLURM, PBS, Condor, and LWR. -->
+ <env id="_JAVA_OPTIONS">-Xmx=6GB</env>
+ <env id="ANOTHER_OPTION" raw="true">'5'</env><!-- raw disables auto quoting -->
+ </destination><destination id="real_user_cluster" runner="drmaa"><!-- TODO: The real user options should maybe not be considered runner params. --><param id="galaxy_external_runjob_script">scripts/drmaa_external_runner.py</param>
diff -r d48a5868cd1dc986b1f9ea2b0b8931407e124733 -r 63d6d9a9af796d66f44e5105d306e3c46ff09549 lib/galaxy/jobs/__init__.py
--- a/lib/galaxy/jobs/__init__.py
+++ b/lib/galaxy/jobs/__init__.py
@@ -179,6 +179,7 @@
job_metrics.set_destination_conf_element( id, metrics_elements[ 0 ] )
job_destination = JobDestination(**dict(destination.items()))
job_destination['params'] = self.__get_params(destination)
+ job_destination['env'] = self.__get_envs(destination)
self.destinations[id] = (job_destination,)
if job_destination.tags is not None:
for tag in job_destination.tags:
@@ -350,6 +351,23 @@
rval[param.get('id')] = param.text
return rval
+ def __get_envs(self, parent):
+ """Parses any child <env> tags in to a dictionary suitable for persistence.
+
+ :param parent: Parent element in which to find child <param> tags.
+ :type parent: ``xml.etree.ElementTree.Element``
+
+ :returns: dict
+ """
+ rval = []
+ for param in parent.findall('env'):
+ rval.append( dict(
+ name=param.get('id'),
+ value=param.text,
+ raw=util.asbool(param.get('raw', 'false'))
+ ) )
+ return rval
+
@property
def default_job_tool_configuration(self):
"""The default JobToolConfiguration, used if a tool does not have an explicit defintion in the configuration. It consists of a reference to the default handler and default destination.
diff -r d48a5868cd1dc986b1f9ea2b0b8931407e124733 -r 63d6d9a9af796d66f44e5105d306e3c46ff09549 lib/galaxy/jobs/runners/__init__.py
--- a/lib/galaxy/jobs/runners/__init__.py
+++ b/lib/galaxy/jobs/runners/__init__.py
@@ -17,6 +17,7 @@
from galaxy.util import DATABASE_MAX_STRING_SIZE, shrink_stream_by_size
from galaxy.util import in_directory
from galaxy.jobs.runners.util.job_script import job_script
+from galaxy.jobs.runners.util.env import env_to_statement
log = logging.getLogger( __name__ )
@@ -256,10 +257,14 @@
env_setup_commands = kwds.get( 'env_setup_commands', [] )
env_setup_commands.append( job_wrapper.get_env_setup_clause() or '' )
+ destination = job_wrapper.job_destination or {}
+ envs = destination.get( "env", [] )
+ for env in envs:
+ env_setup_commands.append( env_to_statement( env ) )
options = dict(
job_instrumenter=job_instrumenter,
galaxy_lib=job_wrapper.galaxy_lib_dir,
- env_setup_commands=[job_wrapper.get_env_setup_clause()],
+ env_setup_commands=env_setup_commands,
working_directory=os.path.abspath( job_wrapper.working_directory ),
command=job_wrapper.runner_command_line,
)
diff -r d48a5868cd1dc986b1f9ea2b0b8931407e124733 -r 63d6d9a9af796d66f44e5105d306e3c46ff09549 lib/galaxy/jobs/runners/lwr.py
--- a/lib/galaxy/jobs/runners/lwr.py
+++ b/lib/galaxy/jobs/runners/lwr.py
@@ -134,6 +134,7 @@
tool=job_wrapper.tool,
config_files=job_wrapper.extra_filenames,
requirements=requirements,
+ env=client.env,
rewrite_paths=rewrite_paths,
arbitrary_files=unstructured_path_rewrites,
)
@@ -222,14 +223,15 @@
for key, value in params.iteritems():
if value:
params[key] = model.User.expand_user_properties( job_wrapper.get_job().user, value )
- return self.get_client( params, job_id )
+ env = getattr( job_wrapper.job_destination, "env", [] )
+ return self.get_client( params, job_id, env )
def get_client_from_state(self, job_state):
job_destination_params = job_state.job_destination.params
job_id = job_state.job_id
return self.get_client( job_destination_params, job_id )
- def get_client( self, job_destination_params, job_id ):
+ def get_client( self, job_destination_params, job_id, env=[] ):
# Cannot use url_for outside of web thread.
#files_endpoint = url_for( controller="job_files", job_id=encoded_job_id )
@@ -243,6 +245,7 @@
get_client_kwds = dict(
job_id=str( job_id ),
files_endpoint=files_endpoint,
+ env=env
)
return self.client_manager.get_client( job_destination_params, **get_client_kwds )
diff -r d48a5868cd1dc986b1f9ea2b0b8931407e124733 -r 63d6d9a9af796d66f44e5105d306e3c46ff09549 lib/galaxy/jobs/runners/lwr_client/client.py
--- a/lib/galaxy/jobs/runners/lwr_client/client.py
+++ b/lib/galaxy/jobs/runners/lwr_client/client.py
@@ -41,6 +41,7 @@
job_directory = None
self.env = destination_params.get( "env", [] )
self.files_endpoint = destination_params.get("files_endpoint", None)
+ self.env = destination_params.get("env", [])
self.job_directory = job_directory
self.default_file_action = self.destination_params.get("default_file_action", "transfer")
diff -r d48a5868cd1dc986b1f9ea2b0b8931407e124733 -r 63d6d9a9af796d66f44e5105d306e3c46ff09549 lib/galaxy/jobs/runners/util/env.py
--- /dev/null
+++ b/lib/galaxy/jobs/runners/util/env.py
@@ -0,0 +1,21 @@
+
+RAW_VALUE_BY_DEFAULT = False
+
+
+def env_to_statement(env):
+ ''' Return the abstraction description of an environment variable definition
+ into a statement for shell script.
+
+ >>> env_to_statement(dict(name='X', value='Y'))
+ 'X="Y"; export X'
+ >>> env_to_statement(dict(name='X', value='Y', raw=True))
+ 'X=Y; export X'
+ >>> env_to_statement(dict(name='X', value='"A","B","C"'))
+ 'X="\\\\"A\\\\",\\\\"B\\\\",\\\\"C\\\\""; export X'
+ '''
+ name = env['name']
+ value = env['value']
+ raw = env.get('raw', RAW_VALUE_BY_DEFAULT)
+ if not raw:
+ value = '"' + value.replace('"', '\\"') + '"'
+ return '%s=%s; export %s' % (name, value, name)
diff -r d48a5868cd1dc986b1f9ea2b0b8931407e124733 -r 63d6d9a9af796d66f44e5105d306e3c46ff09549 lib/galaxy/jobs/runners/util/job_script/__init__.py
--- a/lib/galaxy/jobs/runners/util/job_script/__init__.py
+++ b/lib/galaxy/jobs/runners/util/job_script/__init__.py
@@ -51,7 +51,7 @@
raise Exception("Failed to create job_script, a required parameter is missing.")
job_instrumenter = kwds.get("job_instrumenter", None)
if job_instrumenter:
- del kwds[ "job_instrumenter" ]
+ del kwds["job_instrumenter"]
working_directory = kwds["working_directory"]
kwds["instrument_pre_commands"] = job_instrumenter.pre_execute_commands(working_directory) or ''
kwds["instrument_post_commands"] = job_instrumenter.post_execute_commands(working_directory) or ''
diff -r d48a5868cd1dc986b1f9ea2b0b8931407e124733 -r 63d6d9a9af796d66f44e5105d306e3c46ff09549 test/unit/jobs/test_job_configuration.py
--- a/test/unit/jobs/test_job_configuration.py
+++ b/test/unit/jobs/test_job_configuration.py
@@ -111,6 +111,16 @@
assert limits.concurrent_jobs[ "longjobs" ] == 1
assert limits.walltime_delta == datetime.timedelta( 0, 0, 0, 0, 0, 24 )
+ def test_env_parsing( self ):
+ self.__with_advanced_config()
+ env_dest = self.job_config.destinations[ "java_cluster" ][ 0 ]
+ assert len( env_dest.env ) == 2, len( env_dest.env )
+ assert env_dest.env[ 0 ][ "name" ] == "_JAVA_OPTIONS"
+ assert env_dest.env[ 0 ][ "value" ] == '-Xmx=6GB'
+
+ assert env_dest.env[ 1 ][ "name" ] == "ANOTHER_OPTION"
+ assert env_dest.env[ 1 ][ "raw" ] is True
+
# TODO: Add job metrics parsing test.
@property
https://bitbucket.org/galaxy/galaxy-central/commits/d72967b2b7b2/
Changeset: d72967b2b7b2
User: jmchilton
Date: 2014-04-25 16:36:40
Summary: Extend destination specific env options.
Add support sourcing files and executing arbitrary shell commands (see documented examples).
Affected #: 4 files
diff -r 63d6d9a9af796d66f44e5105d306e3c46ff09549 -r d72967b2b7b25ba02584880526c7b28cab6970e7 job_conf.xml.sample_advanced
--- a/job_conf.xml.sample_advanced
+++ b/job_conf.xml.sample_advanced
@@ -77,9 +77,19 @@
<destination id="java_cluster" runner="drmaa"><!-- set arbitrary environment variables at runtime - like metrics
doesn't yet work with local or CLI runners. But should work with
- DRMAA/SLURM, PBS, Condor, and LWR. -->
+ DRMAA/SLURM, PBS, Condor, and LWR. General dependencies for tools
+ should be configured via tool_depednency_dir and package options
+ and these options should be reserved for defining cluster specific
+ options.
+ --><env id="_JAVA_OPTIONS">-Xmx=6GB</env><env id="ANOTHER_OPTION" raw="true">'5'</env><!-- raw disables auto quoting -->
+ <env file="/mnt/java_cluster/environment_setup.sh" /><!-- will be sourced -->
+ <env exec="module load javastuff/2.10" /><!-- will be sourced -->
+ <!-- files to source and exec statements will be handled on remote
+ clusters. These don't need to be available on the Galaxy server
+ itself.
+ --></destination><destination id="real_user_cluster" runner="drmaa"><!-- TODO: The real user options should maybe not be considered runner params. -->
diff -r 63d6d9a9af796d66f44e5105d306e3c46ff09549 -r d72967b2b7b25ba02584880526c7b28cab6970e7 lib/galaxy/jobs/__init__.py
--- a/lib/galaxy/jobs/__init__.py
+++ b/lib/galaxy/jobs/__init__.py
@@ -363,6 +363,8 @@
for param in parent.findall('env'):
rval.append( dict(
name=param.get('id'),
+ file=param.get('file'),
+ execute=param.get('exec'),
value=param.text,
raw=util.asbool(param.get('raw', 'false'))
) )
diff -r 63d6d9a9af796d66f44e5105d306e3c46ff09549 -r d72967b2b7b25ba02584880526c7b28cab6970e7 lib/galaxy/jobs/runners/util/env.py
--- a/lib/galaxy/jobs/runners/util/env.py
+++ b/lib/galaxy/jobs/runners/util/env.py
@@ -12,10 +12,29 @@
'X=Y; export X'
>>> env_to_statement(dict(name='X', value='"A","B","C"'))
'X="\\\\"A\\\\",\\\\"B\\\\",\\\\"C\\\\""; export X'
+ >>> env_to_statement(dict(file="Y"))
+ '. "Y"'
+ >>> env_to_statement(dict(file="'RAW $FILE'", raw=True))
+ ". 'RAW $FILE'"
+ >>> # Source file takes precedence
+ >>> env_to_statement(dict(name='X', value='"A","B","C"', file="S"))
+ '. "S"'
+ >>> env_to_statement(dict(execute="module load java/1.5.1"))
+ 'module load java/1.5.1'
'''
+ source_file = env.get('file', None)
+ if source_file:
+ return '. %s' % __escape(source_file, env)
+ execute = env.get('execute', None)
+ if execute:
+ return execute
name = env['name']
- value = env['value']
+ value = __escape(env['value'], env)
+ return '%s=%s; export %s' % (name, value, name)
+
+
+def __escape(value, env):
raw = env.get('raw', RAW_VALUE_BY_DEFAULT)
if not raw:
value = '"' + value.replace('"', '\\"') + '"'
- return '%s=%s; export %s' % (name, value, name)
+ return value
diff -r 63d6d9a9af796d66f44e5105d306e3c46ff09549 -r d72967b2b7b25ba02584880526c7b28cab6970e7 test/unit/jobs/test_job_configuration.py
--- a/test/unit/jobs/test_job_configuration.py
+++ b/test/unit/jobs/test_job_configuration.py
@@ -114,13 +114,17 @@
def test_env_parsing( self ):
self.__with_advanced_config()
env_dest = self.job_config.destinations[ "java_cluster" ][ 0 ]
- assert len( env_dest.env ) == 2, len( env_dest.env )
+ assert len( env_dest.env ) == 4, len( env_dest.env )
assert env_dest.env[ 0 ][ "name" ] == "_JAVA_OPTIONS"
assert env_dest.env[ 0 ][ "value" ] == '-Xmx=6GB'
assert env_dest.env[ 1 ][ "name" ] == "ANOTHER_OPTION"
assert env_dest.env[ 1 ][ "raw" ] is True
+ assert env_dest.env[ 2 ][ "file" ] == "/mnt/java_cluster/environment_setup.sh"
+
+ assert env_dest.env[ 3 ][ "execute" ] == "module load javastuff/2.10"
+
# TODO: Add job metrics parsing test.
@property
https://bitbucket.org/galaxy/galaxy-central/commits/4d554f1875eb/
Changeset: 4d554f1875eb
User: jmchilton
Date: 2014-04-28 16:53:07
Summary: Merged in jmchilton/galaxy-central-fork-1 (pull request #378)
Allow specification of environment variables for job destinations
Affected #: 9 files
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee job_conf.xml.sample_advanced
--- a/job_conf.xml.sample_advanced
+++ b/job_conf.xml.sample_advanced
@@ -74,6 +74,23 @@
<param id="Resource_List">walltime=72:00:00</param></destination><destination id="remote_cluster" runner="drmaa" tags="longjobs"/>
+ <destination id="java_cluster" runner="drmaa">
+ <!-- set arbitrary environment variables at runtime - like metrics
+ doesn't yet work with local or CLI runners. But should work with
+ DRMAA/SLURM, PBS, Condor, and LWR. General dependencies for tools
+ should be configured via tool_depednency_dir and package options
+ and these options should be reserved for defining cluster specific
+ options.
+ -->
+ <env id="_JAVA_OPTIONS">-Xmx=6GB</env>
+ <env id="ANOTHER_OPTION" raw="true">'5'</env><!-- raw disables auto quoting -->
+ <env file="/mnt/java_cluster/environment_setup.sh" /><!-- will be sourced -->
+ <env exec="module load javastuff/2.10" /><!-- will be sourced -->
+ <!-- files to source and exec statements will be handled on remote
+ clusters. These don't need to be available on the Galaxy server
+ itself.
+ -->
+ </destination><destination id="real_user_cluster" runner="drmaa"><!-- TODO: The real user options should maybe not be considered runner params. --><param id="galaxy_external_runjob_script">scripts/drmaa_external_runner.py</param>
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee lib/galaxy/jobs/__init__.py
--- a/lib/galaxy/jobs/__init__.py
+++ b/lib/galaxy/jobs/__init__.py
@@ -179,6 +179,7 @@
job_metrics.set_destination_conf_element( id, metrics_elements[ 0 ] )
job_destination = JobDestination(**dict(destination.items()))
job_destination['params'] = self.__get_params(destination)
+ job_destination['env'] = self.__get_envs(destination)
self.destinations[id] = (job_destination,)
if job_destination.tags is not None:
for tag in job_destination.tags:
@@ -350,6 +351,25 @@
rval[param.get('id')] = param.text
return rval
+ def __get_envs(self, parent):
+ """Parses any child <env> tags in to a dictionary suitable for persistence.
+
+ :param parent: Parent element in which to find child <param> tags.
+ :type parent: ``xml.etree.ElementTree.Element``
+
+ :returns: dict
+ """
+ rval = []
+ for param in parent.findall('env'):
+ rval.append( dict(
+ name=param.get('id'),
+ file=param.get('file'),
+ execute=param.get('exec'),
+ value=param.text,
+ raw=util.asbool(param.get('raw', 'false'))
+ ) )
+ return rval
+
@property
def default_job_tool_configuration(self):
"""The default JobToolConfiguration, used if a tool does not have an explicit defintion in the configuration. It consists of a reference to the default handler and default destination.
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee lib/galaxy/jobs/runners/__init__.py
--- a/lib/galaxy/jobs/runners/__init__.py
+++ b/lib/galaxy/jobs/runners/__init__.py
@@ -17,6 +17,7 @@
from galaxy.util import DATABASE_MAX_STRING_SIZE, shrink_stream_by_size
from galaxy.util import in_directory
from galaxy.jobs.runners.util.job_script import job_script
+from galaxy.jobs.runners.util.env import env_to_statement
log = logging.getLogger( __name__ )
@@ -253,10 +254,17 @@
def get_job_file(self, job_wrapper, **kwds):
job_metrics = job_wrapper.app.job_metrics
job_instrumenter = job_metrics.job_instrumenters[ job_wrapper.job_destination.id ]
+
+ env_setup_commands = kwds.get( 'env_setup_commands', [] )
+ env_setup_commands.append( job_wrapper.get_env_setup_clause() or '' )
+ destination = job_wrapper.job_destination or {}
+ envs = destination.get( "env", [] )
+ for env in envs:
+ env_setup_commands.append( env_to_statement( env ) )
options = dict(
job_instrumenter=job_instrumenter,
galaxy_lib=job_wrapper.galaxy_lib_dir,
- env_setup_commands=job_wrapper.get_env_setup_clause(),
+ env_setup_commands=env_setup_commands,
working_directory=os.path.abspath( job_wrapper.working_directory ),
command=job_wrapper.runner_command_line,
)
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee lib/galaxy/jobs/runners/lwr.py
--- a/lib/galaxy/jobs/runners/lwr.py
+++ b/lib/galaxy/jobs/runners/lwr.py
@@ -134,6 +134,7 @@
tool=job_wrapper.tool,
config_files=job_wrapper.extra_filenames,
requirements=requirements,
+ env=client.env,
rewrite_paths=rewrite_paths,
arbitrary_files=unstructured_path_rewrites,
)
@@ -222,14 +223,15 @@
for key, value in params.iteritems():
if value:
params[key] = model.User.expand_user_properties( job_wrapper.get_job().user, value )
- return self.get_client( params, job_id )
+ env = getattr( job_wrapper.job_destination, "env", [] )
+ return self.get_client( params, job_id, env )
def get_client_from_state(self, job_state):
job_destination_params = job_state.job_destination.params
job_id = job_state.job_id
return self.get_client( job_destination_params, job_id )
- def get_client( self, job_destination_params, job_id ):
+ def get_client( self, job_destination_params, job_id, env=[] ):
# Cannot use url_for outside of web thread.
#files_endpoint = url_for( controller="job_files", job_id=encoded_job_id )
@@ -243,6 +245,7 @@
get_client_kwds = dict(
job_id=str( job_id ),
files_endpoint=files_endpoint,
+ env=env
)
return self.client_manager.get_client( job_destination_params, **get_client_kwds )
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee lib/galaxy/jobs/runners/lwr_client/client.py
--- a/lib/galaxy/jobs/runners/lwr_client/client.py
+++ b/lib/galaxy/jobs/runners/lwr_client/client.py
@@ -41,6 +41,7 @@
job_directory = None
self.env = destination_params.get( "env", [] )
self.files_endpoint = destination_params.get("files_endpoint", None)
+ self.env = destination_params.get("env", [])
self.job_directory = job_directory
self.default_file_action = self.destination_params.get("default_file_action", "transfer")
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee lib/galaxy/jobs/runners/pbs.py
--- a/lib/galaxy/jobs/runners/pbs.py
+++ b/lib/galaxy/jobs/runners/pbs.py
@@ -296,7 +296,7 @@
else:
stage_commands = ''
- env_setup_commands = '%s\n%s' % (stage_commands, job_wrapper.get_env_setup_clause())
+ env_setup_commands = [ stage_commands ]
script = self.get_job_file(job_wrapper, exit_code_path=ecfile, env_setup_commands=env_setup_commands)
job_file = "%s/%s.sh" % (self.app.config.cluster_files_directory, job_wrapper.job_id)
fh = file(job_file, "w")
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee lib/galaxy/jobs/runners/util/env.py
--- /dev/null
+++ b/lib/galaxy/jobs/runners/util/env.py
@@ -0,0 +1,40 @@
+
+RAW_VALUE_BY_DEFAULT = False
+
+
+def env_to_statement(env):
+ ''' Return the abstraction description of an environment variable definition
+ into a statement for shell script.
+
+ >>> env_to_statement(dict(name='X', value='Y'))
+ 'X="Y"; export X'
+ >>> env_to_statement(dict(name='X', value='Y', raw=True))
+ 'X=Y; export X'
+ >>> env_to_statement(dict(name='X', value='"A","B","C"'))
+ 'X="\\\\"A\\\\",\\\\"B\\\\",\\\\"C\\\\""; export X'
+ >>> env_to_statement(dict(file="Y"))
+ '. "Y"'
+ >>> env_to_statement(dict(file="'RAW $FILE'", raw=True))
+ ". 'RAW $FILE'"
+ >>> # Source file takes precedence
+ >>> env_to_statement(dict(name='X', value='"A","B","C"', file="S"))
+ '. "S"'
+ >>> env_to_statement(dict(execute="module load java/1.5.1"))
+ 'module load java/1.5.1'
+ '''
+ source_file = env.get('file', None)
+ if source_file:
+ return '. %s' % __escape(source_file, env)
+ execute = env.get('execute', None)
+ if execute:
+ return execute
+ name = env['name']
+ value = __escape(env['value'], env)
+ return '%s=%s; export %s' % (name, value, name)
+
+
+def __escape(value, env):
+ raw = env.get('raw', RAW_VALUE_BY_DEFAULT)
+ if not raw:
+ value = '"' + value.replace('"', '\\"') + '"'
+ return value
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee lib/galaxy/jobs/runners/util/job_script/__init__.py
--- a/lib/galaxy/jobs/runners/util/job_script/__init__.py
+++ b/lib/galaxy/jobs/runners/util/job_script/__init__.py
@@ -16,7 +16,7 @@
OPTIONAL_TEMPLATE_PARAMS = {
'galaxy_lib': None,
'headers': '',
- 'env_setup_commands': '',
+ 'env_setup_commands': [],
'slots_statement': SLOTS_STATEMENT_CLUSTER_DEFAULT,
'instrument_pre_commands': '',
'instrument_post_commands': '',
@@ -51,13 +51,15 @@
raise Exception("Failed to create job_script, a required parameter is missing.")
job_instrumenter = kwds.get("job_instrumenter", None)
if job_instrumenter:
- del kwds[ "job_instrumenter" ]
+ del kwds["job_instrumenter"]
working_directory = kwds["working_directory"]
kwds["instrument_pre_commands"] = job_instrumenter.pre_execute_commands(working_directory) or ''
kwds["instrument_post_commands"] = job_instrumenter.post_execute_commands(working_directory) or ''
template_params = OPTIONAL_TEMPLATE_PARAMS.copy()
template_params.update(**kwds)
+ env_setup_commands_str = "\n".join(template_params["env_setup_commands"])
+ template_params["env_setup_commands"] = env_setup_commands_str
if not isinstance(template, Template):
template = Template(template)
return template.safe_substitute(template_params)
diff -r b0067c6e06274e80157496e034c9c7d0a083ffb6 -r 4d554f1875eb9e1dfc5fc156dbae86c79c2efbee test/unit/jobs/test_job_configuration.py
--- a/test/unit/jobs/test_job_configuration.py
+++ b/test/unit/jobs/test_job_configuration.py
@@ -111,6 +111,20 @@
assert limits.concurrent_jobs[ "longjobs" ] == 1
assert limits.walltime_delta == datetime.timedelta( 0, 0, 0, 0, 0, 24 )
+ def test_env_parsing( self ):
+ self.__with_advanced_config()
+ env_dest = self.job_config.destinations[ "java_cluster" ][ 0 ]
+ assert len( env_dest.env ) == 4, len( env_dest.env )
+ assert env_dest.env[ 0 ][ "name" ] == "_JAVA_OPTIONS"
+ assert env_dest.env[ 0 ][ "value" ] == '-Xmx=6GB'
+
+ assert env_dest.env[ 1 ][ "name" ] == "ANOTHER_OPTION"
+ assert env_dest.env[ 1 ][ "raw" ] is True
+
+ assert env_dest.env[ 2 ][ "file" ] == "/mnt/java_cluster/environment_setup.sh"
+
+ assert env_dest.env[ 3 ][ "execute" ] == "module load javastuff/2.10"
+
# TODO: Add job metrics parsing test.
@property
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.
1
0
commit/galaxy-central: greg: Reorder eggs.require for some fabric files.
by commits-noreply@bitbucket.org 28 Apr '14
by commits-noreply@bitbucket.org 28 Apr '14
28 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b0067c6e0627/
Changeset: b0067c6e0627
User: greg
Date: 2014-04-28 16:37:44
Summary: Reorder eggs.require for some fabric files.
Affected #: 3 files
diff -r 9faa9a2ab1e544b8ba705b3e320d2166d7a6ee88 -r b0067c6e06274e80157496e034c9c7d0a083ffb6 lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
@@ -3,9 +3,9 @@
from galaxy import eggs
+eggs.require( 'paramiko' )
+eggs.require( 'ssh' )
eggs.require( 'Fabric' )
-eggs.require( 'ssh' )
-eggs.require( 'paramiko' )
from fabric.api import env
from fabric.api import lcd
diff -r 9faa9a2ab1e544b8ba705b3e320d2166d7a6ee88 -r b0067c6e06274e80157496e034c9c7d0a083ffb6 lib/tool_shed/galaxy_install/tool_dependencies/recipe/recipe_manager.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/recipe/recipe_manager.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/recipe/recipe_manager.py
@@ -12,9 +12,10 @@
# TODO: eliminate the use of fabric here.
from galaxy import eggs
+
+eggs.require( 'paramiko' )
+eggs.require( 'ssh' )
eggs.require( 'Fabric' )
-eggs.require( 'ssh' )
-eggs.require( 'paramiko' )
from fabric.operations import _AttributeString
from fabric import state
diff -r 9faa9a2ab1e544b8ba705b3e320d2166d7a6ee88 -r b0067c6e06274e80157496e034c9c7d0a083ffb6 lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
@@ -13,9 +13,10 @@
# TODO: eliminate the use of fabric here.
from galaxy import eggs
+
+eggs.require( 'paramiko' )
+eggs.require( 'ssh' )
eggs.require( 'Fabric' )
-eggs.require( 'ssh' )
-eggs.require( 'paramiko' )
from fabric.api import settings
from fabric.api import lcd
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.
1
0
commit/galaxy-central: greg: Fix for the install_repository_revision function in the Galaxy API: a more correct and informative message is now displayed if any of the request parameters is invalid.
by commits-noreply@bitbucket.org 28 Apr '14
by commits-noreply@bitbucket.org 28 Apr '14
28 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9faa9a2ab1e5/
Changeset: 9faa9a2ab1e5
User: greg
Date: 2014-04-28 15:45:01
Summary: Fix for the install_repository_revision function in the Galaxy API: a more correct and informative message is now displayed if any of the request parameters is invalid.
Affected #: 1 file
diff -r dc9fb7fba975f6169d9ee8eb257bf477d7d4274c -r 9faa9a2ab1e544b8ba705b3e320d2166d7a6ee88 lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
--- a/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
+++ b/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
@@ -230,8 +230,18 @@
( str( tool_shed_url ), str( changeset_revision ), str( name ), str( owner ), str( e ) )
log.debug( message )
return dict( status='error', error=message )
+ # Make sure the tool shed returned everything we need for installing the repository.
+ if not repository_revision_dict or not repo_info_dict:
+ key = kwd.get( 'key', None )
+ invalid_parameter_message = "No information is available for the requested repository revision.\n"
+ invalid_parameter_message += "One or more of the following parameter values is likely invalid:\n"
+ invalid_parameter_message += "key: %s\n" % str( key )
+ invalid_parameter_message += "tool_shed_url: %s\n" % str( tool_shed_url )
+ invalid_parameter_message += "name: %s\n" % str( name )
+ invalid_parameter_message += "owner: %s\n" % str( owner )
+ invalid_parameter_message += "changeset_revision: %s\n" % str( changeset_revision )
+ raise HTTPBadRequest( detail=invalid_parameter_message )
repo_info_dicts = [ repo_info_dict ]
- # Make sure the tool shed returned everything we need for installing the repository.
try:
has_repository_dependencies = repository_revision_dict[ 'has_repository_dependencies' ]
except:
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.
1
0
28 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/dc9fb7fba975/
Changeset: dc9fb7fba975
User: greg
Date: 2014-04-28 13:03:37
Summary: A bit of rework for recently introduced assert action types for tool dependency package install recipes: 1) assert_file_exists - true for both files and symlinks, but false if path is a directory 2) assert_file_executable - true for both files and symlinks but false if path is a directory 3) assert_directory_exists - true for both directories and symlinks, but false if path is a file 4) assert_directory_executable - true for both directories and symlinks, but false if path is a file.
Affected #: 3 files
diff -r 56dd83576ce67763863b61ad85104f8d14d978e0 -r dc9fb7fba975f6169d9ee8eb257bf477d7d4274c lib/tool_shed/galaxy_install/tool_dependencies/recipe/recipe_manager.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/recipe/recipe_manager.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/recipe/recipe_manager.py
@@ -414,7 +414,8 @@
return tool_dependency, filtered_actions, dir
def load_step_handlers( self ):
- step_handlers_by_type = dict( assert_directory_exists=step_handler.AssertDirectoryExists(),
+ step_handlers_by_type = dict( assert_directory_executable=step_handler.AssertDirectoryExecutable(),
+ assert_directory_exists=step_handler.AssertDirectoryExists(),
assert_file_executable=step_handler.AssertFileExecutable(),
assert_file_exists=step_handler.AssertFileExists(),
autoconf=step_handler.Autoconf(),
diff -r 56dd83576ce67763863b61ad85104f8d14d978e0 -r dc9fb7fba975f6169d9ee8eb257bf477d7d4274c lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
@@ -36,6 +36,39 @@
raise "Unimplemented Method"
+class AssertDirectoryExecutable( RecipeStep ):
+
+ def __init__( self ):
+ self.type = 'assert_directory_executable'
+
+ def execute_step( self, app, tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder,
+ install_environment, work_dir, install_dir, current_dir=None, initial_download=False ):
+ """
+ Make sure a symbolic link or directory on disk exists and is executable, but is not a file.
+ Since this class is not used in the initial download stage, no recipe step filtering is
+ performed here, and None values are always returned for filtered_actions and dir.
+ """
+ if os.path.isabs( action_dict[ 'full_path' ] ):
+ full_path = action_dict[ 'full_path' ]
+ else:
+ full_path = os.path.join( current_dir, action_dict[ 'full_path' ] )
+ if not td_common_util.assert_directory_executable( full_path=full_path ):
+ status = app.install_model.ToolDependency.installation_status.ERROR
+ error_message = 'The path %s is not a directory or is not executable by the owner.' % str( full_path )
+ tool_dependency = tool_dependency_util.set_tool_dependency_attributes( app,
+ tool_dependency,
+ status=status,
+ error_message=error_message,
+ remove_from_disk=False )
+ return tool_dependency, None, None
+
+ def prepare_step( self, app, tool_dependency, action_elem, action_dict, install_dir, is_binary_download ):
+ # <action type="assert_executable">$INSTALL_DIR/mira/my_file</action>
+ if action_elem.text:
+ action_dict[ 'full_path' ] = td_common_util.evaluate_template( action_elem.text, install_dir )
+ return action_dict
+
+
class AssertDirectoryExists( RecipeStep ):
def __init__( self ):
@@ -44,9 +77,9 @@
def execute_step( self, app, tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder,
install_environment, work_dir, install_dir, current_dir=None, initial_download=False ):
"""
- Make sure a directory on disk exists. Since this class is not used in the initial download stage,
- no recipe step filtering is performed here, and None values are always returned for filtered_actions
- and dir.
+ Make sure a a symbolic link or directory on disk exists, but is not a file. Since this
+ class is not used in the initial download stage, no recipe step filtering is performed
+ here, and None values are always returned for filtered_actions and dir.
"""
if os.path.isabs( action_dict[ 'full_path' ] ):
full_path = action_dict[ 'full_path' ]
@@ -54,7 +87,7 @@
full_path = os.path.join( current_dir, action_dict[ 'full_path' ] )
if not td_common_util.assert_directory_exists( full_path=full_path ):
status = app.install_model.ToolDependency.installation_status.ERROR
- error_message = 'The required directory %s does not exist.' % str( full_path )
+ error_message = 'The path %s is not a directory or does not exist.' % str( full_path )
tool_dependency = tool_dependency_util.set_tool_dependency_attributes( app,
tool_dependency,
status=status,
@@ -77,9 +110,9 @@
def execute_step( self, app, tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder,
install_environment, work_dir, install_dir, current_dir=None, initial_download=False ):
"""
- Make sure a file on disk exists and is executable. Since this class is not used in the initial
- download stage, no recipe step filtering is performed here, and None values are always returned
- for filtered_actions and dir.
+ Make sure a symbolic link or file on disk exists and is executable, but is not a directory.
+ Since this class is not used in the initial download stage, no recipe step filtering is
+ performed here, and None values are always returned for filtered_actions and dir.
"""
if os.path.isabs( action_dict[ 'full_path' ] ):
full_path = action_dict[ 'full_path' ]
@@ -87,7 +120,7 @@
full_path = os.path.join( current_dir, action_dict[ 'full_path' ] )
if not td_common_util.assert_file_executable( full_path=full_path ):
status = app.install_model.ToolDependency.installation_status.ERROR
- error_message = 'The file %s is not executable by the owner.' % str( full_path )
+ error_message = 'The path %s is not a file or is not executable by the owner.' % str( full_path )
tool_dependency = tool_dependency_util.set_tool_dependency_attributes( app,
tool_dependency,
status=status,
@@ -110,9 +143,9 @@
def execute_step( self, app, tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder,
install_environment, work_dir, install_dir, current_dir=None, initial_download=False ):
"""
- Make sure a file on disk exists. Since this class is not used in the initial download stage,
- no recipe step filtering is performed here, and None values are always returned for
- filtered_actions and dir.
+ Make sure a symbolic link or file on disk exists, but is not a directory. Since this
+ class is not used in the initial download stage, no recipe step filtering is performed
+ here, and None values are always returned for filtered_actions and dir.
"""
if os.path.isabs( action_dict[ 'full_path' ] ):
full_path = action_dict[ 'full_path' ]
@@ -120,7 +153,7 @@
full_path = os.path.join( current_dir, action_dict[ 'full_path' ] )
if not td_common_util.assert_file_exists( full_path=full_path ):
status = app.install_model.ToolDependency.installation_status.ERROR
- error_message = 'The required file %s does not exist.' % str( full_path )
+ error_message = 'The path %s is not a file or does not exist.' % str( full_path )
tool_dependency = tool_dependency_util.set_tool_dependency_attributes( app,
tool_dependency,
status=status,
diff -r 56dd83576ce67763863b61ad85104f8d14d978e0 -r dc9fb7fba975f6169d9ee8eb257bf477d7d4274c lib/tool_shed/galaxy_install/tool_dependencies/td_common_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/td_common_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/td_common_util.py
@@ -111,31 +111,63 @@
def open_zip( self, filepath, mode ):
return zipfile.ZipFile( filepath, mode )
-def assert_directory_exists( full_path ):
- """Return True if a directory exists and is not a symbolic link."""
- if os.path.islink( full_path ):
+def assert_directory_executable( full_path ):
+ """
+ Return True if a symbolic link or directory exists and is executable, but if
+ full_path is a file, return False.
+ """
+ if full_path is None:
return False
- if os.path.is_dir( full_path ):
- return True
+ if os.path.isfile( full_path ):
+ return False
+ if os.path.isdir( full_path ):
+ # Make sure the owner has execute permission on the directory.
+ # See http://docs.python.org/2/library/stat.html
+ if stat.S_IXUSR & os.stat( full_path )[ stat.ST_MODE ] == 64:
+ return True
return False
-def assert_file_exists( full_path ):
- """Return True if a file exists. This will work for both symbolic linke and files."""
- if os.path.exists( full_path ):
+def assert_directory_exists( full_path ):
+ """
+ Return True if a symbolic link or directory exists, but if full_path is a file,
+ return False. """
+ if full_path is None:
+ return False
+ if os.path.isfile( full_path ):
+ return False
+ if os.path.isdir( full_path ):
return True
return False
def assert_file_executable( full_path ):
- """Return True if a file exists and is executable."""
- if os.path.islink( full_path ):
+ """
+ Return True if a symbolic link or file exists and is executable, but if full_path
+ is a directory, return False.
+ """
+ if full_path is None:
return False
- if os.path.is_file( full_path ):
+ if os.path.isdir( full_path ):
+ return False
+ if os.path.exists( full_path ):
# Make sure the owner has execute permission on the file.
# See http://docs.python.org/2/library/stat.html
if stat.S_IXUSR & os.stat( full_path )[ stat.ST_MODE ] == 64:
return True
return False
+def assert_file_exists( full_path ):
+ """
+ Return True if a symbolic link or file exists, but if full_path is a directory,
+ return False.
+ """
+ if full_path is None:
+ return False
+ if os.path.isdir( full_path ):
+ return False
+ if os.path.exists( full_path ):
+ return True
+ return False
+
def create_env_var_dict( elem, tool_dependency_install_dir=None, tool_shed_repository_install_dir=None ):
env_var_name = elem.get( 'name', 'PATH' )
env_var_action = elem.get( 'action', 'prepend_to' )
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.
1
0
commit/galaxy-central: jmchilton: Refactor managers into their own module.
by commits-noreply@bitbucket.org 27 Apr '14
by commits-noreply@bitbucket.org 27 Apr '14
27 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/56dd83576ce6/
Changeset: 56dd83576ce6
User: jmchilton
Date: 2014-04-27 03:27:07
Summary: Refactor managers into their own module.
Allows cleaner reuse outside of controllers. Small PEP8 fixes.
Affected #: 5 files
diff -r 9dbd0de27e53a2cac3c604c0aa6fb70ffb5ac7d1 -r 56dd83576ce67763863b61ad85104f8d14d978e0 lib/galaxy/managers/__init__.py
--- /dev/null
+++ b/lib/galaxy/managers/__init__.py
@@ -0,0 +1,4 @@
+""" 'Business logic' independent of web transactions/user context (trans)
+should be pushed into models - but logic that requires the context trans
+should be placed under this module.
+"""
diff -r 9dbd0de27e53a2cac3c604c0aa6fb70ffb5ac7d1 -r 56dd83576ce67763863b61ad85104f8d14d978e0 lib/galaxy/managers/hdas.py
--- /dev/null
+++ b/lib/galaxy/managers/hdas.py
@@ -0,0 +1,67 @@
+from galaxy import exceptions
+from ..managers import histories
+
+
+class HDAManager( object ):
+
+ def __init__( self ):
+ self.histories_mgr = histories.HistoryManager()
+
+ def get( self, trans, unencoded_id, check_ownership=True, check_accessible=True ):
+ """
+ """
+ # this is a replacement for UsesHistoryDatasetAssociationMixin because mixins are a bad soln/structure
+ hda = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( unencoded_id )
+ if hda is None:
+ raise exceptions.ObjectNotFound()
+ hda = self.secure( trans, hda, check_ownership, check_accessible )
+ return hda
+
+ def secure( self, trans, hda, check_ownership=True, check_accessible=True ):
+ """
+ checks if (a) user owns item or (b) item is accessible to user.
+ """
+ # all items are accessible to an admin
+ if trans.user and trans.user_is_admin():
+ return hda
+ if check_ownership:
+ hda = self.check_ownership( trans, hda )
+ if check_accessible:
+ hda = self.check_accessible( trans, hda )
+ return hda
+
+ def can_access_dataset( self, trans, hda ):
+ current_user_roles = trans.get_current_user_roles()
+ return trans.app.security_agent.can_access_dataset( current_user_roles, hda.dataset )
+
+ #TODO: is_owner, is_accessible
+
+ def check_ownership( self, trans, hda ):
+ if not trans.user:
+ #if hda.history == trans.history:
+ # return hda
+ raise exceptions.AuthenticationRequired( "Must be logged in to manage Galaxy datasets", type='error' )
+ if trans.user_is_admin():
+ return hda
+ # check for ownership of the containing history and accessibility of the underlying dataset
+ if( self.histories_mgr.is_owner( trans, hda.history )
+ and self.can_access_dataset( trans, hda ) ):
+ return hda
+ raise exceptions.ItemOwnershipException(
+ "HistoryDatasetAssociation is not owned by the current user", type='error' )
+
+ def check_accessible( self, trans, hda ):
+ if trans.user and trans.user_is_admin():
+ return hda
+ # check for access of the containing history...
+ self.histories_mgr.check_accessible( trans, hda.history )
+ # ...then the underlying dataset
+ if self.can_access_dataset( trans, hda ):
+ return hda
+ raise exceptions.ItemAccessibilityException(
+ "HistoryDatasetAssociation is not accessible to the current user", type='error' )
+
+ def err_if_uploading( self, trans, hda ):
+ if hda.state == trans.model.Dataset.states.UPLOAD:
+ raise exceptions.Conflict( "Please wait until this dataset finishes uploading" )
+ return hda
diff -r 9dbd0de27e53a2cac3c604c0aa6fb70ffb5ac7d1 -r 56dd83576ce67763863b61ad85104f8d14d978e0 lib/galaxy/managers/histories.py
--- /dev/null
+++ b/lib/galaxy/managers/histories.py
@@ -0,0 +1,93 @@
+from galaxy import exceptions
+from galaxy.model import orm
+
+
+class HistoryManager( object ):
+ #TODO: all the following would be more useful if passed the user instead of defaulting to trans.user
+
+ def get( self, trans, unencoded_id, check_ownership=True, check_accessible=True, deleted=None ):
+ """
+ Get a History from the database by id, verifying ownership.
+ """
+ # this is a replacement for UsesHistoryMixin because mixins are a bad soln/structure
+ history = trans.sa_session.query( trans.app.model.History ).get( unencoded_id )
+ if history is None:
+ raise exceptions.ObjectNotFound()
+ if deleted is True and not history.deleted:
+ raise exceptions.ItemDeletionException( 'History "%s" is not deleted' % ( history.name ), type="error" )
+ elif deleted is False and history.deleted:
+ raise exceptions.ItemDeletionException( 'History "%s" is deleted' % ( history.name ), type="error" )
+
+ history = self.secure( trans, history, check_ownership, check_accessible )
+ return history
+
+ def by_user( self, trans, user=None, include_deleted=False, only_deleted=False ):
+ """
+ Get all the histories for a given user (defaulting to `trans.user`)
+ ordered by update time and filtered on whether they've been deleted.
+ """
+ # handle default and/or anonymous user (which still may not have a history yet)
+ user = user or trans.user
+ if not user:
+ current_history = trans.get_history()
+ return [ current_history ] if current_history else []
+
+ history_model = trans.model.History
+ query = ( trans.sa_session.query( history_model )
+ .filter( history_model.user == user )
+ .order_by( orm.desc( history_model.table.c.update_time ) ) )
+ if only_deleted:
+ query = query.filter( history_model.deleted == True )
+ elif not include_deleted:
+ query = query.filter( history_model.deleted == False )
+ return query.all()
+
+ def secure( self, trans, history, check_ownership=True, check_accessible=True ):
+ """
+ checks if (a) user owns item or (b) item is accessible to user.
+ """
+ # all items are accessible to an admin
+ if trans.user and trans.user_is_admin():
+ return history
+ if check_ownership:
+ history = self.check_ownership( trans, history )
+ if check_accessible:
+ history = self.check_accessible( trans, history )
+ return history
+
+ def is_current( self, trans, history ):
+ return trans.history == history
+
+ def is_owner( self, trans, history ):
+ # anon users are only allowed to view their current history
+ if not trans.user:
+ return self.is_current( trans, history )
+ return trans.user == history.user
+
+ def check_ownership( self, trans, history ):
+ if trans.user and trans.user_is_admin():
+ return history
+ if not trans.user and not self.is_current( trans, history ):
+ raise exceptions.AuthenticationRequired( "Must be logged in to manage Galaxy histories", type='error' )
+ if self.is_owner( trans, history ):
+ return history
+ raise exceptions.ItemOwnershipException( "History is not owned by the current user", type='error' )
+
+ def is_accessible( self, trans, history ):
+ # admin always have access
+ if trans.user and trans.user_is_admin():
+ return True
+ # owner has implicit access
+ if self.is_owner( trans, history ):
+ return True
+ # importable and shared histories are always accessible
+ if history.importable:
+ return True
+ if trans.user in history.users_shared_with_dot_users:
+ return True
+ return False
+
+ def check_accessible( self, trans, history ):
+ if self.is_accessible( trans, history ):
+ return history
+ raise exceptions.ItemAccessibilityException( "History is not accessible to the current user", type='error' )
diff -r 9dbd0de27e53a2cac3c604c0aa6fb70ffb5ac7d1 -r 56dd83576ce67763863b61ad85104f8d14d978e0 lib/galaxy/webapps/galaxy/api/histories.py
--- a/lib/galaxy/webapps/galaxy/api/histories.py
+++ b/lib/galaxy/webapps/galaxy/api/histories.py
@@ -18,7 +18,7 @@
from galaxy.web.base.controller import ExportsHistoryMixin
from galaxy.web.base.controller import ImportsHistoryMixin
-from galaxy.model import orm
+from galaxy.managers import histories
from galaxy import util
from galaxy.util import string_as_bool
@@ -35,7 +35,7 @@
def __init__( self, app ):
super( HistoriesController, self ).__init__( app )
self.mgrs = util.bunch.Bunch(
- histories = HistoryManager()
+ histories=histories.HistoryManager()
)
def _decode_id( self, trans, id ):
@@ -404,96 +404,3 @@
pass
#log.warn( 'unknown key: %s', str( key ) )
return validated_payload
-
-
-
-
-class HistoryManager( object ):
- #TODO: all the following would be more useful if passed the user instead of defaulting to trans.user
-
- def get( self, trans, unencoded_id, check_ownership=True, check_accessible=True, deleted=None ):
- """
- Get a History from the database by id, verifying ownership.
- """
- # this is a replacement for UsesHistoryMixin because mixins are a bad soln/structure
- history = trans.sa_session.query( trans.app.model.History ).get( unencoded_id )
- if history is None:
- raise exceptions.ObjectNotFound()
- if deleted == True and not history.deleted:
- raise exceptions.ItemDeletionException( 'History "%s" is not deleted' % ( history.name ), type="error" )
- elif deleted == False and history.deleted:
- raise exceptions.ItemDeletionException( 'History "%s" is deleted' % ( history.name ), type="error" )
-
- history = self.secure( trans, history, check_ownership, check_accessible )
- return history
-
- def by_user( self, trans, user=None, include_deleted=False, only_deleted=False ):
- """
- Get all the histories for a given user (defaulting to `trans.user`)
- ordered by update time and filtered on whether they've been deleted.
- """
- # handle default and/or anonymous user (which still may not have a history yet)
- user = user or trans.user
- if not user:
- current_history = trans.get_history()
- return [ current_history ] if current_history else []
-
- history_model = trans.model.History
- query = ( trans.sa_session.query( history_model )
- .filter( history_model.user == user )
- .order_by( orm.desc( history_model.table.c.update_time ) ) )
- if only_deleted:
- query = query.filter( history_model.deleted == True )
- elif not include_deleted:
- query = query.filter( history_model.deleted == False )
- return query.all()
-
- def secure( self, trans, history, check_ownership=True, check_accessible=True ):
- """
- checks if (a) user owns item or (b) item is accessible to user.
- """
- # all items are accessible to an admin
- if trans.user and trans.user_is_admin():
- return history
- if check_ownership:
- history = self.check_ownership( trans, history )
- if check_accessible:
- history = self.check_accessible( trans, history )
- return history
-
- def is_current( self, trans, history ):
- return trans.history == history
-
- def is_owner( self, trans, history ):
- # anon users are only allowed to view their current history
- if not trans.user:
- return self.is_current( trans, history )
- return trans.user == history.user
-
- def check_ownership( self, trans, history ):
- if trans.user and trans.user_is_admin():
- return history
- if not trans.user and not self.is_current( trans, history ):
- raise exceptions.AuthenticationRequired( "Must be logged in to manage Galaxy histories", type='error' )
- if self.is_owner( trans, history ):
- return history
- raise exceptions.ItemOwnershipException( "History is not owned by the current user", type='error' )
-
- def is_accessible( self, trans, history ):
- # admin always have access
- if trans.user and trans.user_is_admin():
- return True
- # owner has implicit access
- if self.is_owner( trans, history ):
- return True
- # importable and shared histories are always accessible
- if history.importable:
- return True
- if trans.user in history.users_shared_with_dot_users:
- return True
- return False
-
- def check_accessible( self, trans, history ):
- if self.is_accessible( trans, history ):
- return history
- raise exceptions.ItemAccessibilityException( "History is not accessible to the current user", type='error' )
diff -r 9dbd0de27e53a2cac3c604c0aa6fb70ffb5ac7d1 -r 56dd83576ce67763863b61ad85104f8d14d978e0 lib/galaxy/webapps/galaxy/api/history_contents.py
--- a/lib/galaxy/webapps/galaxy/api/history_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/history_contents.py
@@ -7,7 +7,6 @@
from galaxy.web import _future_expose_api as expose_api
from galaxy.web import _future_expose_api_anonymous as expose_api_anonymous
-from galaxy.web import _future_expose_api_raw as expose_api_raw
from galaxy.web.base.controller import BaseAPIController
from galaxy.web.base.controller import UsesHistoryDatasetAssociationMixin
@@ -18,7 +17,8 @@
from galaxy.web.base.controller import url_for
-from galaxy.webapps.galaxy.api import histories
+from galaxy.managers import histories
+from galaxy.managers import hdas
import logging
log = logging.getLogger( __name__ )
@@ -30,8 +30,8 @@
def __init__( self, app ):
super( HistoryContentsController, self ).__init__( app )
self.mgrs = util.bunch.Bunch(
- histories = histories.HistoryManager(),
- hdas = HDAManager()
+ histories=histories.HistoryManager(),
+ hdas=hdas.HDAManager()
)
def _decode_id( self, trans, id ):
@@ -434,67 +434,3 @@
def __handle_unknown_contents_type( self, trans, contents_type ):
raise exceptions.UnknownContentsType('Unknown contents type: %s' % type)
-
-class HDAManager( object ):
-
- def __init__( self ):
- self.histories_mgr = histories.HistoryManager()
-
- def get( self, trans, unencoded_id, check_ownership=True, check_accessible=True ):
- """
- """
- # this is a replacement for UsesHistoryDatasetAssociationMixin because mixins are a bad soln/structure
- hda = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( unencoded_id )
- if hda is None:
- raise exceptions.ObjectNotFound()
- hda = self.secure( trans, hda, check_ownership, check_accessible )
- return hda
-
- def secure( self, trans, hda, check_ownership=True, check_accessible=True ):
- """
- checks if (a) user owns item or (b) item is accessible to user.
- """
- # all items are accessible to an admin
- if trans.user and trans.user_is_admin():
- return hda
- if check_ownership:
- hda = self.check_ownership( trans, hda )
- if check_accessible:
- hda = self.check_accessible( trans, hda )
- return hda
-
- def can_access_dataset( self, trans, hda ):
- current_user_roles = trans.get_current_user_roles()
- return trans.app.security_agent.can_access_dataset( current_user_roles, hda.dataset )
-
- #TODO: is_owner, is_accessible
-
- def check_ownership( self, trans, hda ):
- if not trans.user:
- #if hda.history == trans.history:
- # return hda
- raise exceptions.AuthenticationRequired( "Must be logged in to manage Galaxy datasets", type='error' )
- if trans.user_is_admin():
- return hda
- # check for ownership of the containing history and accessibility of the underlying dataset
- if( self.histories_mgr.is_owner( trans, hda.history )
- and self.can_access_dataset( trans, hda ) ):
- return hda
- raise exceptions.ItemOwnershipException(
- "HistoryDatasetAssociation is not owned by the current user", type='error' )
-
- def check_accessible( self, trans, hda ):
- if trans.user and trans.user_is_admin():
- return hda
- # check for access of the containing history...
- self.histories_mgr.check_accessible( trans, hda.history )
- # ...then the underlying dataset
- if self.can_access_dataset( trans, hda ):
- return hda
- raise exceptions.ItemAccessibilityException(
- "HistoryDatasetAssociation is not accessible to the current user", type='error' )
-
- def err_if_uploading( self, trans, hda ):
- if hda.state == trans.model.Dataset.states.UPLOAD:
- raise exceptions.Conflict( "Please wait until this dataset finishes uploading" )
- return hda
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.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4d4ad2a65454/
Changeset: 4d4ad2a65454
User: jmchilton
Date: 2014-04-27 00:52:08
Summary: Tools API Tests - Add another test with repeat.
Adding abstractions reused heavily in collections and multi-execution tests downstream.
Affected #: 1 file
diff -r 03efdcca196906f3aac9939517096da445ff0bf3 -r 4d4ad2a654545e461c3b41c903a53657a640c07d test/functional/api/test_tools.py
--- a/test/functional/api/test_tools.py
+++ b/test/functional/api/test_tools.py
@@ -54,28 +54,69 @@
self.assertEquals( result_content, table )
def test_run_cat1( self ):
+ # Run simple non-upload tool with an input data parameter.
history_id = self._new_history()
- new_dataset = self._new_dataset( history_id )
- dataset_id = new_dataset[ 'id' ]
+ new_dataset = self._new_dataset( history_id, content='Cat1Test' )
+ inputs = dict(
+ input1=dataset_to_param( new_dataset ),
+ )
+ outputs = self._cat1_outputs( history_id, inputs=inputs )
+ self.assertEquals( len( outputs ), 1 )
+ self._wait_for_history( history_id, assert_ok=True )
+ output1 = outputs[ 0 ]
+ output1_content = self._get_content( history_id, dataset=output1 )
+ self.assertEqual( output1_content.strip(), "Cat1Test" )
+
+ def test_run_cat1_with_two_inputs( self ):
+ # Run tool with an multiple data parameter and grouping (repeat)
+ history_id = self._new_history()
+ new_dataset1 = self._new_dataset( history_id, content='Cat1Test' )
+ new_dataset2 = self._new_dataset( history_id, content='Cat2Test' )
+ inputs = {
+ 'input1': dataset_to_param( new_dataset1 ),
+ 'queries_0|input2': dataset_to_param( new_dataset2 )
+ }
+ outputs = self._cat1_outputs( history_id, inputs=inputs )
+ self.assertEquals( len( outputs ), 1 )
+ self._wait_for_history( history_id, assert_ok=True )
+ output1 = outputs[ 0 ]
+ output1_content = self._get_content( history_id, dataset=output1 )
+ self.assertEqual( output1_content.strip(), "Cat1Test\nCat2Test" )
+
+ def _cat1_outputs( self, history_id, inputs ):
+ create_response = self._run_cat1( history_id, inputs )
+ self._assert_status_code_is( create_response, 200 )
+ create = create_response.json()
+ self._assert_has_keys( create, 'outputs' )
+ return create[ 'outputs' ]
+
+ def _run_cat1( self, history_id, inputs ):
payload = self._run_tool_payload(
tool_id='cat1',
- inputs=dict(
- input1=dict(
- src='hda',
- id=dataset_id
- ),
- ),
+ inputs=inputs,
history_id=history_id,
)
create_response = self._post( "tools", data=payload )
- self._assert_status_code_is( create_response, 200 )
- self._assert_has_keys( create_response.json(), 'outputs' )
- self._wait_for_history( history_id, assert_ok=True )
+ return create_response
def _upload_and_get_content( self, content, **upload_kwds ):
history_id = self._new_history()
new_dataset = self._new_dataset( history_id, content=content, **upload_kwds )
self._wait_for_history( history_id, assert_ok=True )
- display_response = self._get( "histories/%s/contents/%s/display" % ( history_id, new_dataset[ "id" ] ) )
+ return self._get_content( history_id, dataset=new_dataset )
+
+ def _get_content( self, history_id, **kwds ):
+ if "dataset_id" in kwds:
+ dataset_id = kwds[ "dataset_id" ]
+ else:
+ dataset_id = kwds[ "dataset" ][ "id" ]
+ display_response = self._get( "histories/%s/contents/%s/display" % ( history_id, dataset_id ) )
self._assert_status_code_is( display_response, 200 )
return display_response.content
+
+
+def dataset_to_param( dataset ):
+ return dict(
+ src='hda',
+ id=dataset[ 'id' ]
+ )
https://bitbucket.org/galaxy/galaxy-central/commits/a05d14c84adb/
Changeset: a05d14c84adb
User: jmchilton
Date: 2014-04-27 00:52:08
Summary: Tools API Tests - Refactor away from deprecated mixin toward DatasetPopulator class.
Affected #: 2 files
diff -r 4d4ad2a654545e461c3b41c903a53657a640c07d -r a05d14c84adb736daaeb80323269964a0fab97ff test/functional/api/helpers.py
--- a/test/functional/api/helpers.py
+++ b/test/functional/api/helpers.py
@@ -9,6 +9,8 @@
# row - first grabbing 8 lines at random and then 6.
workflow_random_x2_str = resource_string( __name__, "test_workflow_2.ga" )
+DEFAULT_HISTORY_TIMEOUT = 5 # Secs to wait on history to turn ok
+
# Deprecated mixin, use dataset populator instead.
# TODO: Rework existing tests to target DatasetPopulator in a setup method instead.
@@ -40,8 +42,8 @@
run_response = self.galaxy_interactor.post( "tools", data=payload )
return run_response.json()["outputs"][0]
- def wait_for_history( self, history_id, assert_ok=False ):
- wait_on_state( lambda: self.galaxy_interactor.get( "histories/%s" % history_id ), assert_ok=assert_ok )
+ def wait_for_history( self, history_id, assert_ok=False, timeout=DEFAULT_HISTORY_TIMEOUT ):
+ wait_on_state( lambda: self.galaxy_interactor.get( "histories/%s" % history_id ), assert_ok=assert_ok, timeout=timeout )
def new_history( self, **kwds ):
name = kwds.get( "name", "API Test History" )
diff -r 4d4ad2a654545e461c3b41c903a53657a640c07d -r a05d14c84adb736daaeb80323269964a0fab97ff test/functional/api/test_tools.py
--- a/test/functional/api/test_tools.py
+++ b/test/functional/api/test_tools.py
@@ -3,10 +3,14 @@
from base import api
from operator import itemgetter
-from .helpers import TestsDatasets
+from .helpers import DatasetPopulator
-class ToolsTestCase( api.ApiTestCase, TestsDatasets ):
+class ToolsTestCase( api.ApiTestCase ):
+
+ def setUp( self ):
+ super( ToolsTestCase, self ).setUp( )
+ self.dataset_populator = DatasetPopulator( self.galaxy_interactor )
def test_index( self ):
index = self._get( "tools" )
@@ -27,8 +31,8 @@
assert "cat1" in tool_ids
def test_upload1_paste( self ):
- history_id = self._new_history()
- payload = self._upload_payload( history_id, 'Hello World' )
+ history_id = self.dataset_populator.new_history()
+ payload = self.dataset_populator.upload_payload( history_id, 'Hello World' )
create_response = self._post( "tools", data=payload )
self._assert_has_keys( create_response.json(), 'outputs' )
@@ -55,30 +59,30 @@
def test_run_cat1( self ):
# Run simple non-upload tool with an input data parameter.
- history_id = self._new_history()
- new_dataset = self._new_dataset( history_id, content='Cat1Test' )
+ history_id = self.dataset_populator.new_history()
+ new_dataset = self.dataset_populator.new_dataset( history_id, content='Cat1Test' )
inputs = dict(
input1=dataset_to_param( new_dataset ),
)
outputs = self._cat1_outputs( history_id, inputs=inputs )
self.assertEquals( len( outputs ), 1 )
- self._wait_for_history( history_id, assert_ok=True )
+ self.dataset_populator.wait_for_history( history_id, assert_ok=True )
output1 = outputs[ 0 ]
output1_content = self._get_content( history_id, dataset=output1 )
self.assertEqual( output1_content.strip(), "Cat1Test" )
def test_run_cat1_with_two_inputs( self ):
# Run tool with an multiple data parameter and grouping (repeat)
- history_id = self._new_history()
- new_dataset1 = self._new_dataset( history_id, content='Cat1Test' )
- new_dataset2 = self._new_dataset( history_id, content='Cat2Test' )
+ history_id = self.dataset_populator.new_history()
+ new_dataset1 = self.dataset_populator.new_dataset( history_id, content='Cat1Test' )
+ new_dataset2 = self.dataset_populator.new_dataset( history_id, content='Cat2Test' )
inputs = {
'input1': dataset_to_param( new_dataset1 ),
'queries_0|input2': dataset_to_param( new_dataset2 )
}
outputs = self._cat1_outputs( history_id, inputs=inputs )
self.assertEquals( len( outputs ), 1 )
- self._wait_for_history( history_id, assert_ok=True )
+ self.dataset_populator.wait_for_history( history_id, assert_ok=True )
output1 = outputs[ 0 ]
output1_content = self._get_content( history_id, dataset=output1 )
self.assertEqual( output1_content.strip(), "Cat1Test\nCat2Test" )
@@ -91,7 +95,7 @@
return create[ 'outputs' ]
def _run_cat1( self, history_id, inputs ):
- payload = self._run_tool_payload(
+ payload = self.dataset_populator.run_tool_payload(
tool_id='cat1',
inputs=inputs,
history_id=history_id,
@@ -100,9 +104,9 @@
return create_response
def _upload_and_get_content( self, content, **upload_kwds ):
- history_id = self._new_history()
- new_dataset = self._new_dataset( history_id, content=content, **upload_kwds )
- self._wait_for_history( history_id, assert_ok=True )
+ history_id = self.dataset_populator.new_history()
+ new_dataset = self.dataset_populator.new_dataset( history_id, content=content, **upload_kwds )
+ self.dataset_populator.wait_for_history( history_id, assert_ok=True )
return self._get_content( history_id, dataset=new_dataset )
def _get_content( self, history_id, **kwds ):
https://bitbucket.org/galaxy/galaxy-central/commits/9dbd0de27e53/
Changeset: 9dbd0de27e53
User: jmchilton
Date: 2014-04-27 00:52:08
Summary: Workflow Editor Unit Tests - Improvements to input terminal canAccept tests.
Use real connectors, add tests for logic related to multiple input data parameters.
Affected #: 1 file
diff -r a05d14c84adb736daaeb80323269964a0fab97ff -r 9dbd0de27e53a2cac3c604c0aa6fb70ffb5ac7d1 test/qunit/tests/workflow_editor_tests.js
--- a/test/qunit/tests/workflow_editor_tests.js
+++ b/test/qunit/tests/workflow_editor_tests.js
@@ -60,20 +60,27 @@
};
module( "Input terminal model test", {
- setup: function() {
- this.node = { };
- this.element = $( "<div>" );
- var input = { extensions: [ "txt" ], multiple: false };
- this.input_terminal = new InputTerminal( { element: this.element, input: input } );
+ setup: function( ) {
+ this.node = new Node( { } );
+ this.input = { extensions: [ "txt" ], multiple: false };
+ this.input_terminal = new InputTerminal( { input: this.input } );
this.input_terminal.node = this.node;
},
- test_connector: function( attr ) {
- var connector = attr || {};
- this.input_terminal.connectors.push( connector );
+ multiple: function( ) {
+ this.input.multiple = true;
+ this.input_terminal.update( this.input );
+ },
+ test_connector: function( ) {
+ var outputTerminal = new OutputTerminal( { datatypes: [ 'input' ] } );
+ var inputTerminal = this.input_terminal;
+ var connector;
+ with_workflow_global( function() {
+ connector = new Connector( outputTerminal, inputTerminal );
+ } );
return connector;
},
- with_test_connector: function( attr, f ) {
- this.test_connector( attr );
+ with_test_connector: function( f ) {
+ this.test_connector( );
f();
this.reset_connectors();
},
@@ -116,7 +123,7 @@
test( "test disconnect", function() {
this.node.markChanged = sinon.spy();
- var connector = this.test_connector( {} );
+ var connector = this.test_connector( );
this.input_terminal.disconnect( connector );
// Assert node markChanged called
@@ -126,17 +133,19 @@
} );
test( "test redraw", function() {
- var connector = this.test_connector( { redraw: sinon.spy() } );
+ var connector = this.test_connector( );
+ connector.redraw = sinon.spy();
this.input_terminal.redraw();
// Assert connectors were redrawn
ok( connector.redraw.called );
} );
test( "test destroy", function() {
- var connector = this.test_connector( { destroy: sinon.spy() } );
+ var connector = this.test_connector();
+ connector.destroy = sinon.spy();
this.input_terminal.destroy();
- // Assert connectors were redrawn
+ // Assert connectors were destroyed
ok( connector.destroy.called );
} );
@@ -189,11 +198,29 @@
test( "cannot accept when already connected", function() {
var self = this;
// If other is subtype but already connected, cannot accept
- this.with_test_connector( {}, function() {
+ this.with_test_connector( function() {
ok( ! self.test_accept() );
} );
} );
+ test( "can accept already connected inputs if input is multiple", function() {
+ var self = this;
+ this.multiple();
+ this.with_test_connector( function() {
+ ok( self.test_accept() );
+ } );
+ } );
+
+ test( "cannot accept already connected inputs if input is multiple but datatypes don't match", function() {
+ var other = { node: {}, datatypes: [ "binary" ] }; // binary is not txt
+
+ var self = this;
+ this.multiple();
+ this.with_test_connector( function() {
+ ok( ! self.test_accept( other ) );
+ } );
+ } );
+
module( "Connector test", {
} );
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.
1
0
commit/galaxy-central: martenson: data libraries API: improved deleted folder items handling, pydocs
by commits-noreply@bitbucket.org 25 Apr '14
by commits-noreply@bitbucket.org 25 Apr '14
25 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/03efdcca1969/
Changeset: 03efdcca1969
User: martenson
Date: 2014-04-25 23:44:50
Summary: data libraries API: improved deleted folder items handling, pydocs
Affected #: 1 file
diff -r de882c9035116eccd7563c9f89aec586a017ce2f -r 03efdcca196906f3aac9939517096da445ff0bf3 lib/galaxy/webapps/galaxy/api/folder_contents.py
--- a/lib/galaxy/webapps/galaxy/api/folder_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/folder_contents.py
@@ -2,6 +2,7 @@
API operations on the contents of a library folder.
"""
from galaxy import web
+from galaxy import util
from galaxy import exceptions
from galaxy.web import _future_expose_api as expose_api
from galaxy.web import _future_expose_api_anonymous as expose_api_anonymous
@@ -21,10 +22,32 @@
def index( self, trans, folder_id, **kwd ):
"""
GET /api/folders/{encoded_folder_id}/contents
- Displays a collection (list) of a folder's contents (files and folders).
- Encoded folder ID is prepended with 'F' if it is a folder as opposed to a data set which does not have it.
- Full path is provided in response as a separate object providing data for breadcrumb path building.
+
+ Displays a collection (list) of a folder's contents
+ (files and folders). Encoded folder ID is prepended
+ with 'F' if it is a folder as opposed to a data set
+ which does not have it. Full path is provided in
+ response as a separate object providing data for
+ breadcrumb path building.
+
+ :param folder_id: encoded ID of the folder which
+ contents should be library_dataset_dict
+ :type folder_id: encoded string
+
+ :param kwd: keyword dictionary with other params
+ :type kwd: dict
+
+ :returns: dictionary containing all items and metadata
+ :type: dict
+
+ :raises: MalformedId, InconsistentDatabase, ObjectNotFound,
+ InternalServerError
"""
+ deleted = kwd.get( 'deleted', 'missing' )
+ try:
+ deleted = util.asbool( deleted )
+ except ValueError:
+ deleted = False
if ( len( folder_id ) == 17 and folder_id.startswith( 'F' ) ):
try:
@@ -69,7 +92,14 @@
def build_path( folder ):
"""
- Search the path upwards recursively and load the whole route of names and ids for breadcrumb building purposes.
+ Search the path upwards recursively and load the whole route of
+ names and ids for breadcrumb building purposes.
+
+ :param folder: current folder for navigating up
+ :param type: Galaxy LibraryFolder
+
+ :returns: list consisting of full path to the library
+ :type: list
"""
path_to_root = []
# We are almost in root
@@ -89,7 +119,7 @@
update_time = ''
create_time = ''
# Go through every accessible item in the folder and include its meta-data.
- for content_item in self._load_folder_contents( trans, folder ):
+ for content_item in self._load_folder_contents( trans, folder, deleted ):
can_access = trans.app.security_agent.can_access_library_item( current_user_roles, content_item, trans.user )
if ( can_access or ( content_item.api_type == 'folder' and trans.app.security_agent.folder_is_unrestricted( content_item ) ) ):
return_item = {}
@@ -119,31 +149,74 @@
type = content_item.api_type,
name = content_item.name,
update_time = update_time,
- create_time = create_time
+ create_time = create_time,
+ deleted = content_item.deleted
) )
folder_contents.append( return_item )
return { 'metadata' : { 'full_path' : full_path, 'can_add_library_item': can_add_library_item, 'folder_name': folder.name }, 'folder_contents' : folder_contents }
- def _load_folder_contents( self, trans, folder ):
+ def _load_folder_contents( self, trans, folder, include_deleted ):
"""
- Loads all contents of the folder (folders and data sets) but only in the first level.
+ Loads all contents of the folder (folders and data sets) but only
+ in the first level. Include deleted if the flag is set and if the
+ user has access to undelete it.
+
+ :param folder: the folder which contents are being loaded
+ :type folder: Galaxy LibraryFolder
+
+ :param include_deleted: flag, when true the items that are deleted
+ and can be undeleted by current user are shown
+ :type include_deleted: boolean
+
+ :returns: a list containing the requested items
+ :type: list
"""
current_user_roles = trans.get_current_user_roles()
is_admin = trans.user_is_admin()
content_items = []
for subfolder in folder.active_folders:
- if not is_admin:
- can_access, folder_ids = trans.app.security_agent.check_folder_contents( trans.user, current_user_roles, subfolder )
- if (is_admin or can_access) and not subfolder.deleted:
- subfolder.api_type = 'folder'
- content_items.append( subfolder )
+ if subfolder.deleted:
+ if include_deleted:
+ if is_admin:
+ subfolder.api_type = 'folder'
+ content_items.append( subfolder )
+ else:
+ can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles, subfolder )
+ if can_modify:
+ subfolder.api_type = 'folder'
+ content_items.append( subfolder )
+ else:
+ if is_admin:
+ subfolder.api_type = 'folder'
+ content_items.append( subfolder )
+ else:
+ can_access, folder_ids = trans.app.security_agent.check_folder_contents( trans.user, current_user_roles, subfolder )
+ if can_access:
+ subfolder.api_type = 'folder'
+ content_items.append( subfolder )
+
for dataset in folder.datasets:
- if not is_admin:
- can_access = trans.app.security_agent.can_access_dataset( current_user_roles, dataset.library_dataset_dataset_association.dataset )
- if (is_admin or can_access) and not dataset.deleted:
- dataset.api_type = 'file'
- content_items.append( dataset )
+ if dataset.deleted:
+ if include_deleted:
+ if is_admin:
+ dataset.api_type = 'file'
+ content_items.append( dataset )
+ else:
+ can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles, dataset )
+ if can_modify:
+ dataset.api_type = 'file'
+ content_items.append( dataset )
+ else:
+ if is_admin:
+ dataset.api_type = 'file'
+ content_items.append( dataset )
+ else:
+ can_access, folder_ids = trans.app.security_agent.can_access_dataset( current_user_roles, dataset.library_dataset_dataset_association.dataset )
+ if can_access:
+ dataset.api_type = 'file'
+ content_items.append( dataset )
+
return content_items
@expose_api
@@ -157,15 +230,22 @@
:type payload: dict
* folder_id: the parent folder of the new item
- * from_hda_id: (optional) the id of an accessible HDA to copy into the library
- * ldda_message: (optional) the new message attribute of the LDDA created
- * extended_metadata: (optional) dub-dictionary containing any extended
- metadata to associate with the item
+ * from_hda_id: (optional) the id of an accessible HDA to copy
+ into the library
+ * ldda_message: (optional) the new message attribute of the LDDA
+ created
+ * extended_metadata: (optional) dub-dictionary containing any
+ extended metadata to associate with the item
- :returns: a dictionary containing the id, name, and 'show' url of the new item
+ :returns: a dictionary containing the id, name,
+ and 'show' url of the new item
:rtype: dict
+
+ :raises: ObjectAttributeInvalidException,
+ InsufficientPermissionsException, ItemAccessibilityException,
+ InternalServerError
"""
- class_name, encoded_folder_id_16 = self.__decode_library_content_id( trans, encoded_folder_id )
+ encoded_folder_id_16 = self.__decode_library_content_id( trans, encoded_folder_id )
from_hda_id, ldda_message = ( payload.pop( 'from_hda_id', None ), payload.pop( 'ldda_message', '' ) )
if ldda_message:
ldda_message = util.sanitize_html.sanitize_html( ldda_message, 'utf-8' )
@@ -200,8 +280,21 @@
return rval
def __decode_library_content_id( self, trans, encoded_folder_id ):
+ """
+ Identifies whether the id provided is properly encoded
+ LibraryFolder.
+
+ :param encoded_folder_id: encoded id of Galaxy LibraryFolder
+ :type encoded_folder_id: encoded string
+
+ :returns: last 16 chars of the encoded id in case it was Folder
+ (had 'F' prepended)
+ :type: string
+
+ :raises: MalformedId
+ """
if ( len( encoded_folder_id ) == 17 and encoded_folder_id.startswith( 'F' )):
- return 'LibraryFolder', encoded_folder_id[1:]
+ return encoded_folder_id[1:]
else:
raise exceptions.MalformedId( 'Malformed folder id ( %s ) specified, unable to decode.' % str( encoded_folder_id ) )
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.
1
0