galaxy-commits
Threads by month
- ----- 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
January 2014
- 1 participants
- 280 discussions
commit/galaxy-central: greg: Dict url entry changes and improved logging for the Tool Shed api.
by commits-noreply@bitbucket.org 17 Jan '14
by commits-noreply@bitbucket.org 17 Jan '14
17 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/03f186a98017/
Changeset: 03f186a98017
User: greg
Date: 2014-01-17 22:35:05
Summary: Dict url entry changes and improved logging for the Tool Shed api.
Affected #: 1 file
diff -r 8704a185d43ef02b0dd763a89a9b003df0326d90 -r 03f186a9801738c9cab95275038851ed95922a49 lib/galaxy/webapps/tool_shed/api/repository_revisions.py
--- a/lib/galaxy/webapps/tool_shed/api/repository_revisions.py
+++ b/lib/galaxy/webapps/tool_shed/api/repository_revisions.py
@@ -186,9 +186,9 @@
value_mapper=self.__get_value_mapper( trans ) )
# We have to add the changeset_revision of of the repository dependency.
repository_dependency_dict[ 'changeset_revision' ] = changeset_revision
- repository_dependency_dict[ 'url' ] = web.url_for( controller='repository_revisions',
+ repository_dependency_dict[ 'url' ] = web.url_for( controller='repositories',
action='show',
- id=repository_dependency_repository_metadata_id )
+ id=repository_dependency_id )
repository_dependencies_dicts.append( repository_dependency_dict )
return repository_dependencies_dicts
@@ -205,11 +205,13 @@
if repository_metadata is None:
log.debug( 'Cannot locate repository_metadata with id %s' % str( id ) )
return {}
+ encoded_repository_id = trans.security.encode_id( repository_metadata.repository_id )
+ repository = suc.get_repository_by_id( trans, encoded_repository_id )
repository_metadata_dict = repository_metadata.to_dict( view='element',
value_mapper=self.__get_value_mapper( trans ) )
- repository_metadata_dict[ 'url' ] = web.url_for( controller='repository_revisions',
+ repository_metadata_dict[ 'url' ] = web.url_for( controller='repositories',
action='show',
- id=trans.security.encode_id( repository_metadata.id ) )
+ id=encoded_repository_id )
return repository_metadata_dict
@web.expose_api
@@ -223,8 +225,11 @@
raise HTTPBadRequest( detail="Missing required parameter 'id'." )
repository_metadata = metadata_util.get_repository_metadata_by_id( trans, repository_metadata_id )
if repository_metadata is None:
- log.debug( 'Cannot locate repository_metadata with id %s' % str( repository_metadata_id ) )
+ decoded_repository_metadata_id = trans.security.decode_id( repository_metadata_id )
+ log.debug( 'Cannot locate repository_metadata with id %s' % str( decoded_repository_metadata_id ) )
return {}
+ else:
+ decoded_repository_metadata_id = repository_metadata.id
flush_needed = False
for key, new_value in payload.items():
if key == 'time_last_tested':
@@ -239,6 +244,8 @@
setattr( repository_metadata, key, new_value )
flush_needed = True
if flush_needed:
+ log.debug( 'Updating repository_metadata record with id %s and changeset_revision %s.' % \
+ ( str( decoded_repository_metadata_id ), str( repository_metadata.changeset_revision ) ) )
trans.sa_session.add( repository_metadata )
trans.sa_session.flush()
trans.sa_session.refresh( repository_metadata )
@@ -246,5 +253,5 @@
value_mapper=self.__get_value_mapper( trans ) )
repository_metadata_dict[ 'url' ] = web.url_for( controller='repository_revisions',
action='show',
- id=trans.security.encode_id( repository_metadata.id ) )
+ id=repository_metadata_id )
return repository_metadata_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: dan: Change log.error to log.debug.
by commits-noreply@bitbucket.org 17 Jan '14
by commits-noreply@bitbucket.org 17 Jan '14
17 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8704a185d43e/
Changeset: 8704a185d43e
User: dan
Date: 2014-01-17 21:45:04
Summary: Change log.error to log.debug.
Affected #: 1 file
diff -r 82b5aef7a1da9e4129ba2a3920a54048642cc991 -r 8704a185d43ef02b0dd763a89a9b003df0326d90 lib/galaxy/tools/data/__init__.py
--- a/lib/galaxy/tools/data/__init__.py
+++ b/lib/galaxy/tools/data/__init__.py
@@ -400,7 +400,7 @@
if fields not in self.data or allow_duplicates:
self.data.append( fields )
else:
- log.error( "Attempted to add fields (%s) to data table '%s', but this entry already exists and allow_duplicates is False.", fields, self.name )
+ log.debug( "Attempted to add fields (%s) to data table '%s', but this entry already exists and allow_duplicates is False.", fields, self.name )
is_error = True
else:
log.error( "Attempted to add fields (%s) to data table '%s', but there were not enough fields specified ( %i < %i ).", fields, self.name, len( fields ), self.largest_index + 1 )
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: Enhance setting tool shed repository metadata to support tool dependency recipes that define installation of a binary but do not also include a recipe for installing and compiling from source.
by commits-noreply@bitbucket.org 17 Jan '14
by commits-noreply@bitbucket.org 17 Jan '14
17 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/82b5aef7a1da/
Changeset: 82b5aef7a1da
User: greg
Date: 2014-01-17 19:49:10
Summary: Enhance setting tool shed repository metadata to support tool dependency recipes that define installation of a binary but do not also include a recipe for installing and compiling from source.
Affected #: 3 files
diff -r 79c1a31e269d4668d125c1a277549617d34dae13 -r 82b5aef7a1da9e4129ba2a3920a54048642cc991 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
@@ -303,7 +303,8 @@
with make_tmp_dir() as work_dir:
with lcd( work_dir ):
# The first action in the list of actions will be the one that defines the installation process. There
- # are currently only two supported processes; download_by_url and clone via a "shell_command" action type.
+ # are currently three supported processes; download_binary, download_by_url and clone via a "shell_command"
+ # action type.
action_type, action_dict = actions[ 0 ]
if action_type == 'download_binary':
url = action_dict[ 'url' ]
@@ -316,11 +317,13 @@
downloaded_filename = td_common_util.download_binary( url, work_dir )
# Filter out any actions that are not download_binary, chmod, or set_environment.
filtered_actions = filter_actions_after_binary_installation( actions[ 1: ] )
- # Set actions to the same, so that the current download_binary doesn't get re-run in the filtered actions below.
+ # Set actions to the same, so that the current download_binary doesn't get re-run in the
+ # filtered actions below.
actions = filtered_actions
except Exception, e:
log.exception( str( e ) )
- # No binary exists, or there was an error downloading the binary from the generated URL. Proceed with the remaining actions.
+ # No binary exists, or there was an error downloading the binary from the generated URL.
+ # Proceed with the remaining actions.
filtered_actions = actions[ 1: ]
action_type, action_dict = filtered_actions[ 0 ]
# If the downloaded file exists, move it to $INSTALL_DIR. Put this outside the try/catch above so that
@@ -345,8 +348,9 @@
is_binary = action_dict.get( 'is_binary', False )
log.debug( 'Attempting to download via url: %s', url )
if 'target_filename' in action_dict:
- # Sometimes compressed archives extract their content to a folder other than the default defined file name. Using this
- # attribute will ensure that the file name is set appropriately and can be located after download, decompression and extraction.
+ # Sometimes compressed archives extract their content to a folder other than the default
+ # defined file name. Using this attribute will ensure that the file name is set appropriately
+ # and can be located after download, decompression and extraction.
downloaded_filename = action_dict[ 'target_filename' ]
else:
downloaded_filename = os.path.split( url )[ -1 ]
@@ -374,8 +378,9 @@
filtered_actions = actions[ 1: ]
url = action_dict[ 'url' ]
if 'target_filename' in action_dict:
- # Sometimes compressed archives extracts their content to a folder other than the default defined file name. Using this
- # attribute will ensure that the file name is set appropriately and can be located after download, decompression and extraction.
+ # Sometimes compressed archives extracts their content to a folder other than the default
+ # defined file name. Using this attribute will ensure that the file name is set appropriately
+ # and can be located after download, decompression and extraction.
filename = action_dict[ 'target_filename' ]
else:
filename = url.split( '/' )[ -1 ]
diff -r 79c1a31e269d4668d125c1a277549617d34dae13 -r 82b5aef7a1da9e4129ba2a3920a54048642cc991 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
@@ -324,31 +324,37 @@
def parse_package_elem( package_elem, platform_info_dict=None, include_after_install_actions=True ):
"""
- Parse a <package> element within a tool dependency definition and return a list of action tuples. This method is called when setting
- metadata on a repository that includes a tool_dependencies.xml file or when installing a repository that includes a tool_dependencies.xml
- file. If installing, platform_info_dict must be a valid dictionary and include_after_install_actions must be True.
+ Parse a <package> element within a tool dependency definition and return a list of action tuples.
+ This method is called when setting metadata on a repository that includes a tool_dependencies.xml
+ file or when installing a repository that includes a tool_dependencies.xml file. If installing,
+ platform_info_dict must be a valid dictionary and include_after_install_actions must be True.
"""
- # The actions_elem_tuples list contains <actions> tag sets (possibly inside of an <actions_group> tag set) to be processed in the order
- # they are defined in the tool_dependencies.xml file.
+ # The actions_elem_tuples list contains <actions> tag sets (possibly inside of an <actions_group>
+ # tag set) to be processed in the order they are defined in the tool_dependencies.xml file.
actions_elem_tuples = []
- # The tag sets that will go into the actions_elem_list are those that install a compiled binary if the architecture and operating system
- # match it's defined attributes. If compiled binary is not installed, the first <actions> tag set [following those that have the os and
- # architecture attributes] that does not have os or architecture attributes will be processed. This tag set must contain the recipe for
- # downloading and compiling source.
+ # The tag sets that will go into the actions_elem_list are those that install a compiled binary if
+ # the architecture and operating system match it's defined attributes. If compiled binary is not
+ # installed, the first <actions> tag set [following those that have the os and architecture attributes]
+ # that does not have os or architecture attributes will be processed. This tag set must contain the
+ # recipe for downloading and compiling source.
actions_elem_list = []
for elem in package_elem:
if elem.tag == 'actions':
- # We have an <actions> tag that should not be matched against a specific combination of architecture and operating system.
+ # We have an <actions> tag that should not be matched against a specific combination of
+ # architecture and operating system.
in_actions_group = False
actions_elem_tuples.append( ( in_actions_group, elem ) )
elif elem.tag == 'actions_group':
- # We have an actions_group element, and its child <actions> elements should therefore be compared with the current operating system
+ # We have an actions_group element, and its child <actions> elements should therefore be compared
+ # with the current operating system
# and processor architecture.
in_actions_group = True
- # Record the number of <actions> elements so we can filter out any <action> elements that precede <actions> elements.
+ # Record the number of <actions> elements so we can filter out any <action> elements that precede
+ # <actions> elements.
actions_elem_count = len( elem.findall( 'actions' ) )
- # Record the number of <actions> elements that have both architecture and os specified, in order to filter out any
- # platform-independent <actions> elements that come before platform-specific <actions> elements.
+ # Record the number of <actions> elements that have both architecture and os specified, in order
+ # to filter out any platform-independent <actions> elements that come before platform-specific
+ # <actions> elements.
platform_actions_elements = []
for actions_elem in elem.findall( 'actions' ):
if actions_elem.get( 'architecture' ) is not None and actions_elem.get( 'os' ) is not None:
@@ -356,8 +362,9 @@
platform_actions_element_count = len( platform_actions_elements )
platform_actions_elements_processed = 0
actions_elems_processed = 0
- # The tag sets that will go into the after_install_actions list are <action> tags instead of <actions> tags. These will be processed
- # only if they are at the very end of the <actions_group> tag set (after all <actions> tag sets). See below for details.
+ # The tag sets that will go into the after_install_actions list are <action> tags instead of <actions>
+ # tags. These will be processed only if they are at the very end of the <actions_group> tag set (after
+ # all <actions> tag sets). See below for details.
after_install_actions = []
# Inspect the <actions_group> element and build the actions_elem_list and the after_install_actions list.
for child_element in elem:
@@ -365,60 +372,71 @@
actions_elems_processed += 1
system = child_element.get( 'os' )
architecture = child_element.get( 'architecture' )
- # Skip <actions> tags that have only one of architecture or os specified, in order for the count in
- # platform_actions_elements_processed to remain accurate.
+ # Skip <actions> tags that have only one of architecture or os specified, in order for the
+ # count in platform_actions_elements_processed to remain accurate.
if ( system and not architecture ) or ( architecture and not system ):
log.debug( 'Error: Both architecture and os attributes must be specified in an <actions> tag.' )
continue
- # Since we are inside an <actions_group> tag set, compare it with our current platform information and filter the <actions>
- # tag sets that don't match. Require both the os and architecture attributes to be defined in order to find a match.
+ # Since we are inside an <actions_group> tag set, compare it with our current platform information
+ # and filter the <actions> tag sets that don't match. Require both the os and architecture attributes
+ # to be defined in order to find a match.
if system and architecture:
platform_actions_elements_processed += 1
- # If either the os or architecture do not match the platform, this <actions> tag will not be considered a match. Skip
- # it and proceed with checking the next one.
+ # If either the os or architecture do not match the platform, this <actions> tag will not be
+ # considered a match. Skip it and proceed with checking the next one.
if platform_info_dict:
if platform_info_dict[ 'os' ] != system or platform_info_dict[ 'architecture' ] != architecture:
continue
else:
- # We must not be installing a repository into Galaxy, so determining if we can install a binary is not necessary.
+ # We must not be installing a repository into Galaxy, so determining if we can install a
+ # binary is not necessary.
continue
else:
- # <actions> tags without both os and architecture attributes are only allowed to be specified after platform-specific
- # <actions> tags. If we find a platform-independent <actions> tag before all platform-specific <actions> tags have been
- # processed.
+ # <actions> tags without both os and architecture attributes are only allowed to be specified
+ # after platform-specific <actions> tags. If we find a platform-independent <actions> tag before
+ # all platform-specific <actions> tags have been processed.
if platform_actions_elements_processed < platform_actions_element_count:
- message = 'Error: <actions> tags without os and architecture attributes are only allowed after all <actions> tags with '
- message += 'os and architecture attributes have been defined. Skipping the <actions> tag set with no os or architecture '
- message += 'attributes that has been defined between two <actions> tag sets that have these attributes defined. '
- log.debug( message )
+ debug_msg = 'Error: <actions> tags without os and architecture attributes are only allowed '
+ debug_msg += 'after all <actions> tags with os and architecture attributes have been defined. '
+ debug_msg += 'Skipping the <actions> tag set with no os or architecture attributes that has '
+ debug_msg += 'been defined between two <actions> tag sets that have these attributes defined. '
+ log.debug( debug_msg )
continue
- # If we reach this point, it means one of two things: 1) The system and architecture attributes are not defined in this
- # <actions> tag, or 2) The system and architecture attributes are defined, and they are an exact match for the current
- # platform. Append the child element to the list of elements to process.
+ # If we reach this point, it means one of two things: 1) The system and architecture attributes are
+ # not defined in this <actions> tag, or 2) The system and architecture attributes are defined, and
+ # they are an exact match for the current platform. Append the child element to the list of elements
+ # to process.
actions_elem_list.append( child_element )
elif child_element.tag == 'action':
# Any <action> tags within an <actions_group> tag set must come after all <actions> tags.
if actions_elems_processed == actions_elem_count:
- # If all <actions> elements have been processed, then this <action> element can be appended to the list of actions to
- # execute within this group.
+ # If all <actions> elements have been processed, then this <action> element can be appended to the
+ # list of actions to execute within this group.
after_install_actions.append( child_element )
else:
- # If any <actions> elements remain to be processed, then log a message stating that <action> elements are not allowed
- # to precede any <actions> elements within an <actions_group> tag set.
- message = 'Error: <action> tags are only allowed at the end of an <actions_group> tag set after all <actions> tags. '
- message += 'Skipping <%s> element with type %s.' % ( child_element.tag, child_element.get( 'type' ) )
- log.debug( message )
+ # If any <actions> elements remain to be processed, then log a message stating that <action>
+ # elements are not allowed to precede any <actions> elements within an <actions_group> tag set.
+ debug_msg = 'Error: <action> tags are only allowed at the end of an <actions_group> tag set after '
+ debug_msg += 'all <actions> tags. Skipping <%s> element with type %s.' % \
+ ( child_element.tag, child_element.get( 'type', 'unknown' ) )
+ log.debug( debug_msg )
continue
if platform_info_dict is None and not include_after_install_actions:
# We must be setting metadata on a repository.
- actions_elem_tuples.append( ( in_actions_group, actions_elem_list[ 0 ] ) )
+ if len( actions_elem_list ) >= 1:
+ actions_elem_tuples.append( ( in_actions_group, actions_elem_list[ 0 ] ) )
+ else:
+ # We are processing a recipe that contains only an <actions_group> tag set for installing a binary,
+ # but does not include an additional recipe for installing and compiling from source.
+ actions_elem_tuples.append( ( in_actions_group, [] ) )
elif platform_info_dict is not None and include_after_install_actions:
# We must be installing a repository.
if after_install_actions:
actions_elem_list.extend( after_install_actions )
actions_elem_tuples.append( ( in_actions_group, actions_elem_list ) )
else:
- # Skip any element that is not <actions> or <actions_group> - this will skip comments, <repository> tags and <readme> tags.
+ # Skip any element that is not <actions> or <actions_group> - this will skip comments, <repository> tags
+ # and <readme> tags.
in_actions_group = False
continue
return actions_elem_tuples
diff -r 79c1a31e269d4668d125c1a277549617d34dae13 -r 82b5aef7a1da9e4129ba2a3920a54048642cc991 lib/tool_shed/util/metadata_util.py
--- a/lib/tool_shed/util/metadata_util.py
+++ b/lib/tool_shed/util/metadata_util.py
@@ -791,26 +791,30 @@
if sub_elem.tag == 'readme':
requirements_dict[ 'readme' ] = sub_elem.text
elif sub_elem.tag == 'repository':
- # We have a complex repository dependency. If the returned value of repository_dependency_is_valid is True, the tool
- # dependency definition will be set as invalid. This is currently the only case where a tool dependency definition is
- # considered invalid.
- repository_dependency_tup, repository_dependency_is_valid, error_message = handle_repository_elem( app=app,
- repository_elem=sub_elem,
- only_if_compiling_contained_td=False )
+ # We have a complex repository dependency. If the returned value of repository_dependency_is_valid
+ # is True, the tool dependency definition will be set as invalid. This is currently the only case
+ # where a tool dependency definition is considered invalid.
+ repository_dependency_tup, repository_dependency_is_valid, error_message = \
+ handle_repository_elem( app=app, repository_elem=sub_elem, only_if_compiling_contained_td=False )
elif sub_elem.tag == 'install':
package_install_version = sub_elem.get( 'version', '1.0' )
if package_install_version == '1.0':
- # Complex repository dependencies can be defined within the last <actions> tag set contained in an <actions_group> tag set.
- # Comments, <repository> tag sets and <readme> tag sets will be skipped in td_common_util.parse_package_elem().
- actions_elem_tuples = td_common_util.parse_package_elem( sub_elem, platform_info_dict=None, include_after_install_actions=False )
+ # Complex repository dependencies can be defined within the last <actions> tag set contained in an
+ # <actions_group> tag set. Comments, <repository> tag sets and <readme> tag sets will be skipped
+ # in td_common_util.parse_package_elem().
+ actions_elem_tuples = td_common_util.parse_package_elem( sub_elem,
+ platform_info_dict=None,
+ include_after_install_actions=False )
if actions_elem_tuples:
- # We now have a list of a single tuple that looks something like: [(True, <Element 'actions' at 0x104017850>)]
+ # We now have a list of a single tuple that looks something like:
+ # [(True, <Element 'actions' at 0x104017850>)]
actions_elem_tuple = actions_elem_tuples[ 0 ]
in_actions_group, actions_elem = actions_elem_tuple
if in_actions_group:
- # Since we're inside an <actions_group> tag set, inspect the actions_elem to see if a complex repository dependency
- # is defined. By definition, complex repository dependency definitions contained within the last <actions> tag set
- # within an <actions_group> tag set will have the value of "only_if_compiling_contained_td" set to True in
+ # Since we're inside an <actions_group> tag set, inspect the actions_elem to see if a complex
+ # repository dependency is defined. By definition, complex repository dependency definitions
+ # contained within the last <actions> tag set within an <actions_group> tag set will have the
+ # value of "only_if_compiling_contained_td" set to True in
for action_elem in actions_elem:
if action_elem.tag == 'package':
# <package name="libgtextutils" version="0.6">
@@ -834,7 +838,8 @@
# Append the error message to the requirements_dict.
requirements_dict[ 'error' ] = error_message
invalid_tool_dependencies_dict[ dependency_key ] = requirements_dict
- return valid_tool_dependencies_dict, invalid_tool_dependencies_dict, repository_dependency_tup, repository_dependency_is_valid, error_message
+ return valid_tool_dependencies_dict, invalid_tool_dependencies_dict, repository_dependency_tup, \
+ repository_dependency_is_valid, error_message
def generate_repository_dependency_metadata( app, repository_dependencies_config, metadata_dict ):
"""
@@ -1986,7 +1991,8 @@
content_alert_str=content_alert_str,
**kwd )
if error_message:
- # FIXME: This probably should not redirect since this method is called from the upload controller as well as the repository controller.
+ # FIXME: This probably should not redirect since this method is called from the upload controller as well
+ # as the repository controller.
# If there is an error, display it.
return trans.response.send_redirect( web.url_for( controller='repository',
action='manage_repository',
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: library history ‘back’ button bug removal
by commits-noreply@bitbucket.org 17 Jan '14
by commits-noreply@bitbucket.org 17 Jan '14
17 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/79c1a31e269d/
Changeset: 79c1a31e269d
User: martenson
Date: 2014-01-17 18:19:04
Summary: library history ‘back’ button bug removal
Affected #: 3 files
diff -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae -r 79c1a31e269d4668d125c1a277549617d34dae13 lib/galaxy/webapps/galaxy/api/authenticate.py
--- a/lib/galaxy/webapps/galaxy/api/authenticate.py
+++ b/lib/galaxy/webapps/galaxy/api/authenticate.py
@@ -22,8 +22,8 @@
* GET /api/authenticate/baseauth
returns an API key for authenticated user based on BaseAuth headers
+ :returns: api_key in json format
:rtype: dict
- :returns: api_key in json format
:raises: ObjectNotFound, HTTPBadRequest
"""
@@ -48,9 +48,20 @@
return dict( api_key= api_key_row.key )
def _decode_baseauth( self, encoded_str ):
- """Decode an encrypted HTTP basic authentication string. Returns a tuple of
+ """
+ Decode an encrypted HTTP basic authentication string. Returns a tuple of
the form (email, password), and raises a HTTPBadRequest exception if
nothing could be decoded.
+
+ :param encoded_str: BaseAuth string encoded base64
+ :type encoded_str: string
+
+ :returns: email of the user
+ :rtype: string
+ :returns: password of the user
+ :rtype: string
+
+ :raises: HTTPBadRequest
"""
split = encoded_str.strip().split( ' ' )
diff -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae -r 79c1a31e269d4668d125c1a277549617d34dae13 static/scripts/galaxy.library.js
--- a/static/scripts/galaxy.library.js
+++ b/static/scripts/galaxy.library.js
@@ -406,9 +406,9 @@
if (typeof folder_id === 'undefined') {
return false;
} else if (folder_id === '0'){
- library_router.navigate('#', {trigger: true, replace: true});
+ library_router.navigate('/', {trigger: true, replace: false});
} else {
- library_router.navigate('folders/' + folder_id, {trigger: true, replace: true});
+ library_router.navigate('folders/' + folder_id, {trigger: true, replace: false});
}
},
@@ -984,9 +984,9 @@
}
});
-Backbone.history.start();
+Backbone.history.start({pushState: false});
-return this
+// return this
}
});
diff -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae -r 79c1a31e269d4668d125c1a277549617d34dae13 static/scripts/packed/galaxy.library.js
--- a/static/scripts/packed/galaxy.library.js
+++ b/static/scripts/packed/galaxy.library.js
@@ -1,1 +1,1 @@
-var view=null;var library_router=null;var responses=[];define(["galaxy.modal","galaxy.masthead","utils/galaxy.utils","libs/toastr"],function(k,l,h,n){var f=Backbone.Model.extend({urlRoot:"/api/libraries"});var c=Backbone.Model.extend({urlRoot:"/api/folders"});var o=Backbone.Collection.extend({url:"/api/libraries",model:f});var i=Backbone.Model.extend({urlRoot:"/api/libraries/datasets"});var d=Backbone.Collection.extend({model:i});var e=Backbone.Model.extend({defaults:{folder:new d(),full_path:"unknown",urlRoot:"/api/folders/",id:"unknown"},parse:function(r){this.full_path=r[0].full_path;this.get("folder").reset(r[1].folder_contents);return r}});var b=Backbone.Model.extend({urlRoot:"/api/histories/"});var j=Backbone.Model.extend({url:"/api/histories/"});var p=Backbone.Collection.extend({url:"/api/histories",model:j});var q=Backbone.Router.extend({routes:{"":"libraries","folders/:id":"folder_content","folders/:folder_id/download/:format":"download"}});var m=Backbone.View.extend({el:"#center",progress:0,progressStep:1,lastSelectedHistory:"",modal:null,folders:null,initialize:function(){this.folders=[];this.queue=jQuery.Deferred();this.queue.resolve()},templateFolder:function(){var r=[];r.push('<div id="library_container" style="width: 90%; margin: auto; margin-top: 2em; ">');r.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>');r.push('<div id="library_folder_toolbar" >');r.push(' <button title="Create New Folder" id="toolbtn_create_folder" class="btn btn-primary" type="button"><span class="fa fa-plus"></span><span class="fa fa-folder-close"></span> folder</button>');r.push(' <button id="toolbtn_bulk_import" class="btn btn-primary" style="display: none; margin-left: 0.5em;" type="button"><span class="fa fa-external-link"></span> to history</button>');r.push(' <div id="toolbtn_dl" class="btn-group" style="margin-left: 0.5em; display: none; ">');r.push(' <button id="drop_toggle" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">');r.push(' <span class="fa fa-download"></span> download <span class="caret"></span>');r.push(" </button>");r.push(' <ul class="dropdown-menu" role="menu">');r.push(' <li><a href="#/folders/<%= id %>/download/tgz">.tar.gz</a></li>');r.push(' <li><a href="#/folders/<%= id %>/download/tbz">.tar.bz</a></li>');r.push(' <li><a href="#/folders/<%= id %>/download/zip">.zip</a></li>');r.push(" </ul>");r.push(" </div>");r.push("</div>");r.push('<div class="library_breadcrumb">');r.push('<a title="Return to the list of libraries" href="#">Libraries</a><b>|</b> ');r.push("<% _.each(path, function(path_item) { %>");r.push("<% if (path_item[0] != id) { %>");r.push('<a title="Return to this folder" href="#/folders/<%- path_item[0] %>"><%- path_item[1] %></a><b>|</b> ');r.push("<% } else { %>");r.push('<span title="You are in this folder"><%- path_item[1] %></span>');r.push("<% } %>");r.push("<% }); %>");r.push("</div>");r.push('<table id="folder_table" class="table table-condensed">');r.push(" <thead>");r.push(' <th style="text-align: center; width: 20px; "><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');r.push(' <th class="button_heading">view</th>');r.push(" <th>name</th>");r.push(" <th>data type</th>");r.push(" <th>size</th>");r.push(" <th>date (UTC)</th>");r.push(" </thead>");r.push(" <tbody>");r.push(" <td></td>");r.push(' <td><button title="Go to parent folder" type="button" data-id="<%- upper_folder_id %>" class="btn_open_folder btn btn-default btn-xs">');r.push(' <span class="fa fa-arrow-up"></span> .. go up</td>');r.push(" <td></td>");r.push(" <td></td>");r.push(" <td></td>");r.push(" <td></td>");r.push(" </tr>");r.push(" <% _.each(items, function(content_item) { %>");r.push(' <tr class="folder_row light" id="<%- content_item.id %>">');r.push(' <% if (content_item.get("type") === "folder") { %>');r.push(" <td></td>");r.push(' <td><button title="Open this folder" type="button" data-id="<%- content_item.id %>" class="btn_open_folder btn btn-default btn-xs">');r.push(' <span class="fa fa-folder-open"></span> browse</td>');r.push(' <td><%- content_item.get("name") %>');r.push(' <% if (content_item.get("item_count") === 0) { %>');r.push(' <span class="muted">(empty folder)</span>');r.push(" <% } %>");r.push(" </td>");r.push(" <td>folder</td>");r.push(' <td><%= _.escape(content_item.get("item_count")) %> item(s)</td>');r.push(" <% } else { %>");r.push(' <td style="text-align: center; "><input style="margin: 0;" type="checkbox"></td>');r.push(" <td>");r.push(' <button title="See details of this dataset" type="button" class="library-dataset btn btn-default btn-xs">');r.push(' <span class="fa fa-eye"></span> details');r.push(" </button>");r.push(" </td>");r.push(' <td><%- content_item.get("name") %></td>');r.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');r.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');r.push(" <% } %> ");r.push(' <td><%= _.escape(content_item.get("time_updated")) %></td>');r.push(" </tr>");r.push(" <% }); %>");r.push(" ");r.push(" </tbody>");r.push("</table>");r.push("</div>");return r.join("")},templateDatasetModal:function(){var r=[];r.push('<div id="dataset_info_modal">');r.push(' <table class="table table-striped table-condensed">');r.push(" <tr>");r.push(' <th scope="row" id="id_row" data-id="<%= _.escape(item.get("ldda_id")) %>">Name</th>');r.push(' <td><%= _.escape(item.get("name")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Data type</th>');r.push(' <td><%= _.escape(item.get("data_type")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Genome build</th>');r.push(' <td><%= _.escape(item.get("genome_build")) %></td>');r.push(" </tr>");r.push(' <th scope="row">Size</th>');r.push(" <td><%= _.escape(size) %></td>");r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Date uploaded (UTC)</th>');r.push(' <td><%= _.escape(item.get("date_uploaded")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Uploaded by</th>');r.push(' <td><%= _.escape(item.get("uploaded_by")) %></td>');r.push(" </tr>");r.push(' <tr scope="row">');r.push(' <th scope="row">Data Lines</th>');r.push(' <td scope="row"><%= _.escape(item.get("metadata_data_lines")) %></td>');r.push(" </tr>");r.push(' <th scope="row">Comment Lines</th>');r.push(' <% if (item.get("metadata_comment_lines") === "") { %>');r.push(' <td scope="row"><%= _.escape(item.get("metadata_comment_lines")) %></td>');r.push(" <% } else { %>");r.push(' <td scope="row">unknown</td>');r.push(" <% } %>");r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Number of Columns</th>');r.push(' <td scope="row"><%= _.escape(item.get("metadata_columns")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Column Types</th>');r.push(' <td scope="row"><%= _.escape(item.get("metadata_column_types")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Miscellaneous information</th>');r.push(' <td scope="row"><%= _.escape(item.get("misc_blurb")) %></td>');r.push(" </tr>");r.push(" </table>");r.push(' <pre class="peek">');r.push(" </pre>");r.push("</div>");return r.join("")},templateHistorySelectInModal:function(){var r=[];r.push('<span id="history_modal_combo" style="width:90%; margin-left: 1em; margin-right: 1em; ">');r.push("Select history: ");r.push('<select id="dataset_import_single" name="dataset_import_single" style="width:50%; margin-bottom: 1em; "> ');r.push(" <% _.each(histories, function(history) { %>");r.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');r.push(" <% }); %>");r.push("</select>");r.push("</span>");return r.join("")},templateBulkImportInModal:function(){var r=[];r.push('<span id="history_modal_combo_bulk" style="width:90%; margin-left: 1em; margin-right: 1em; ">');r.push("Select history: ");r.push('<select id="dataset_import_bulk" name="dataset_import_bulk" style="width:50%; margin-bottom: 1em; "> ');r.push(" <% _.each(histories, function(history) { %>");r.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');r.push(" <% }); %>");r.push("</select>");r.push("</span>");return r.join("")},templateProgressBar:function(){var r=[];r.push('<div class="import_text">');r.push("Importing selected datasets to history <b><%= _.escape(history_name) %></b>");r.push("</div>");r.push('<div class="progress">');r.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');r.push(' <span class="completion_span">0% Complete</span>');r.push(" </div>");r.push("</div>");r.push("");return r.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 tmpl_array.join("")},events:{"click #select-all-checkboxes":"selectAll","click .folder_row":"selectClickedRow","click #toolbtn_bulk_import":"modalBulkImport","click #toolbtn_dl":"bulkDownload","click .library-dataset":"showDatasetDetails","click #toolbtn_create_folder":"createFolderFromModal","click .btn_open_folder":"navigateToFolder"},render:function(r){$("#center").css("overflow","auto");view=this;var t=this;var s=new e({id:r.id});s.url=s.attributes.urlRoot+r.id+"/contents";s.fetch({success:function(u){for(var w=0;w<s.attributes.folder.models.length;w++){var v=s.attributes.folder.models[w];if(v.get("type")==="file"){v.set("readable_size",t.size_to_string(v.get("file_size")))}}var y=s.full_path;var z;if(y.length===1){z=0}else{z=y[y.length-2][0]}var x=_.template(t.templateFolder(),{path:s.full_path,items:s.attributes.folder.models,id:r.id,upper_folder_id:z});t.$el.html(x)},error:function(){n.error("An error occured :(")}})},size_to_string:function(r){var s="";if(r>=100000000000){r=r/100000000000;s="TB"}else{if(r>=100000000){r=r/100000000;s="GB"}else{if(r>=100000){r=r/100000;s="MB"}else{if(r>=100){r=r/100;s="KB"}else{r=r*10;s="b"}}}}return(Math.round(r)/10)+s},navigateToFolder:function(s){var r=$(s.target).attr("data-id");if(typeof r==="undefined"){return false}else{if(r==="0"){library_router.navigate("#",{trigger:true,replace:true})}else{library_router.navigate("folders/"+r,{trigger:true,replace:true})}}},showDatasetDetails:function(u){u.preventDefault();var v=$(u.target).parent().parent().attr("id");var t=new i();var s=new p();t.id=v;var r=this;t.fetch({success:function(w){s.fetch({success:function(x){r.renderModalAfterFetch(w,x)},error:function(){n.error("An error occured during fetching histories:(");r.renderModalAfterFetch(w)}})},error:function(){n.error("An error occured during loading dataset details :(")}})},renderModalAfterFetch:function(w,t){var u=this.size_to_string(w.get("file_size"));var v=_.template(this.templateDatasetModal(),{item:w,size:u});var s=this;this.modal=new k.GalaxyModal({destructible:true,bindClosingEvents:true,title:"Dataset Details",body:v,buttons:{Import:function(){s.importCurrentIntoHistory()},Download:function(){s.downloadCurrent()},Close:function(){s.modal.hideOrDestroy()}}});$(".peek").html(w.get("peek"));if(typeof history.models!==undefined){var r=_.template(this.templateHistorySelectInModal(),{histories:t.models});$(this.modal.elMain).find(".buttons").prepend(r);if(s.lastSelectedHistory.length>0){$(this.modal.elMain).find("#dataset_import_single").val(s.lastSelectedHistory)}}this.modal.show()},downloadCurrent:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var r=[];r.push($("#id_row").attr("data-id"));var s="/api/libraries/datasets/download/uncompressed";var t={ldda_ids:r};folderContentView.processDownload(s,t);this.modal.enableButton("Import");this.modal.enableButton("Download")},importCurrentIntoHistory:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var t=$(this.modal.elMain).find("select[name=dataset_import_single] option:selected").val();this.lastSelectedHistory=t;var r=$("#id_row").attr("data-id");var u=new b();var s=this;u.url=u.urlRoot+t+"/contents";u.save({content:r,source:"library"},{success:function(){n.success("Dataset imported");s.modal.enableButton("Import");s.modal.enableButton("Download")},error:function(){n.error("An error occured! Dataset not imported. Please try again.");s.modal.enableButton("Import");s.modal.enableButton("Download")}})},selectAll:function(s){var r=s.target.checked;that=this;$(":checkbox").each(function(){this.checked=r;$row=$(this.parentElement.parentElement);(r)?that.makeDarkRow($row):that.makeWhiteRow($row)});this.checkTools()},selectClickedRow:function(s){var u="";var r;var t;if(s.target.localName==="input"){u=s.target;r=$(s.target.parentElement.parentElement);t="input"}else{if(s.target.localName==="td"){u=$("#"+s.target.parentElement.id).find(":checkbox")[0];r=$(s.target.parentElement);t="td"}}if(u===""){s.stopPropagation();return}if(u===undefined){s.stopPropagation();return}if(u.checked){if(t==="td"){u.checked="";this.makeWhiteRow(r)}else{if(t==="input"){this.makeDarkRow(r)}}}else{if(t==="td"){u.checked="selected";this.makeDarkRow(r)}else{if(t==="input"){this.makeWhiteRow(r)}}}this.checkTools()},makeDarkRow:function(r){r.removeClass("light");r.find("a").removeClass("light");r.addClass("dark");r.find("a").addClass("dark")},makeWhiteRow:function(r){r.removeClass("dark");r.find("a").removeClass("dark");r.addClass("light");r.find("a").addClass("light")},checkTools:function(){var r=$("#folder_table").find(":checked");if(r.length>0){$("#toolbtn_bulk_import").show();$("#toolbtn_dl").show()}else{$("#toolbtn_bulk_import").hide();$("#toolbtn_dl").hide()}},modalBulkImport:function(){var s=this;var r=new p();r.fetch({success:function(t){var u=_.template(s.templateBulkImportInModal(),{histories:t.models});s.modal=new k.GalaxyModal({destructible:true,bindClosingEvents:true,title:"Import into History",body:u,buttons:{Import:function(){s.importAllIntoHistory()},Close:function(){s.modal.hideOrDestroy()}}});s.modal.show()},error:function(){n.error("An error occured :(")}})},importAllIntoHistory:function(){this.modal.disableButton("Import");var t=$("select[name=dataset_import_bulk] option:selected").val();var x=$("select[name=dataset_import_bulk] option:selected").text();var z=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!=""){z.push(this.parentElement.parentElement.id)}});var y=_.template(this.templateProgressBar(),{history_name:x});$(this.modal.elMain).find(".modal-body").html(y);var u=100/z.length;this.initProgress(u);var r=[];for(var s=z.length-1;s>=0;s--){library_dataset_id=z[s];var v=new b();var w=this;v.url=v.urlRoot+t+"/contents";v.content=library_dataset_id;v.source="library";r.push(v)}this.chainCall(r)},chainCall:function(s){var r=this;var t=s.pop();if(typeof t==="undefined"){n.success("All datasets imported");this.modal.hideOrDestroy();return}var u=$.when(t.save({content:t.content,source:t.source})).done(function(v){r.updateProgress();responses.push(v);r.chainCall(s)})},initProgress:function(r){this.progress=0;this.progressStep=r},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(r,v){var t=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!=""){t.push(this.parentElement.parentElement.id)}});var s="/api/libraries/datasets/download/"+v;var u={ldda_ids:t};this.processDownload(s,u,"get")},processDownload:function(s,t,u){if(s&&t){t=typeof t=="string"?t:$.param(t);var r="";$.each(t.split("&"),function(){var v=this.split("=");r+='<input type="hidden" name="'+v[0]+'" value="'+v[1]+'" />'});$('<form action="'+s+'" method="'+(u||"post")+'">'+r+"</form>").appendTo("body").submit().remove();n.info("Your download will begin soon")}},createFolderFromModal:function(){event.preventDefault();event.stopPropagation();var r=this;this.modal=new k.GalaxyModal({destructible:true,bindClosingEvents:true,title:"Create New Folder",body:this.templateNewFolderInModal(),buttons:{Create:function(){r.create_new_folder_event()},Close:function(){r.modal.hideOrDestroy();r.modal=null}}});this.modal.show()},create_new_folder_event:function(){var r=this.serialize_new_folder();if(this.validate_new_folder(r)){var t=new c();url_items=Backbone.history.fragment.split("/");current_folder_id=url_items[url_items.length-1];t.url=t.urlRoot+"/"+current_folder_id;var s=this;t.save(r,{success:function(u){s.modal.hideOrDestroy();n.success("Folder created");s.render({id:current_folder_id})},error:function(){n.error("An error occured :(")}})}else{n.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(r){return r.name!==""}});var a=Backbone.View.extend({el:"#center",events:{"click #create_new_library_btn":"show_library_modal"},initialize:function(){},templateLibraryList:function(){tmpl_array=[];tmpl_array.push('<div id="library_container" style="width: 90%; margin: auto; margin-top: 2em; overflow: auto !important; ">');tmpl_array.push("");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('<a href="" id="create_new_library_btn" class="btn btn-primary file ">New Library</a>');tmpl_array.push('<table class="table table-condensed">');tmpl_array.push(" <thead>");tmpl_array.push(' <th class="button_heading"></th>');tmpl_array.push(" <th>name</th>");tmpl_array.push(" <th>description</th>");tmpl_array.push(" <th>synopsis</th> ");tmpl_array.push(" <th>model type</th> ");tmpl_array.push(" </thead>");tmpl_array.push(" <tbody>");tmpl_array.push(" <% _.each(libraries, function(library) { %>");tmpl_array.push(" <tr>");tmpl_array.push(' <td><button title="Open this library" type="button" data-id="<%- library.get("root_folder_id") %>" class="btn_open_folder btn btn-default btn-xs">');tmpl_array.push(' <span class="fa fa-folder-open"></span> browse</td>');tmpl_array.push(' <td><%- library.get("name") %></td>');tmpl_array.push(' <td><%= _.escape(library.get("description")) %></td>');tmpl_array.push(' <td><%= _.escape(library.get("synopsis")) %></td>');tmpl_array.push(' <td><%= _.escape(library.get("model_class")) %></td>');tmpl_array.push(" </tr>");tmpl_array.push(" <% }); %>");tmpl_array.push(" </tbody>");tmpl_array.push("</table>");tmpl_array.push("</div>");return tmpl_array.join("")},templateNewLibraryInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_library_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(' <input type="text" name="Synopsis" value="" placeholder="Synopsis">');tmpl_array.push(" </form>");tmpl_array.push("</div>");return tmpl_array.join("")},render:function(){$("#center").css("overflow","auto");var r=this;libraries=new o();libraries.fetch({success:function(s){var t=_.template(r.templateLibraryList(),{libraries:s.models});r.$el.html(t)},error:function(t,s){if(s.statusCode().status===403){n.info("Please log in first. Redirecting to login page in 3s.");setTimeout(r.redirectToLogin,3000)}else{n.error("An error occured. Please try again.")}}})},redirectToHome:function(){window.location="../"},redirectToLogin:function(){window.location="/user/login"},modal:null,show_library_modal:function(s){s.preventDefault();s.stopPropagation();var r=this;this.modal=new k.GalaxyModal({destructible:true,bindClosingEvents:true,title:"Create New Library",body:this.templateNewLibraryInModal(),buttons:{Create:function(){r.create_new_library_event()},Close:function(){r.modal.hideOrDestroy()}}});this.modal.show()},create_new_library_event:function(){var t=this.serialize_new_library();if(this.validate_new_library(t)){var s=new f();var r=this;s.save(t,{success:function(u){r.modal.hideOrDestroy();r.clear_library_modal();r.render();n.success("Library created")},error:function(){n.error("An error occured :(")}})}else{n.error("Library's name is missing")}return false},clear_library_modal:function(){$("input[name='Name']").val("");$("input[name='Description']").val("");$("input[name='Synopsis']").val("")},serialize_new_library:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val(),synopsis:$("input[name='Synopsis']").val()}},validate_new_library:function(r){return r.name!==""}});var g=Backbone.View.extend({folderContentView:null,galaxyLibraryview:null,initialize:function(){folderContentView=new m();galaxyLibraryview=new a();library_router=new q();library_router.on("route:libraries",function(){galaxyLibraryview.render()});library_router.on("route:folder_content",function(r){folderContentView.render({id:r})});library_router.on("route:download",function(r,s){if($("#center").find(":checked").length===0){library_router.navigate("folders/"+r,{trigger:true,replace:true})}else{folderContentView.download(r,s);library_router.navigate("folders/"+r,{trigger:false,replace:true})}});Backbone.history.start();return this}});return{GalaxyApp:g}});
\ No newline at end of file
+var view=null;var library_router=null;var responses=[];define(["galaxy.modal","galaxy.masthead","utils/galaxy.utils","libs/toastr"],function(k,l,h,n){var f=Backbone.Model.extend({urlRoot:"/api/libraries"});var c=Backbone.Model.extend({urlRoot:"/api/folders"});var o=Backbone.Collection.extend({url:"/api/libraries",model:f});var i=Backbone.Model.extend({urlRoot:"/api/libraries/datasets"});var d=Backbone.Collection.extend({model:i});var e=Backbone.Model.extend({defaults:{folder:new d(),full_path:"unknown",urlRoot:"/api/folders/",id:"unknown"},parse:function(r){this.full_path=r[0].full_path;this.get("folder").reset(r[1].folder_contents);return r}});var b=Backbone.Model.extend({urlRoot:"/api/histories/"});var j=Backbone.Model.extend({url:"/api/histories/"});var p=Backbone.Collection.extend({url:"/api/histories",model:j});var q=Backbone.Router.extend({routes:{"":"libraries","folders/:id":"folder_content","folders/:folder_id/download/:format":"download"}});var m=Backbone.View.extend({el:"#center",progress:0,progressStep:1,lastSelectedHistory:"",modal:null,folders:null,initialize:function(){this.folders=[];this.queue=jQuery.Deferred();this.queue.resolve()},templateFolder:function(){var r=[];r.push('<div id="library_container" style="width: 90%; margin: auto; margin-top: 2em; ">');r.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>');r.push('<div id="library_folder_toolbar" >');r.push(' <button title="Create New Folder" id="toolbtn_create_folder" class="btn btn-primary" type="button"><span class="fa fa-plus"></span><span class="fa fa-folder-close"></span> folder</button>');r.push(' <button id="toolbtn_bulk_import" class="btn btn-primary" style="display: none; margin-left: 0.5em;" type="button"><span class="fa fa-external-link"></span> to history</button>');r.push(' <div id="toolbtn_dl" class="btn-group" style="margin-left: 0.5em; display: none; ">');r.push(' <button id="drop_toggle" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">');r.push(' <span class="fa fa-download"></span> download <span class="caret"></span>');r.push(" </button>");r.push(' <ul class="dropdown-menu" role="menu">');r.push(' <li><a href="#/folders/<%= id %>/download/tgz">.tar.gz</a></li>');r.push(' <li><a href="#/folders/<%= id %>/download/tbz">.tar.bz</a></li>');r.push(' <li><a href="#/folders/<%= id %>/download/zip">.zip</a></li>');r.push(" </ul>");r.push(" </div>");r.push("</div>");r.push('<div class="library_breadcrumb">');r.push('<a title="Return to the list of libraries" href="#">Libraries</a><b>|</b> ');r.push("<% _.each(path, function(path_item) { %>");r.push("<% if (path_item[0] != id) { %>");r.push('<a title="Return to this folder" href="#/folders/<%- path_item[0] %>"><%- path_item[1] %></a><b>|</b> ');r.push("<% } else { %>");r.push('<span title="You are in this folder"><%- path_item[1] %></span>');r.push("<% } %>");r.push("<% }); %>");r.push("</div>");r.push('<table id="folder_table" class="table table-condensed">');r.push(" <thead>");r.push(' <th style="text-align: center; width: 20px; "><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');r.push(' <th class="button_heading">view</th>');r.push(" <th>name</th>");r.push(" <th>data type</th>");r.push(" <th>size</th>");r.push(" <th>date (UTC)</th>");r.push(" </thead>");r.push(" <tbody>");r.push(" <td></td>");r.push(' <td><button title="Go to parent folder" type="button" data-id="<%- upper_folder_id %>" class="btn_open_folder btn btn-default btn-xs">');r.push(' <span class="fa fa-arrow-up"></span> .. go up</td>');r.push(" <td></td>");r.push(" <td></td>");r.push(" <td></td>");r.push(" <td></td>");r.push(" </tr>");r.push(" <% _.each(items, function(content_item) { %>");r.push(' <tr class="folder_row light" id="<%- content_item.id %>">');r.push(' <% if (content_item.get("type") === "folder") { %>');r.push(" <td></td>");r.push(' <td><button title="Open this folder" type="button" data-id="<%- content_item.id %>" class="btn_open_folder btn btn-default btn-xs">');r.push(' <span class="fa fa-folder-open"></span> browse</td>');r.push(' <td><%- content_item.get("name") %>');r.push(' <% if (content_item.get("item_count") === 0) { %>');r.push(' <span class="muted">(empty folder)</span>');r.push(" <% } %>");r.push(" </td>");r.push(" <td>folder</td>");r.push(' <td><%= _.escape(content_item.get("item_count")) %> item(s)</td>');r.push(" <% } else { %>");r.push(' <td style="text-align: center; "><input style="margin: 0;" type="checkbox"></td>');r.push(" <td>");r.push(' <button title="See details of this dataset" type="button" class="library-dataset btn btn-default btn-xs">');r.push(' <span class="fa fa-eye"></span> details');r.push(" </button>");r.push(" </td>");r.push(' <td><%- content_item.get("name") %></td>');r.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');r.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');r.push(" <% } %> ");r.push(' <td><%= _.escape(content_item.get("time_updated")) %></td>');r.push(" </tr>");r.push(" <% }); %>");r.push(" ");r.push(" </tbody>");r.push("</table>");r.push("</div>");return r.join("")},templateDatasetModal:function(){var r=[];r.push('<div id="dataset_info_modal">');r.push(' <table class="table table-striped table-condensed">');r.push(" <tr>");r.push(' <th scope="row" id="id_row" data-id="<%= _.escape(item.get("ldda_id")) %>">Name</th>');r.push(' <td><%= _.escape(item.get("name")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Data type</th>');r.push(' <td><%= _.escape(item.get("data_type")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Genome build</th>');r.push(' <td><%= _.escape(item.get("genome_build")) %></td>');r.push(" </tr>");r.push(' <th scope="row">Size</th>');r.push(" <td><%= _.escape(size) %></td>");r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Date uploaded (UTC)</th>');r.push(' <td><%= _.escape(item.get("date_uploaded")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Uploaded by</th>');r.push(' <td><%= _.escape(item.get("uploaded_by")) %></td>');r.push(" </tr>");r.push(' <tr scope="row">');r.push(' <th scope="row">Data Lines</th>');r.push(' <td scope="row"><%= _.escape(item.get("metadata_data_lines")) %></td>');r.push(" </tr>");r.push(' <th scope="row">Comment Lines</th>');r.push(' <% if (item.get("metadata_comment_lines") === "") { %>');r.push(' <td scope="row"><%= _.escape(item.get("metadata_comment_lines")) %></td>');r.push(" <% } else { %>");r.push(' <td scope="row">unknown</td>');r.push(" <% } %>");r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Number of Columns</th>');r.push(' <td scope="row"><%= _.escape(item.get("metadata_columns")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Column Types</th>');r.push(' <td scope="row"><%= _.escape(item.get("metadata_column_types")) %></td>');r.push(" </tr>");r.push(" <tr>");r.push(' <th scope="row">Miscellaneous information</th>');r.push(' <td scope="row"><%= _.escape(item.get("misc_blurb")) %></td>');r.push(" </tr>");r.push(" </table>");r.push(' <pre class="peek">');r.push(" </pre>");r.push("</div>");return r.join("")},templateHistorySelectInModal:function(){var r=[];r.push('<span id="history_modal_combo" style="width:90%; margin-left: 1em; margin-right: 1em; ">');r.push("Select history: ");r.push('<select id="dataset_import_single" name="dataset_import_single" style="width:50%; margin-bottom: 1em; "> ');r.push(" <% _.each(histories, function(history) { %>");r.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');r.push(" <% }); %>");r.push("</select>");r.push("</span>");return r.join("")},templateBulkImportInModal:function(){var r=[];r.push('<span id="history_modal_combo_bulk" style="width:90%; margin-left: 1em; margin-right: 1em; ">');r.push("Select history: ");r.push('<select id="dataset_import_bulk" name="dataset_import_bulk" style="width:50%; margin-bottom: 1em; "> ');r.push(" <% _.each(histories, function(history) { %>");r.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');r.push(" <% }); %>");r.push("</select>");r.push("</span>");return r.join("")},templateProgressBar:function(){var r=[];r.push('<div class="import_text">');r.push("Importing selected datasets to history <b><%= _.escape(history_name) %></b>");r.push("</div>");r.push('<div class="progress">');r.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');r.push(' <span class="completion_span">0% Complete</span>');r.push(" </div>");r.push("</div>");r.push("");return r.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 tmpl_array.join("")},events:{"click #select-all-checkboxes":"selectAll","click .folder_row":"selectClickedRow","click #toolbtn_bulk_import":"modalBulkImport","click #toolbtn_dl":"bulkDownload","click .library-dataset":"showDatasetDetails","click #toolbtn_create_folder":"createFolderFromModal","click .btn_open_folder":"navigateToFolder"},render:function(r){$("#center").css("overflow","auto");view=this;var t=this;var s=new e({id:r.id});s.url=s.attributes.urlRoot+r.id+"/contents";s.fetch({success:function(u){for(var w=0;w<s.attributes.folder.models.length;w++){var v=s.attributes.folder.models[w];if(v.get("type")==="file"){v.set("readable_size",t.size_to_string(v.get("file_size")))}}var y=s.full_path;var z;if(y.length===1){z=0}else{z=y[y.length-2][0]}var x=_.template(t.templateFolder(),{path:s.full_path,items:s.attributes.folder.models,id:r.id,upper_folder_id:z});t.$el.html(x)},error:function(){n.error("An error occured :(")}})},size_to_string:function(r){var s="";if(r>=100000000000){r=r/100000000000;s="TB"}else{if(r>=100000000){r=r/100000000;s="GB"}else{if(r>=100000){r=r/100000;s="MB"}else{if(r>=100){r=r/100;s="KB"}else{r=r*10;s="b"}}}}return(Math.round(r)/10)+s},navigateToFolder:function(s){var r=$(s.target).attr("data-id");if(typeof r==="undefined"){return false}else{if(r==="0"){library_router.navigate("/",{trigger:true,replace:false})}else{library_router.navigate("folders/"+r,{trigger:true,replace:false})}}},showDatasetDetails:function(u){u.preventDefault();var v=$(u.target).parent().parent().attr("id");var t=new i();var s=new p();t.id=v;var r=this;t.fetch({success:function(w){s.fetch({success:function(x){r.renderModalAfterFetch(w,x)},error:function(){n.error("An error occured during fetching histories:(");r.renderModalAfterFetch(w)}})},error:function(){n.error("An error occured during loading dataset details :(")}})},renderModalAfterFetch:function(w,t){var u=this.size_to_string(w.get("file_size"));var v=_.template(this.templateDatasetModal(),{item:w,size:u});var s=this;this.modal=new k.GalaxyModal({destructible:true,bindClosingEvents:true,title:"Dataset Details",body:v,buttons:{Import:function(){s.importCurrentIntoHistory()},Download:function(){s.downloadCurrent()},Close:function(){s.modal.hideOrDestroy()}}});$(".peek").html(w.get("peek"));if(typeof history.models!==undefined){var r=_.template(this.templateHistorySelectInModal(),{histories:t.models});$(this.modal.elMain).find(".buttons").prepend(r);if(s.lastSelectedHistory.length>0){$(this.modal.elMain).find("#dataset_import_single").val(s.lastSelectedHistory)}}this.modal.show()},downloadCurrent:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var r=[];r.push($("#id_row").attr("data-id"));var s="/api/libraries/datasets/download/uncompressed";var t={ldda_ids:r};folderContentView.processDownload(s,t);this.modal.enableButton("Import");this.modal.enableButton("Download")},importCurrentIntoHistory:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var t=$(this.modal.elMain).find("select[name=dataset_import_single] option:selected").val();this.lastSelectedHistory=t;var r=$("#id_row").attr("data-id");var u=new b();var s=this;u.url=u.urlRoot+t+"/contents";u.save({content:r,source:"library"},{success:function(){n.success("Dataset imported");s.modal.enableButton("Import");s.modal.enableButton("Download")},error:function(){n.error("An error occured! Dataset not imported. Please try again.");s.modal.enableButton("Import");s.modal.enableButton("Download")}})},selectAll:function(s){var r=s.target.checked;that=this;$(":checkbox").each(function(){this.checked=r;$row=$(this.parentElement.parentElement);(r)?that.makeDarkRow($row):that.makeWhiteRow($row)});this.checkTools()},selectClickedRow:function(s){var u="";var r;var t;if(s.target.localName==="input"){u=s.target;r=$(s.target.parentElement.parentElement);t="input"}else{if(s.target.localName==="td"){u=$("#"+s.target.parentElement.id).find(":checkbox")[0];r=$(s.target.parentElement);t="td"}}if(u===""){s.stopPropagation();return}if(u===undefined){s.stopPropagation();return}if(u.checked){if(t==="td"){u.checked="";this.makeWhiteRow(r)}else{if(t==="input"){this.makeDarkRow(r)}}}else{if(t==="td"){u.checked="selected";this.makeDarkRow(r)}else{if(t==="input"){this.makeWhiteRow(r)}}}this.checkTools()},makeDarkRow:function(r){r.removeClass("light");r.find("a").removeClass("light");r.addClass("dark");r.find("a").addClass("dark")},makeWhiteRow:function(r){r.removeClass("dark");r.find("a").removeClass("dark");r.addClass("light");r.find("a").addClass("light")},checkTools:function(){var r=$("#folder_table").find(":checked");if(r.length>0){$("#toolbtn_bulk_import").show();$("#toolbtn_dl").show()}else{$("#toolbtn_bulk_import").hide();$("#toolbtn_dl").hide()}},modalBulkImport:function(){var s=this;var r=new p();r.fetch({success:function(t){var u=_.template(s.templateBulkImportInModal(),{histories:t.models});s.modal=new k.GalaxyModal({destructible:true,bindClosingEvents:true,title:"Import into History",body:u,buttons:{Import:function(){s.importAllIntoHistory()},Close:function(){s.modal.hideOrDestroy()}}});s.modal.show()},error:function(){n.error("An error occured :(")}})},importAllIntoHistory:function(){this.modal.disableButton("Import");var t=$("select[name=dataset_import_bulk] option:selected").val();var x=$("select[name=dataset_import_bulk] option:selected").text();var z=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!=""){z.push(this.parentElement.parentElement.id)}});var y=_.template(this.templateProgressBar(),{history_name:x});$(this.modal.elMain).find(".modal-body").html(y);var u=100/z.length;this.initProgress(u);var r=[];for(var s=z.length-1;s>=0;s--){library_dataset_id=z[s];var v=new b();var w=this;v.url=v.urlRoot+t+"/contents";v.content=library_dataset_id;v.source="library";r.push(v)}this.chainCall(r)},chainCall:function(s){var r=this;var t=s.pop();if(typeof t==="undefined"){n.success("All datasets imported");this.modal.hideOrDestroy();return}var u=$.when(t.save({content:t.content,source:t.source})).done(function(v){r.updateProgress();responses.push(v);r.chainCall(s)})},initProgress:function(r){this.progress=0;this.progressStep=r},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(r,v){var t=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!=""){t.push(this.parentElement.parentElement.id)}});var s="/api/libraries/datasets/download/"+v;var u={ldda_ids:t};this.processDownload(s,u,"get")},processDownload:function(s,t,u){if(s&&t){t=typeof t=="string"?t:$.param(t);var r="";$.each(t.split("&"),function(){var v=this.split("=");r+='<input type="hidden" name="'+v[0]+'" value="'+v[1]+'" />'});$('<form action="'+s+'" method="'+(u||"post")+'">'+r+"</form>").appendTo("body").submit().remove();n.info("Your download will begin soon")}},createFolderFromModal:function(){event.preventDefault();event.stopPropagation();var r=this;this.modal=new k.GalaxyModal({destructible:true,bindClosingEvents:true,title:"Create New Folder",body:this.templateNewFolderInModal(),buttons:{Create:function(){r.create_new_folder_event()},Close:function(){r.modal.hideOrDestroy();r.modal=null}}});this.modal.show()},create_new_folder_event:function(){var r=this.serialize_new_folder();if(this.validate_new_folder(r)){var t=new c();url_items=Backbone.history.fragment.split("/");current_folder_id=url_items[url_items.length-1];t.url=t.urlRoot+"/"+current_folder_id;var s=this;t.save(r,{success:function(u){s.modal.hideOrDestroy();n.success("Folder created");s.render({id:current_folder_id})},error:function(){n.error("An error occured :(")}})}else{n.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(r){return r.name!==""}});var a=Backbone.View.extend({el:"#center",events:{"click #create_new_library_btn":"show_library_modal"},initialize:function(){},templateLibraryList:function(){tmpl_array=[];tmpl_array.push('<div id="library_container" style="width: 90%; margin: auto; margin-top: 2em; overflow: auto !important; ">');tmpl_array.push("");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('<a href="" id="create_new_library_btn" class="btn btn-primary file ">New Library</a>');tmpl_array.push('<table class="table table-condensed">');tmpl_array.push(" <thead>");tmpl_array.push(' <th class="button_heading"></th>');tmpl_array.push(" <th>name</th>");tmpl_array.push(" <th>description</th>");tmpl_array.push(" <th>synopsis</th> ");tmpl_array.push(" <th>model type</th> ");tmpl_array.push(" </thead>");tmpl_array.push(" <tbody>");tmpl_array.push(" <% _.each(libraries, function(library) { %>");tmpl_array.push(" <tr>");tmpl_array.push(' <td><button title="Open this library" type="button" data-id="<%- library.get("root_folder_id") %>" class="btn_open_folder btn btn-default btn-xs">');tmpl_array.push(' <span class="fa fa-folder-open"></span> browse</td>');tmpl_array.push(' <td><%- library.get("name") %></td>');tmpl_array.push(' <td><%= _.escape(library.get("description")) %></td>');tmpl_array.push(' <td><%= _.escape(library.get("synopsis")) %></td>');tmpl_array.push(' <td><%= _.escape(library.get("model_class")) %></td>');tmpl_array.push(" </tr>");tmpl_array.push(" <% }); %>");tmpl_array.push(" </tbody>");tmpl_array.push("</table>");tmpl_array.push("</div>");return tmpl_array.join("")},templateNewLibraryInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_library_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(' <input type="text" name="Synopsis" value="" placeholder="Synopsis">');tmpl_array.push(" </form>");tmpl_array.push("</div>");return tmpl_array.join("")},render:function(){$("#center").css("overflow","auto");var r=this;libraries=new o();libraries.fetch({success:function(s){var t=_.template(r.templateLibraryList(),{libraries:s.models});r.$el.html(t)},error:function(t,s){if(s.statusCode().status===403){n.info("Please log in first. Redirecting to login page in 3s.");setTimeout(r.redirectToLogin,3000)}else{n.error("An error occured. Please try again.")}}})},redirectToHome:function(){window.location="../"},redirectToLogin:function(){window.location="/user/login"},modal:null,show_library_modal:function(s){s.preventDefault();s.stopPropagation();var r=this;this.modal=new k.GalaxyModal({destructible:true,bindClosingEvents:true,title:"Create New Library",body:this.templateNewLibraryInModal(),buttons:{Create:function(){r.create_new_library_event()},Close:function(){r.modal.hideOrDestroy()}}});this.modal.show()},create_new_library_event:function(){var t=this.serialize_new_library();if(this.validate_new_library(t)){var s=new f();var r=this;s.save(t,{success:function(u){r.modal.hideOrDestroy();r.clear_library_modal();r.render();n.success("Library created")},error:function(){n.error("An error occured :(")}})}else{n.error("Library's name is missing")}return false},clear_library_modal:function(){$("input[name='Name']").val("");$("input[name='Description']").val("");$("input[name='Synopsis']").val("")},serialize_new_library:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val(),synopsis:$("input[name='Synopsis']").val()}},validate_new_library:function(r){return r.name!==""}});var g=Backbone.View.extend({folderContentView:null,galaxyLibraryview:null,initialize:function(){folderContentView=new m();galaxyLibraryview=new a();library_router=new q();library_router.on("route:libraries",function(){galaxyLibraryview.render()});library_router.on("route:folder_content",function(r){folderContentView.render({id:r})});library_router.on("route:download",function(r,s){if($("#center").find(":checked").length===0){library_router.navigate("folders/"+r,{trigger:true,replace:true})}else{folderContentView.download(r,s);library_router.navigate("folders/"+r,{trigger:false,replace:true})}});Backbone.history.start({pushState:false})}});return{GalaxyApp:g}});
\ 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
4 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/fc65aae7f9a3/
Changeset: fc65aae7f9a3
User: martenson
Date: 2014-01-16 19:37:04
Summary: new packed js
Affected #: 2 files
diff -r dd0bf9c3d0e42246964c8d65785ece1feec6b98e -r fc65aae7f9a3b4ea5f040558e7408837a1d41c07 static/scripts/packed/mvc/visualization/scatterplotControlForm.js
--- /dev/null
+++ b/static/scripts/packed/mvc/visualization/scatterplotControlForm.js
@@ -0,0 +1,1 @@
+var ScatterplotControlForm=Backbone.View.extend(LoggableMixin).extend({className:"scatterplot-control-form",dataLoadDelay:4000,dataLoadSize:5000,loadingIndicatorImage:"loading_small_white_bg.gif",fetchMsg:"Fetching data...",renderMsg:"Rendering...",initialize:function(a){this.log(this+".initialize, attributes:",a);this.dataset=null;this.chartConfig=null;this.chart=null;this.loader=null;this.$dataControl=null;this.$chartControl=null;this.$statsDisplay=null;this.$chartDisplay=null;this.dataFetch=null;this.initializeFromAttributes(a);this.initializeChart(a);this.initializeDataLoader(a)},initializeFromAttributes:function(a){if(!a||!a.dataset){throw ("ScatterplotView requires a dataset")}else{this.dataset=a.dataset}if(jQuery.type(this.dataset.metadata_column_types)==="string"){this.dataset.metadata_column_types=this.dataset.metadata_column_types.split(", ")}this.log("\t dataset:",this.dataset);if(this.dataset.comment_lines&&this.dataset.comment_lines.length){var b=this.dataset.comment_lines[0],c=b.split("\t");if(c.length===this.dataset.metadata_column_types.length){this.possibleHeaders=c}}if(!a.apiDatasetsURL){throw ("ScatterplotView requires a apiDatasetsURL")}else{this.dataURL=a.apiDatasetsURL+"/"+this.dataset.id+"?"}this.log("\t dataURL:",this.dataURL)},initializeChart:function(a){this.chartConfig=a.chartConfig||{};this.log("\t initial chartConfig:",this.chartConfig);this.chart=new TwoVarScatterplot(this.chartConfig);this.chartConfig=this.chart.config},initializeDataLoader:function(b){var a=this;this.loader=new LazyDataLoader({url:null,start:b.start||0,total:b.total||this.dataset.metadata_data_lines,delay:this.dataLoadDelay,size:this.dataLoadSize,buildUrl:function(d,c){return this.url+"&"+jQuery.param({start_val:d,max_vals:c})}});$(this.loader).bind("error",function(e,c,d){a.log("ERROR:",c,d);alert("ERROR fetching data:\n"+c+"\n"+d);a.hideLoadingIndicator()})},render:function(){this.log(this+".render");this.$el.append(ScatterplotControlForm.templates.mainLayout({loadingIndicatorImagePath:galaxy_config.root+"static/images/"+this.loadingIndicatorImage,message:""}));this.$dataControl=this._render_dataControl();this.$chartControl=this._render_chartControl();this.$statsDisplay=this.$el.find(".tab-pane#stats-display");this.$chartDisplay=this._render_chartDisplay();if(this.chartConfig.xColumn&&this.chartConfig.yColumn){this.renderChart()}this.$el.find("[title]").tooltip();return this},_render_dataControl:function(){var b=this,a=[],e=[],c=(this.possibleHeaders&&this.$dataControl)?(this.$dataControl.find("#first-line-header-checkbox").is(":checked")):(false);_.each(this.dataset.metadata_column_types,function(i,g){var h=g+1,f="column "+h;if(b.dataset.metadata_column_names){f=b.dataset.metadata_column_names[g]}else{if(c){f=b.possibleHeaders[g]}}a.push({index:h,name:f});if(i==="int"||i==="float"){e.push({index:h,name:f})}});var d=this.$el.find(".tab-pane#data-control");d.html(ScatterplotControlForm.templates.dataControl({allColumns:a,numericColumns:e,possibleHeaders:(this.possibleHeaders)?(this.possibleHeaders.join(", ")):(""),usePossibleHeaders:c}));if(!this.dataset.metadata_column_names&&this.possibleHeaders){d.find("#first-line-header").show()}d.find("#X-select").val(this.chartConfig.xColumn);d.find("#Y-select").val(this.chartConfig.yColumn);if(this.chartConfig.idColumn!==undefined){d.find("#include-id-checkbox").attr("checked",true).trigger("change");d.find("#ID-select").val(this.chartConfig.idColumn)}return d},_render_chartControl:function(){var a=this,b=this.$el.find(".tab-pane#chart-control"),c={datapointSize:{min:2,max:10,step:1},width:{min:200,max:800,step:20},height:{min:200,max:800,step:20}};b.append(ScatterplotControlForm.templates.chartControl(this.chartConfig));b.find(".numeric-slider-input").each(function(){var f=$(this),e=f.find(".slider-output"),g=f.find(".slider"),h=f.attr("id");function d(){var j=$(this),i=j.slider("value");e.text(i)}g.slider(_.extend(c[h],{value:a.chartConfig[h],change:d,slide:d}))});return b},_render_chartDisplay:function(){var a=this.$el.find(".tab-pane#chart-display");a.append(ScatterplotControlForm.templates.chartDisplay(this.chartConfig));return a},events:{"change #include-id-checkbox":"toggleThirdColumnSelector","change #first-line-header-checkbox":"rerenderDataControl","click #data-control #render-button":"renderChart","click #chart-control #render-button":"changeChartSettings"},toggleThirdColumnSelector:function(){this.$el.find('select[name="ID"]').parent().toggle()},rerenderDataControl:function(){this.$dataControl=this._render_dataControl()},showLoadingIndicator:function(b,c){b=b||"";var a=this.$el.find("div#loading-indicator");messageBox=a.find(".loading-message");if(a.is(":visible")){if(b){messageBox.fadeOut("fast",function(){messageBox.text(b);messageBox.fadeIn("fast",c)})}else{c()}}else{if(b){messageBox.text(b)}a.fadeIn("fast",c)}},hideLoadingIndicator:function(a){this.$el.find("div#loading-indicator").fadeOut("fast",a)},renderChart:function(){this.log(this+".renderChart");this.data=null;this.meta=null;_.extend(this.chartConfig,this.getChartSettings());this.log("\t chartConfig:",this.chartConfig);this.chart.updateConfig(this.chartConfig,false);this.loader.url=this.dataURL+"&"+jQuery.param(this.getDataSettings());this.log("\t loader: total lines:",this.loader.total," url:",this.loader.url);var a=this;$(this.loader).bind("loaded.new",function(c,b){a.log(a+" loaded.new",b);a.postProcessDataFetchResponse(b);a.log("\t postprocessed data:",a.data);a.log("\t postprocessed meta:",a.meta);a.showLoadingIndicator(a.renderMsg,function(){a.chart.render(a.data,a.meta);a.renderStats(a.data,a.meta);a.hideLoadingIndicator()})});$(this.loader).bind("complete",function(b,c){a.log(a+" complete",c);$(a.loader).unbind()});a.showLoadingIndicator(a.fetchMsg,function(){a.$el.find("ul.nav").find('a[href="#chart-display"]').tab("show");a.loader.load()})},renderStats:function(){this.log(this+".renderStats");this.$statsDisplay.html(ScatterplotControlForm.templates.statsDisplay({stats:[{name:"Count",xval:this.meta[0].count,yval:this.meta[1].count},{name:"Min",xval:this.meta[0].min,yval:this.meta[1].min},{name:"Max",xval:this.meta[0].max,yval:this.meta[1].max},{name:"Sum",xval:this.meta[0].sum,yval:this.meta[1].sum},{name:"Mean",xval:this.meta[0].mean,yval:this.meta[1].mean},{name:"Median",xval:this.meta[0].median,yval:this.meta[1].median}]}))},changeChartSettings:function(){var a=this;newChartSettings=this.getChartSettings();_.extend(this.chartConfig,newChartSettings);this.log("this.chartConfig:",this.chartConfig);this.chart.updateConfig(this.chartConfig,false);if(a.data&&a.meta){a.showLoadingIndicator(a.renderMsg,function(){a.$el.find("ul.nav").find('a[href="#chart-display"]').tab("show");a.chart.render(a.data,a.meta);a.hideLoadingIndicator()})}else{this.renderChart()}},postProcessDataFetchResponse:function(a){this.postProcessData(a.data);this.postProcessMeta(a.meta)},postProcessData:function(b){var a=this;if(a.data){_.each(b,function(d,c){a.data[c]=a.data[c].concat(d)})}else{a.data=b}},postProcessMeta:function(c){var a=this,b=this.dataset.metadata_column_types;if(a.meta){_.each(c,function(e,d){var i=a.meta[d],g=b[d];i.count+=(e.count)?(e.count):(0);if((g==="int")||(g==="float")){i.min=Math.min(e.min,i.min);i.max=Math.max(e.max,i.max);i.sum=e.sum+i.sum;i.mean=(i.count)?(i.sum/i.count):(null);var f=a.data[d].slice().sort(),h=Math.floor(f.length/2);if(f.length%2===0){i.median=((f[h]+f[(h+1)])/2)}else{i.median=f[h]}}})}else{a.meta=c}},getDataSettings:function(){var b=this.getColumnSelections(),a=[];this.log("\t columnSelections:",b);a=[b.X.colIndex-1,b.Y.colIndex-1];if(this.$dataControl.find("#include-id-checkbox").attr("checked")){a.push(b.ID.colIndex-1)}var c={data_type:"raw_data",provider:"column_with_stats",columns:"["+a+"]"};this.log("\t data settings (url params):",c);return c},getColumnSelections:function(){var a={};this.$dataControl.find("div.column-select select").each(function(){var b=$(this),c=b.val();a[b.attr("name")]={colIndex:c,colName:b.children('[value="'+c+'"]').text()}});return a},getChartSettings:function(){var c={},d=this.getColumnSelections();c.datapointSize=this.$chartControl.find("#datapointSize.numeric-slider-input").find(".slider").slider("value");c.width=this.$chartControl.find("#width.numeric-slider-input").find(".slider").slider("value");c.height=this.$chartControl.find("#height.numeric-slider-input").find(".slider").slider("value");var b=this.$chartControl.find("input#X-axis-label").val(),a=this.$chartControl.find("input#Y-axis-label").val();c.xLabel=(b==="X")?(d.X.colName):(b);c.yLabel=(a==="Y")?(d.Y.colName):(a);c.animDuration=(this.$chartControl.find("#animate-chart").is(":checked"))?(this.chart.defaults.animDuration):(0);this.log("\t chartSettings:",c);return c},toString:function(){return"ScatterplotControlForm("+((this.dataset)?(this.dataset.id):(""))+")"}});ScatterplotControlForm.templates={mainLayout:Handlebars.templates["template-visualization-scatterplotControlForm"],dataControl:Handlebars.templates["template-visualization-dataControl"],chartControl:Handlebars.templates["template-visualization-chartControl"],statsDisplay:Handlebars.templates["template-visualization-statsDisplay"],chartDisplay:Handlebars.templates["template-visualization-chartDisplay"]};
\ No newline at end of file
diff -r dd0bf9c3d0e42246964c8d65785ece1feec6b98e -r fc65aae7f9a3b4ea5f040558e7408837a1d41c07 static/scripts/packed/mvc/visualization/visualization-model.js
--- /dev/null
+++ b/static/scripts/packed/mvc/visualization/visualization-model.js
@@ -0,0 +1,1 @@
+var Visualization=Backbone.Model.extend(LoggableMixin).extend({defaults:{},url:function(){return galaxy_config.root+"api/visualizations"},initialize:function(a){this.log(this+".initialize",a,this.attributes);this._setUpListeners()},_setUpListeners:function(){},setConfig:function(b){var a=this.get("config");if(_.isObject(a)){b=_.extend(_.clone(a),b)}this.set("config",b);return this},toString:function(){var a=this.get("id")||"";if(this.get("title")){a+=":"+this.get("title")}return"Visualization("+a+")"}});var VisualizationCollection=Backbone.Collection.extend(LoggableMixin).extend({model:Visualization,url:function(){return galaxy_config.root+"api/visualizations"},initialize:function(b,a){a=a||{}},set:function(c,a){var b=this;c=_.map(c,function(e){var f=b.get(e.id);if(!f){return e}var d=f.toJSON();_.extend(d,e);return d});Backbone.Collection.prototype.set.call(this,c,a)},toString:function(){return(["VisualizationCollection(",[this.historyId,this.length].join(),")"].join(""))}});
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/9855cc27c607/
Changeset: 9855cc27c607
User: martenson
Date: 2014-01-16 20:08:58
Summary: PEP8 tweaks
Affected #: 1 file
diff -r fc65aae7f9a3b4ea5f040558e7408837a1d41c07 -r 9855cc27c607c9b3889610660259b17d16f3c0c8 lib/galaxy/webapps/galaxy/api/authenticate.py
--- a/lib/galaxy/webapps/galaxy/api/authenticate.py
+++ b/lib/galaxy/webapps/galaxy/api/authenticate.py
@@ -21,19 +21,24 @@
def get_api_key( self, trans, **kwd )
* GET /api/authenticate/baseauth
returns an API key for authenticated user based on BaseAuth headers
+
+ :rtype: dict
+ :returns: api_key in json format
+
+ :raises: ObjectNotFound, HTTPBadRequest
"""
email, password = self._decode_baseauth( trans.environ.get( 'HTTP_AUTHORIZATION' ) )
user = trans.sa_session.query( trans.app.model.User ).filter( trans.app.model.User.table.c.email == email ).all()
- if (len(user) is not 1):
+ if ( len( user ) is not 1 ):
# DB is inconsistent and we have more users with same email
raise ObjectNotFound
else:
user = user[0]
is_valid_user = user.check_password( password )
- if (is_valid_user):
+ if ( is_valid_user ):
user_id = user.id
api_key_row = trans.sa_session.query( trans.app.model.APIKeys ).filter( trans.app.model.APIKeys.table.c.user_id == user_id ).first()
else:
@@ -47,23 +52,23 @@
the form (email, password), and raises a HTTPBadRequest exception if
nothing could be decoded.
"""
- split = encoded_str.strip().split(' ')
+ split = encoded_str.strip().split( ' ' )
# If split is only one element, try to decode the email and password
# directly.
- if len(split) == 1:
+ if len( split ) == 1:
try:
- email, password = b64decode(split[0]).split(':')
+ email, password = b64decode( split[ 0 ] ).split( ':' )
except:
raise HTTPBadRequest
# If there are only two elements, check the first and ensure it says
# 'basic' so that we know we're about to decode the right thing. If not,
# bail out.
- elif len(split) == 2:
- if split[0].strip().lower() == 'basic':
+ elif len( split ) == 2:
+ if split[ 0 ].strip().lower() == 'basic':
try:
- email, password = b64decode(split[1]).split(':')
+ email, password = b64decode( split[ 1 ] ).split( ':' )
except:
raise HTTPBadRequest
else:
@@ -74,4 +79,4 @@
else:
raise HTTPBadRequest
- return unquote(email), unquote(password)
+ return unquote( email ), unquote( password )
https://bitbucket.org/galaxy/galaxy-central/commits/1773a15233bb/
Changeset: 1773a15233bb
User: martenson
Date: 2014-01-16 20:13:15
Summary: Merge
Affected #: 4 files
diff -r 9855cc27c607c9b3889610660259b17d16f3c0c8 -r 1773a15233bb1424f86481068a386d6e0aeaba9e lib/galaxy/config.py
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -602,7 +602,11 @@
if check_migrate_tools:
# Alert the Galaxy admin to tools that have been moved from the distribution to the tool shed.
from tool_shed.galaxy_install.migrate.check import verify_tools
- verify_tools( self, install_db_url, config_file, self.config.database_engine_options )
+ if combined_install_database:
+ install_database_options = self.config.database_engine_options
+ else:
+ install_database_options = self.config.install_database_engine_options
+ verify_tools( self, install_db_url, config_file, install_database_options )
from galaxy.model import mapping
self.model = mapping.init( self.config.file_path,
diff -r 9855cc27c607c9b3889610660259b17d16f3c0c8 -r 1773a15233bb1424f86481068a386d6e0aeaba9e lib/galaxy/webapps/tool_shed/api/repositories.py
--- a/lib/galaxy/webapps/tool_shed/api/repositories.py
+++ b/lib/galaxy/webapps/tool_shed/api/repositories.py
@@ -129,7 +129,7 @@
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans,
encoded_repository_id,
changeset_revision )
- if not repository_metadata:
+ if repository_metadata is None:
# The changeset_revision column in the repository_metadata table has been updated with a new
# value value, so find the changeset_revision to which we need to update.
repo_dir = repository.repo_path( trans.app )
@@ -139,7 +139,7 @@
encoded_repository_id,
new_changeset_revision )
changeset_revision = new_changeset_revision
- if repository_metadata:
+ if repository_metadata is not None:
encoded_repository_metadata_id = trans.security.encode_id( repository_metadata.id )
repository_metadata_dict = repository_metadata.to_dict( view='collection',
value_mapper=self.__get_value_mapper( trans ) )
@@ -168,7 +168,8 @@
def __get_value_mapper( self, trans ):
value_mapper = { 'id' : trans.security.encode_id,
- 'repository_id' : trans.security.encode_id }
+ 'repository_id' : trans.security.encode_id,
+ 'user_id' : trans.security.encode_id }
return value_mapper
@web.expose_api
diff -r 9855cc27c607c9b3889610660259b17d16f3c0c8 -r 1773a15233bb1424f86481068a386d6e0aeaba9e lib/galaxy/webapps/tool_shed/api/repository_revisions.py
--- a/lib/galaxy/webapps/tool_shed/api/repository_revisions.py
+++ b/lib/galaxy/webapps/tool_shed/api/repository_revisions.py
@@ -68,7 +68,8 @@
def __get_value_mapper( self, trans ):
value_mapper = { 'id' : trans.security.encode_id,
- 'repository_id' : trans.security.encode_id }
+ 'repository_id' : trans.security.encode_id,
+ 'user_id' : trans.security.encode_id }
return value_mapper
@web.expose_api_anonymous
@@ -159,15 +160,33 @@
repository_dependency_repository_metadata = \
suc.get_repository_metadata_by_changeset_revision( trans, repository_dependency_id, changeset_revision )
if repository_dependency_repository_metadata is None:
- log.debug( 'Cannot locate repository_metadata with id %s for repository dependency %s owned by %s.' % \
- ( str( repository_dependency_id ), str( name ), str( owner ) ) )
- continue
+ # The changeset_revision column in the repository_metadata table has been updated with a new
+ # value value, so find the changeset_revision to which we need to update.
+ repo_dir = repository_dependency.repo_path( trans.app )
+ repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ new_changeset_revision = suc.get_next_downloadable_changeset_revision( repository_dependency,
+ repo,
+ changeset_revision )
+ repository_dependency_repository_metadata = \
+ suc.get_repository_metadata_by_changeset_revision( trans,
+ repository_dependency_id,
+ new_changeset_revision )
+ if repository_dependency_repository_metadata is None:
+ decoded_repository_dependency_id = trans.security.decode_id( repository_dependency_id )
+ debug_msg = 'Cannot locate repository_metadata with id %d for repository dependency %s owned by %s ' % \
+ ( decoded_repository_dependency_id, str( name ), str( owner ) )
+ debug_msg += 'using either of these changeset_revisions: %s, %s.' % \
+ ( str( changeset_revision ), str( new_changeset_revision ) )
+ log.debug( debug_msg )
+ continue
+ else:
+ changeset_revision = new_changeset_revision
repository_dependency_repository_metadata_id = trans.security.encode_id( repository_dependency_repository_metadata.id )
repository_dependency_dict = repository_dependency.to_dict( view='element',
value_mapper=self.__get_value_mapper( trans ) )
# We have to add the changeset_revision of of the repository dependency.
repository_dependency_dict[ 'changeset_revision' ] = changeset_revision
- repository_dependency_dict[ 'url' ] = web.url_for( controller='repositories',
+ repository_dependency_dict[ 'url' ] = web.url_for( controller='repository_revisions',
action='show',
id=repository_dependency_repository_metadata_id )
repository_dependencies_dicts.append( repository_dependency_dict )
diff -r 9855cc27c607c9b3889610660259b17d16f3c0c8 -r 1773a15233bb1424f86481068a386d6e0aeaba9e lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -724,8 +724,8 @@
def get_next_downloadable_changeset_revision( repository, repo, after_changeset_revision ):
"""
- Return the installable changeset_revision in the repository changelog after the changeset to which after_changeset_revision refers. If there
- isn't one, return None.
+ Return the installable changeset_revision in the repository changelog after the changeset to which
+ after_changeset_revision refers. If there isn't one, return None.
"""
changeset_revisions = get_ordered_metadata_changeset_revisions( repository, repo, downloadable=True )
if len( changeset_revisions ) == 1:
https://bitbucket.org/galaxy/galaxy-central/commits/2b0aba01ad8d/
Changeset: 2b0aba01ad8d
User: martenson
Date: 2014-01-17 15:55:27
Summary: Merge
Affected #: 19 files
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae config/plugins/visualizations/charts/static/app.js
--- a/config/plugins/visualizations/charts/static/app.js
+++ b/config/plugins/visualizations/charts/static/app.js
@@ -1,10 +1,10 @@
// dependencies
define(['library/portlet', 'library/ui', 'library/utils',
'views/charts', 'views/viewport', 'views/chart', 'views/group',
- 'models/datasets', 'models/chart', 'models/charts', 'models/types'],
+ 'models/config', 'models/datasets', 'models/chart', 'models/charts', 'models/group', 'models/types'],
function( Portlet, Ui, Utils,
ChartsView, ViewportView, ChartView, GroupView,
- Datasets, Chart, Charts, Types
+ Config, Datasets, Chart, Charts, Group, Types
) {
// widget
@@ -19,10 +19,14 @@
// link galaxy
this.modal = parent.Galaxy.modal;
+ // create configuration model
+ this.config = new Config();
+
// create chart models
this.types = new Types();
this.chart = new Chart();
this.charts = new Charts();
+ this.group = new Group();
// create dataset handler
this.datasets = new Datasets(this);
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae config/plugins/visualizations/charts/static/models/chart.js
--- a/config/plugins/visualizations/charts/static/models/chart.js
+++ b/config/plugins/visualizations/charts/static/models/chart.js
@@ -22,8 +22,9 @@
// reset
reset: function()
{
- this.clear().set(this.defaults);
+ this.clear({silent: true}).set(this.defaults);
this.groups.reset();
+ this.trigger('reset', this);
},
// copy
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae config/plugins/visualizations/charts/static/models/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/models/config.js
@@ -0,0 +1,16 @@
+// dependencies
+define([], function() {
+
+
+// model
+return Backbone.Model.extend(
+{
+ // options
+ defaults : {
+ query_limit : 20,
+ query_pace : 1000,
+ query_max : 5
+ }
+});
+
+});
\ No newline at end of file
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae config/plugins/visualizations/charts/static/models/group.js
--- a/config/plugins/visualizations/charts/static/models/group.js
+++ b/config/plugins/visualizations/charts/static/models/group.js
@@ -1,23 +1,14 @@
// dependencies
-define(['library/utils'], function(Utils) {
-
+define([], function() {
// model
return Backbone.Model.extend(
{
- // defaults
- defaults : {
- },
-
- // initialize
- initialize: function(options)
- {
- },
-
// reset
reset: function()
{
- this.clear().set(this.defaults);
+ this.clear({silent: true}).set(this.defaults);
+ this.trigger('reset', this);
}
});
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae config/plugins/visualizations/charts/static/views/chart.js
--- a/config/plugins/visualizations/charts/static/views/chart.js
+++ b/config/plugins/visualizations/charts/static/views/chart.js
@@ -125,6 +125,9 @@
this.chart.on('change:type', function(chart) {
self.table.value(chart.get('type'));
});
+ this.chart.on('reset', function(chart) {
+ self._resetChart();
+ });
// collection events
this.app.charts.on('add', function(chart) {
@@ -140,23 +143,17 @@
});
// reset
- this.reset();
+ this._resetChart();
},
// reset
- reset: function() {
- this.chart.reset();
+ _resetChart: function() {
this.chart.set('id', Utils.uuid());
this.chart.set('dataset_id', this.app.options.dataset.id);
this.chart.set('type', 'bardiagram');
this.chart.set('title', 'Chart title');
},
- // set chart
- setChart: function(new_chart) {
- this.chart.copy(new_chart);
- },
-
// create chart
_saveChart: function() {
// update chart data
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae config/plugins/visualizations/charts/static/views/charts.js
--- a/config/plugins/visualizations/charts/static/views/charts.js
+++ b/config/plugins/visualizations/charts/static/views/charts.js
@@ -16,12 +16,12 @@
ondblclick : function(chart_id) {
// get chart
var chart = self.app.charts.get(chart_id);
-
+ self.app.chart.copy(chart);
+
// show edit
self.$el.hide();
// update model and show create
- self.app.chart_view.setChart(chart);
self.app.chart_view.$el.show();
},
onchange : function(chart_id) {
@@ -41,7 +41,7 @@
tooltip: 'Create',
onclick: function() {
self.$el.hide();
- self.app.chart_view.reset();
+ self.app.chart.reset();
self.app.chart_view.$el.show();
}
}),
@@ -57,11 +57,11 @@
// get chart
var chart = self.app.charts.get(chart_id);
+ self.app.chart.copy(chart);
// show edit
self.$el.hide();
self.app.chart_view.$el.show();
- self.app.chart_view.setChart(chart);
}
}),
'delete' : new Ui.ButtonIcon({
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae config/plugins/visualizations/charts/static/views/group.js
--- a/config/plugins/visualizations/charts/static/views/group.js
+++ b/config/plugins/visualizations/charts/static/views/group.js
@@ -1,13 +1,10 @@
// dependencies
-define(['library/portlet', 'library/table', 'library/ui', 'library/utils', 'models/group'],
- function(Portlet, Table, Ui, Utils, Group) {
+define(['library/portlet', 'library/table', 'library/ui', 'library/utils'],
+ function(Portlet, Table, Ui, Utils) {
// chart config
return Backbone.View.extend(
{
- // model
- group: new Group(),
-
// columns
columns: [],
@@ -18,6 +15,7 @@
// get current chart object
this.chart = this.app.chart;
+ this.group = this.app.group;
// ui elements
this.message = new Ui.Message();
@@ -69,6 +67,9 @@
this.group.on('change', function() {
self._refreshGroup();
});
+ this.group.on('reset', function() {
+ self._resetGroup();
+ });
},
// show
@@ -77,8 +78,7 @@
},
// reset
- reset: function() {
- this.group.reset();
+ _resetGroup: function() {
this.group.set('id', Utils.uuid());
this.group.set('label', 'Group label');
},
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae config/plugins/visualizations/charts/static/views/groups.js
--- a/config/plugins/visualizations/charts/static/views/groups.js
+++ b/config/plugins/visualizations/charts/static/views/groups.js
@@ -37,9 +37,9 @@
icon : 'fa-plus',
tooltip: 'Create',
onclick: function() {
+ self.app.group.reset();
self.app.chart_view.$el.hide();
self.app.group_view.show();
- self.app.group_view.reset();
}
}),
'edit' : new Ui.ButtonIcon({
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae lib/galaxy/datatypes/data.py
--- a/lib/galaxy/datatypes/data.py
+++ b/lib/galaxy/datatypes/data.py
@@ -512,13 +512,14 @@
def before_setting_metadata( self, dataset ):
"""This function is called on the dataset before metadata is set."""
dataset.clear_associated_files( metadata_safe = True )
- def __new_composite_file( self, name, optional = False, mimetype = None, description = None, substitute_name_with_metadata = None, is_binary = False, space_to_tab = False, **kwds ):
+ def __new_composite_file( self, name, optional = False, mimetype = None, description = None, substitute_name_with_metadata = None, is_binary = False, to_posix_lines = True, space_to_tab = False, **kwds ):
kwds[ 'name' ] = name
kwds[ 'optional' ] = optional
kwds[ 'mimetype' ] = mimetype
kwds[ 'description' ] = description
kwds[ 'substitute_name_with_metadata' ] = substitute_name_with_metadata
kwds[ 'is_binary' ] = is_binary
+ kwds[ 'to_posix_lines' ] = to_posix_lines
kwds[ 'space_to_tab' ] = space_to_tab
return Bunch( **kwds )
def add_composite_file( self, name, **kwds ):
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae lib/galaxy/tools/actions/upload_common.py
--- a/lib/galaxy/tools/actions/upload_common.py
+++ b/lib/galaxy/tools/actions/upload_common.py
@@ -332,6 +332,7 @@
is_binary=is_binary,
link_data_only=link_data_only,
uuid=uuid_str,
+ to_posix_lines=uploaded_dataset.to_posix_lines,
space_to_tab=uploaded_dataset.space_to_tab,
in_place=trans.app.config.external_chown_script is None,
path=uploaded_dataset.path )
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae lib/galaxy/tools/parameters/grouping.py
--- a/lib/galaxy/tools/parameters/grouping.py
+++ b/lib/galaxy/tools/parameters/grouping.py
@@ -266,6 +266,9 @@
name = context.get( 'NAME', None )
info = context.get( 'INFO', None )
warnings = []
+ to_posix_lines = False
+ if context.get( 'to_posix_lines', None ) not in [ "None", None, False ]:
+ to_posix_lines = True
space_to_tab = False
if context.get( 'space_to_tab', None ) not in [ "None", None, False ]:
space_to_tab = True
@@ -298,6 +301,7 @@
break
if file_bunch.path:
break
+ file_bunch.to_posix_lines = to_posix_lines
file_bunch.space_to_tab = space_to_tab
return file_bunch, warnings
def get_filenames( context ):
@@ -307,16 +311,21 @@
ftp_files = context['ftp_files']
name = context.get( 'NAME', None )
info = context.get( 'INFO', None )
+ to_posix_lines = False
+ if context.get( 'to_posix_lines', None ) not in [ "None", None, False ]:
+ to_posix_lines = True
space_to_tab = False
if context.get( 'space_to_tab', None ) not in [ "None", None, False ]:
space_to_tab = True
warnings = []
file_bunch = get_data_file_filename( data_file, override_name = name, override_info = info )
if file_bunch.path:
+ file_bunch.to_posix_lines = to_posix_lines
file_bunch.space_to_tab = space_to_tab
rval.append( file_bunch )
for file_bunch in get_url_paste_urls_or_filename( context, override_name = name, override_info = info ):
if file_bunch.path:
+ file_bunch.to_posix_lines = to_posix_lines
file_bunch.space_to_tab = space_to_tab
rval.append( file_bunch )
# look for files uploaded via FTP
@@ -390,11 +399,13 @@
#replace sniff here with just creating an empty file
temp_name, is_multi_byte = sniff.stream_to_file( StringIO.StringIO( d_type.generate_primary_file( dataset ) ), prefix='upload_auto_primary_file' )
dataset.primary_file = temp_name
+ dataset.to_posix_lines = True
dataset.space_to_tab = False
else:
file_bunch, warnings = get_one_filename( groups_incoming[ 0 ] )
writable_files_offset = 1
dataset.primary_file = file_bunch.path
+ dataset.to_posix_lines = file_bunch.to_posix_lines
dataset.space_to_tab = file_bunch.space_to_tab
dataset.warnings.extend( warnings )
if dataset.primary_file is None:#remove this before finish, this should create an empty dataset
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae 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
@@ -524,7 +524,7 @@
results[ 'repository_status' ].append( message )
stop_time = strftime( "%Y-%m-%d %H:%M:%S" )
results[ 'stop_time' ] = stop_time
- return json.to_json_string( results, sort_keys=True, indent=4 * ' ' )
+ return json.to_json_string( results, sort_keys=True, indent=4 )
@web.expose_api
def show( self, trans, id, **kwd ):
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae lib/galaxy/webapps/galaxy/api/tools.py
--- a/lib/galaxy/webapps/galaxy/api/tools.py
+++ b/lib/galaxy/webapps/galaxy/api/tools.py
@@ -53,7 +53,7 @@
link_details = util.string_as_bool( kwd.get( 'link_details', False ) )
try:
id = urllib.unquote_plus( id )
- tool = self.app.toolbox.tools_by_id.get( id, None )
+ tool = self.app.toolbox.get_tool( id )
if not tool:
trans.response.status = 404
return { 'error': 'tool not found', 'id': id }
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae lib/galaxy/webapps/galaxy/buildapp.py
--- a/lib/galaxy/webapps/galaxy/buildapp.py
+++ b/lib/galaxy/webapps/galaxy/buildapp.py
@@ -129,7 +129,7 @@
webapp.mapper.resource( 'role', 'roles', path_prefix='/api' )
webapp.mapper.resource( 'group', 'groups', path_prefix='/api' )
webapp.mapper.resource_with_deleted( 'quota', 'quotas', path_prefix='/api' )
- webapp.mapper.connect( '/api/tools/{id:.*?}', action='show', controller="tools" )
+ webapp.mapper.connect( '/api/tools/{id:.+?}', action='show', controller="tools" )
webapp.mapper.resource( 'tool', 'tools', path_prefix='/api' )
webapp.mapper.resource_with_deleted( 'user', 'users', path_prefix='/api' )
webapp.mapper.resource( 'genome', 'genomes', path_prefix='/api' )
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae lib/galaxy/webapps/tool_shed/api/repositories.py
--- a/lib/galaxy/webapps/tool_shed/api/repositories.py
+++ b/lib/galaxy/webapps/tool_shed/api/repositories.py
@@ -384,7 +384,7 @@
results = handle_repository( trans, repository, results )
stop_time = strftime( "%Y-%m-%d %H:%M:%S" )
results[ 'stop_time' ] = stop_time
- return json.to_json_string( results, sort_keys=True, indent=4 * ' ' )
+ return json.to_json_string( results, sort_keys=True, indent=4 )
@web.expose_api
def reset_metadata_on_repository( self, trans, payload, **kwd ):
@@ -423,7 +423,7 @@
results = handle_repository( trans, start_time, repository )
stop_time = strftime( "%Y-%m-%d %H:%M:%S" )
results[ 'stop_time' ] = stop_time
- return json.to_json_string( results, sort_keys=True, indent=4 * ' ' )
+ return json.to_json_string( results, sort_keys=True, indent=4 )
@web.expose_api_anonymous
def show( self, trans, id, **kwd ):
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -877,8 +877,7 @@
username = trans.user.username
clause_list = []
for repository in trans.sa_session.query( trans.model.Repository ) \
- .filter( and_( trans.model.Repository.table.c.deleted == False,
- trans.model.Repository.table.c.deprecated == False ) ):
+ .filter( trans.model.Repository.table.c.deleted == False ):
# Always reset metadata on all repositories of type tool_dependency_definition.
if repository.type == rt_util.TOOL_DEPENDENCY_DEFINITION:
clause_list.append( trans.model.Repository.table.c.id == repository.id )
@@ -905,14 +904,12 @@
else:
if order:
return trans.sa_session.query( trans.model.Repository ) \
- .filter( and_( trans.model.Repository.table.c.deleted == False,
- trans.model.Repository.table.c.deprecated == False ) ) \
+ .filter( trans.model.Repository.table.c.deleted == False ) \
.order_by( trans.model.Repository.table.c.name,
trans.model.Repository.table.c.user_id )
else:
return trans.sa_session.query( trans.model.Repository ) \
- .filter( and_( trans.model.Repository.table.c.deleted == False,
- trans.model.Repository.table.c.deprecated == False ) )
+ .filter( trans.model.Repository.table.c.deleted == False )
else:
# We're in Galaxy.
if order:
@@ -1599,8 +1596,8 @@
return folder_contents
def pretty_print( dict=None ):
- if dict:
- return json.to_json_string( dict, sort_keys=True, indent=4 * ' ' )
+ if dict is not None:
+ return json.to_json_string( dict, sort_keys=True, indent=4 )
def remove_dir( dir ):
"""Attempt to remove a directory from disk."""
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae test/functional/api/test_tools.py
--- a/test/functional/api/test_tools.py
+++ b/test/functional/api/test_tools.py
@@ -33,6 +33,27 @@
create_response = self._post( "tools", data=payload )
self._assert_has_keys( create_response.json(), 'outputs' )
+ def test_upload_posix_newline_fixes( self ):
+ windows_content = "1\t2\t3\r4\t5\t6\r"
+ posix_content = windows_content.replace("\r", "\n")
+ result_content = self._upload_and_get_content( windows_content )
+ self.assertEquals( result_content, posix_content )
+
+ def test_upload_disable_posix_fix( self ):
+ windows_content = "1\t2\t3\r4\t5\t6\r"
+ result_content = self._upload_and_get_content( windows_content, to_posix_lines=None )
+ self.assertEquals( result_content, windows_content )
+
+ def test_upload_tab_to_space( self ):
+ table = "1 2 3\n4 5 6\n"
+ result_content = self._upload_and_get_content( table, space_to_tab="Yes" )
+ self.assertEquals( result_content, "1\t2\t3\n4\t5\t6\n" )
+
+ def test_upload_tab_to_space_off_by_default( self ):
+ table = "1 2 3\n4 5 6\n"
+ result_content = self._upload_and_get_content( table )
+ self.assertEquals( result_content, table )
+
def test_run_cat1( self ):
history_id = self._new_history()
new_dataset = self._new_dataset( history_id )
@@ -52,6 +73,14 @@
self._assert_has_keys( create_response.json(), 'outputs' )
self._wait_for_history( history_id, assert_ok=True )
+ 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" ] ) )
+ self._assert_status_code_is( display_response, 200 )
+ return display_response.content
+
def _new_dataset( self, history_id, content='TestData123', **kwds ):
payload = self._upload_payload( history_id, content, **kwds )
run_response = self._post( "tools", data=payload )
@@ -86,6 +115,10 @@
'dbkey': dbkey,
'file_type': file_type,
}
+ if "to_posix_lines" in kwds:
+ upload_params[ "files_0|to_posix_lines"] = kwds[ "to_posix_lines" ]
+ if "space_to_tab" in kwds:
+ upload_params[ "files_0|space_to_tab" ] = kwds[ "space_to_tab" ]
return self._run_tool_payload(
tool_id='upload1',
inputs=upload_params,
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae tools/data_source/upload.py
--- a/tools/data_source/upload.py
+++ b/tools/data_source/upload.py
@@ -264,10 +264,14 @@
if link_data_only == 'copy_files':
if dataset.type in ( 'server_dir', 'path_paste' ) and data_type not in [ 'gzip', 'bz2', 'zip' ]:
in_place = False
- if dataset.space_to_tab:
- line_count, converted_path = sniff.convert_newlines_sep2tabs( dataset.path, in_place=in_place )
- else:
- line_count, converted_path = sniff.convert_newlines( dataset.path, in_place=in_place )
+ # Convert universal line endings to Posix line endings, but allow the user to turn it off,
+ # so that is becomes possible to upload gzip, bz2 or zip files with binary data without
+ # corrupting the content of those files.
+ if dataset.to_posix_lines:
+ if dataset.space_to_tab:
+ line_count, converted_path = sniff.convert_newlines_sep2tabs( dataset.path, in_place=in_place )
+ else:
+ line_count, converted_path = sniff.convert_newlines( dataset.path, in_place=in_place )
if dataset.file_type == 'auto':
ext = sniff.guess_ext( dataset.path, registry.sniff_order )
else:
diff -r 1773a15233bb1424f86481068a386d6e0aeaba9e -r 2b0aba01ad8d5025684c19b33be4a3f1fb5916ae tools/data_source/upload.xml
--- a/tools/data_source/upload.xml
+++ b/tools/data_source/upload.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<tool name="Upload File" id="upload1" version="1.1.3" workflow_compatible="false">
+<tool name="Upload File" id="upload1" version="1.1.4" workflow_compatible="false"><description>
from your computer
</description>
@@ -38,6 +38,12 @@
</param><param name="url_paste" type="text" area="true" size="5x35" label="URL/Text" help="Here you may specify a list of URLs (one per line) or paste the contents of a file."/><param name="ftp_files" type="ftpfile" label="Files uploaded via FTP"/>
+ <!-- Change the following parameter from hidden to select to enable
+ modifying this option via the Web GUI. See Bitbucket pull request
+ 171 for more information. -->
+ <param name="to_posix_lines" type="hidden" display="checkboxes" multiple="True" label="Convert universal line endings to Posix line endings" help="Turn this option off if you upload a gzip, bz2 or zip archive which contains a binary file." value="Yes">
+ <option value="Yes" selected="true">Yes</option>
+ </param><param name="space_to_tab" type="select" display="checkboxes" multiple="True" label="Convert spaces to tabs" help="Use this option if you are entering intervals by hand."><option value="Yes">Yes</option></param>
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
5 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/060677b04984/
Changeset: 060677b04984
Branch: upload_binary_files_archive
User: ghuls
Date: 2013-05-27 20:55:52
Summary: Avoid corruption of binary files embedded in gzip, bz2 and zip archives in the upload tool.
Add an option in the upload tool to disable the conversion of universal
line endings to Posix line endings.
This is useful for avoiding corruption of uploaded files when a binary
file is contained inside a gzip, bz2 and zip archive.
This fixes bug report: https://trello.com/card/issue-with-uploaded-2bit-gz-files/506338ce32ae458f6…
Affected #: 5 files
diff -r 31714646a7b441f34a43748065278a1b08940c3c -r 060677b04984c5d171c34330879507c9edca979e lib/galaxy/datatypes/data.py
--- a/lib/galaxy/datatypes/data.py
+++ b/lib/galaxy/datatypes/data.py
@@ -498,13 +498,14 @@
def before_setting_metadata( self, dataset ):
"""This function is called on the dataset before metadata is set."""
dataset.clear_associated_files( metadata_safe = True )
- def __new_composite_file( self, name, optional = False, mimetype = None, description = None, substitute_name_with_metadata = None, is_binary = False, space_to_tab = False, **kwds ):
+ def __new_composite_file( self, name, optional = False, mimetype = None, description = None, substitute_name_with_metadata = None, is_binary = False, to_posix_lines = True, space_to_tab = False, **kwds ):
kwds[ 'name' ] = name
kwds[ 'optional' ] = optional
kwds[ 'mimetype' ] = mimetype
kwds[ 'description' ] = description
kwds[ 'substitute_name_with_metadata' ] = substitute_name_with_metadata
kwds[ 'is_binary' ] = is_binary
+ kwds[ 'to_posix_lines' ] = to_posix_lines
kwds[ 'space_to_tab' ] = space_to_tab
return Bunch( **kwds )
def add_composite_file( self, name, **kwds ):
diff -r 31714646a7b441f34a43748065278a1b08940c3c -r 060677b04984c5d171c34330879507c9edca979e lib/galaxy/tools/actions/upload_common.py
--- a/lib/galaxy/tools/actions/upload_common.py
+++ b/lib/galaxy/tools/actions/upload_common.py
@@ -307,6 +307,7 @@
is_binary = is_binary,
link_data_only = link_data_only,
uuid = uuid_str,
+ to_posix_lines = uploaded_dataset.to_posix_lines,
space_to_tab = uploaded_dataset.space_to_tab,
in_place = trans.app.config.external_chown_script is None,
path = uploaded_dataset.path )
diff -r 31714646a7b441f34a43748065278a1b08940c3c -r 060677b04984c5d171c34330879507c9edca979e lib/galaxy/tools/parameters/grouping.py
--- a/lib/galaxy/tools/parameters/grouping.py
+++ b/lib/galaxy/tools/parameters/grouping.py
@@ -254,6 +254,9 @@
name = context.get( 'NAME', None )
info = context.get( 'INFO', None )
warnings = []
+ to_posix_lines = False
+ if context.get( 'to_posix_lines', None ) not in [ "None", None, False ]:
+ to_posix_lines = True
space_to_tab = False
if context.get( 'space_to_tab', None ) not in [ "None", None, False ]:
space_to_tab = True
@@ -286,6 +289,7 @@
break
if file_bunch.path:
break
+ file_bunch.to_posix_lines = to_posix_lines
file_bunch.space_to_tab = space_to_tab
return file_bunch, warnings
def get_filenames( context ):
@@ -295,16 +299,21 @@
ftp_files = context['ftp_files']
name = context.get( 'NAME', None )
info = context.get( 'INFO', None )
+ to_posix_lines = False
+ if context.get( 'to_posix_lines', None ) not in [ "None", None, False ]:
+ to_posix_lines = True
space_to_tab = False
if context.get( 'space_to_tab', None ) not in [ "None", None, False ]:
space_to_tab = True
warnings = []
file_bunch = get_data_file_filename( data_file, override_name = name, override_info = info )
if file_bunch.path:
+ file_bunch.to_posix_lines = to_posix_lines
file_bunch.space_to_tab = space_to_tab
rval.append( file_bunch )
for file_bunch in get_url_paste_urls_or_filename( context, override_name = name, override_info = info ):
if file_bunch.path:
+ file_bunch.to_posix_lines = to_posix_lines
file_bunch.space_to_tab = space_to_tab
rval.append( file_bunch )
# look for files uploaded via FTP
@@ -378,11 +387,13 @@
#replace sniff here with just creating an empty file
temp_name, is_multi_byte = sniff.stream_to_file( StringIO.StringIO( d_type.generate_primary_file( dataset ) ), prefix='upload_auto_primary_file' )
dataset.primary_file = temp_name
+ dataset.to_posix_lines = True
dataset.space_to_tab = False
else:
file_bunch, warnings = get_one_filename( groups_incoming[ 0 ] )
writable_files_offset = 1
dataset.primary_file = file_bunch.path
+ dataset.to_posix_lines = file_bunch.to_posix_lines
dataset.space_to_tab = file_bunch.space_to_tab
dataset.warnings.extend( warnings )
if dataset.primary_file is None:#remove this before finish, this should create an empty dataset
diff -r 31714646a7b441f34a43748065278a1b08940c3c -r 060677b04984c5d171c34330879507c9edca979e tools/data_source/upload.py
--- a/tools/data_source/upload.py
+++ b/tools/data_source/upload.py
@@ -264,10 +264,14 @@
if link_data_only == 'copy_files':
if dataset.type in ( 'server_dir', 'path_paste' ) and data_type not in [ 'gzip', 'bz2', 'zip' ]:
in_place = False
- if dataset.space_to_tab:
- line_count, converted_path = sniff.convert_newlines_sep2tabs( dataset.path, in_place=in_place )
- else:
- line_count, converted_path = sniff.convert_newlines( dataset.path, in_place=in_place )
+ # Convert universal line endings to Posix line endings, but allow the user to turn it off,
+ # so that is becomes possible to upload gzip, bz2 or zip files with binary data without
+ # corrupting the content of those files.
+ if dataset.to_posix_lines:
+ if dataset.space_to_tab:
+ line_count, converted_path = sniff.convert_newlines_sep2tabs( dataset.path, in_place=in_place )
+ else:
+ line_count, converted_path = sniff.convert_newlines( dataset.path, in_place=in_place )
if dataset.file_type == 'auto':
ext = sniff.guess_ext( dataset.path, registry.sniff_order )
else:
diff -r 31714646a7b441f34a43748065278a1b08940c3c -r 060677b04984c5d171c34330879507c9edca979e tools/data_source/upload.xml
--- a/tools/data_source/upload.xml
+++ b/tools/data_source/upload.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<tool name="Upload File" id="upload1" version="1.1.3" workflow_compatible="false">
+<tool name="Upload File" id="upload1" version="1.1.4" workflow_compatible="false"><description>
from your computer
</description>
@@ -38,6 +38,9 @@
</param><param name="url_paste" type="text" area="true" size="5x35" label="URL/Text" help="Here you may specify a list of URLs (one per line) or paste the contents of a file."/><param name="ftp_files" type="ftpfile" label="Files uploaded via FTP"/>
+ <param name="to_posix_lines" type="select" display="checkboxes" multiple="True" label="Convert universal line endings to Posix line endings" help="Turn this option off if you upload a gzip, bz2 or zip archive which contains a binary file.">
+ <option value="Yes" selected="true">Yes</option>
+ </param><param name="space_to_tab" type="select" display="checkboxes" multiple="True" label="Convert spaces to tabs" help="Use this option if you are entering intervals by hand."><option value="Yes">Yes</option></param>
https://bitbucket.org/galaxy/galaxy-central/commits/8d69bfa4c4e6/
Changeset: 8d69bfa4c4e6
User: jmchilton
Date: 2014-01-17 06:57:43
Summary: Merge pull request 171.
Affected #: 5 files
diff -r 41cd069aa739f735add1b7c6c4bdb5881dc7ed3b -r 8d69bfa4c4e602acf4c7cda0164d9f5e52876dd4 lib/galaxy/datatypes/data.py
--- a/lib/galaxy/datatypes/data.py
+++ b/lib/galaxy/datatypes/data.py
@@ -512,13 +512,14 @@
def before_setting_metadata( self, dataset ):
"""This function is called on the dataset before metadata is set."""
dataset.clear_associated_files( metadata_safe = True )
- def __new_composite_file( self, name, optional = False, mimetype = None, description = None, substitute_name_with_metadata = None, is_binary = False, space_to_tab = False, **kwds ):
+ def __new_composite_file( self, name, optional = False, mimetype = None, description = None, substitute_name_with_metadata = None, is_binary = False, to_posix_lines = True, space_to_tab = False, **kwds ):
kwds[ 'name' ] = name
kwds[ 'optional' ] = optional
kwds[ 'mimetype' ] = mimetype
kwds[ 'description' ] = description
kwds[ 'substitute_name_with_metadata' ] = substitute_name_with_metadata
kwds[ 'is_binary' ] = is_binary
+ kwds[ 'to_posix_lines' ] = to_posix_lines
kwds[ 'space_to_tab' ] = space_to_tab
return Bunch( **kwds )
def add_composite_file( self, name, **kwds ):
diff -r 41cd069aa739f735add1b7c6c4bdb5881dc7ed3b -r 8d69bfa4c4e602acf4c7cda0164d9f5e52876dd4 lib/galaxy/tools/actions/upload_common.py
--- a/lib/galaxy/tools/actions/upload_common.py
+++ b/lib/galaxy/tools/actions/upload_common.py
@@ -332,6 +332,7 @@
is_binary=is_binary,
link_data_only=link_data_only,
uuid=uuid_str,
+ to_posix_lines=uploaded_dataset.to_posix_lines,
space_to_tab=uploaded_dataset.space_to_tab,
in_place=trans.app.config.external_chown_script is None,
path=uploaded_dataset.path )
diff -r 41cd069aa739f735add1b7c6c4bdb5881dc7ed3b -r 8d69bfa4c4e602acf4c7cda0164d9f5e52876dd4 lib/galaxy/tools/parameters/grouping.py
--- a/lib/galaxy/tools/parameters/grouping.py
+++ b/lib/galaxy/tools/parameters/grouping.py
@@ -266,6 +266,9 @@
name = context.get( 'NAME', None )
info = context.get( 'INFO', None )
warnings = []
+ to_posix_lines = False
+ if context.get( 'to_posix_lines', None ) not in [ "None", None, False ]:
+ to_posix_lines = True
space_to_tab = False
if context.get( 'space_to_tab', None ) not in [ "None", None, False ]:
space_to_tab = True
@@ -298,6 +301,7 @@
break
if file_bunch.path:
break
+ file_bunch.to_posix_lines = to_posix_lines
file_bunch.space_to_tab = space_to_tab
return file_bunch, warnings
def get_filenames( context ):
@@ -307,16 +311,21 @@
ftp_files = context['ftp_files']
name = context.get( 'NAME', None )
info = context.get( 'INFO', None )
+ to_posix_lines = False
+ if context.get( 'to_posix_lines', None ) not in [ "None", None, False ]:
+ to_posix_lines = True
space_to_tab = False
if context.get( 'space_to_tab', None ) not in [ "None", None, False ]:
space_to_tab = True
warnings = []
file_bunch = get_data_file_filename( data_file, override_name = name, override_info = info )
if file_bunch.path:
+ file_bunch.to_posix_lines = to_posix_lines
file_bunch.space_to_tab = space_to_tab
rval.append( file_bunch )
for file_bunch in get_url_paste_urls_or_filename( context, override_name = name, override_info = info ):
if file_bunch.path:
+ file_bunch.to_posix_lines = to_posix_lines
file_bunch.space_to_tab = space_to_tab
rval.append( file_bunch )
# look for files uploaded via FTP
@@ -390,11 +399,13 @@
#replace sniff here with just creating an empty file
temp_name, is_multi_byte = sniff.stream_to_file( StringIO.StringIO( d_type.generate_primary_file( dataset ) ), prefix='upload_auto_primary_file' )
dataset.primary_file = temp_name
+ dataset.to_posix_lines = True
dataset.space_to_tab = False
else:
file_bunch, warnings = get_one_filename( groups_incoming[ 0 ] )
writable_files_offset = 1
dataset.primary_file = file_bunch.path
+ dataset.to_posix_lines = file_bunch.to_posix_lines
dataset.space_to_tab = file_bunch.space_to_tab
dataset.warnings.extend( warnings )
if dataset.primary_file is None:#remove this before finish, this should create an empty dataset
diff -r 41cd069aa739f735add1b7c6c4bdb5881dc7ed3b -r 8d69bfa4c4e602acf4c7cda0164d9f5e52876dd4 tools/data_source/upload.py
--- a/tools/data_source/upload.py
+++ b/tools/data_source/upload.py
@@ -264,10 +264,14 @@
if link_data_only == 'copy_files':
if dataset.type in ( 'server_dir', 'path_paste' ) and data_type not in [ 'gzip', 'bz2', 'zip' ]:
in_place = False
- if dataset.space_to_tab:
- line_count, converted_path = sniff.convert_newlines_sep2tabs( dataset.path, in_place=in_place )
- else:
- line_count, converted_path = sniff.convert_newlines( dataset.path, in_place=in_place )
+ # Convert universal line endings to Posix line endings, but allow the user to turn it off,
+ # so that is becomes possible to upload gzip, bz2 or zip files with binary data without
+ # corrupting the content of those files.
+ if dataset.to_posix_lines:
+ if dataset.space_to_tab:
+ line_count, converted_path = sniff.convert_newlines_sep2tabs( dataset.path, in_place=in_place )
+ else:
+ line_count, converted_path = sniff.convert_newlines( dataset.path, in_place=in_place )
if dataset.file_type == 'auto':
ext = sniff.guess_ext( dataset.path, registry.sniff_order )
else:
diff -r 41cd069aa739f735add1b7c6c4bdb5881dc7ed3b -r 8d69bfa4c4e602acf4c7cda0164d9f5e52876dd4 tools/data_source/upload.xml
--- a/tools/data_source/upload.xml
+++ b/tools/data_source/upload.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<tool name="Upload File" id="upload1" version="1.1.3" workflow_compatible="false">
+<tool name="Upload File" id="upload1" version="1.1.4" workflow_compatible="false"><description>
from your computer
</description>
@@ -38,6 +38,9 @@
</param><param name="url_paste" type="text" area="true" size="5x35" label="URL/Text" help="Here you may specify a list of URLs (one per line) or paste the contents of a file."/><param name="ftp_files" type="ftpfile" label="Files uploaded via FTP"/>
+ <param name="to_posix_lines" type="select" display="checkboxes" multiple="True" label="Convert universal line endings to Posix line endings" help="Turn this option off if you upload a gzip, bz2 or zip archive which contains a binary file.">
+ <option value="Yes" selected="true">Yes</option>
+ </param><param name="space_to_tab" type="select" display="checkboxes" multiple="True" label="Convert spaces to tabs" help="Use this option if you are entering intervals by hand."><option value="Yes">Yes</option></param>
https://bitbucket.org/galaxy/galaxy-central/commits/daeb94f97da7/
Changeset: daeb94f97da7
Branch: upload_binary_files_archive
User: jmchilton
Date: 2014-01-17 06:58:44
Summary: Close branch upload_binary_files_archive.
Affected #: 0 files
https://bitbucket.org/galaxy/galaxy-central/commits/9acf83083258/
Changeset: 9acf83083258
User: jmchilton
Date: 2014-01-17 07:03:26
Summary: Functionally test various upload options via API.
Affected #: 1 file
diff -r 8d69bfa4c4e602acf4c7cda0164d9f5e52876dd4 -r 9acf83083258e6b6c9ea867aed97281b27991d0a test/functional/api/test_tools.py
--- a/test/functional/api/test_tools.py
+++ b/test/functional/api/test_tools.py
@@ -33,6 +33,27 @@
create_response = self._post( "tools", data=payload )
self._assert_has_keys( create_response.json(), 'outputs' )
+ def test_upload_posix_newline_fixes( self ):
+ windows_content = "1\t2\t3\r4\t5\t6\r"
+ posix_content = windows_content.replace("\r", "\n")
+ result_content = self._upload_and_get_content( windows_content )
+ self.assertEquals( result_content, posix_content )
+
+ def test_upload_disable_posix_fix( self ):
+ windows_content = "1\t2\t3\r4\t5\t6\r"
+ result_content = self._upload_and_get_content( windows_content, to_posix_lines=None )
+ self.assertEquals( result_content, windows_content )
+
+ def test_upload_tab_to_space( self ):
+ table = "1 2 3\n4 5 6\n"
+ result_content = self._upload_and_get_content( table, space_to_tab="Yes" )
+ self.assertEquals( result_content, "1\t2\t3\n4\t5\t6\n" )
+
+ def test_upload_tab_to_space_off_by_default( self ):
+ table = "1 2 3\n4 5 6\n"
+ result_content = self._upload_and_get_content( table )
+ self.assertEquals( result_content, table )
+
def test_run_cat1( self ):
history_id = self._new_history()
new_dataset = self._new_dataset( history_id )
@@ -52,6 +73,14 @@
self._assert_has_keys( create_response.json(), 'outputs' )
self._wait_for_history( history_id, assert_ok=True )
+ 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" ] ) )
+ self._assert_status_code_is( display_response, 200 )
+ return display_response.content
+
def _new_dataset( self, history_id, content='TestData123', **kwds ):
payload = self._upload_payload( history_id, content, **kwds )
run_response = self._post( "tools", data=payload )
@@ -86,6 +115,10 @@
'dbkey': dbkey,
'file_type': file_type,
}
+ if "to_posix_lines" in kwds:
+ upload_params[ "files_0|to_posix_lines"] = kwds[ "to_posix_lines" ]
+ if "space_to_tab" in kwds:
+ upload_params[ "files_0|space_to_tab" ] = kwds[ "space_to_tab" ]
return self._run_tool_payload(
tool_id='upload1',
inputs=upload_params,
https://bitbucket.org/galaxy/galaxy-central/commits/b1121a315205/
Changeset: b1121a315205
User: jmchilton
Date: 2014-01-17 07:03:26
Summary: Hide to_posix_lines in UI by default.
Galaxy still completely supports this option on backend - API tests still completely work and will hopefully ensure this functionality continues running. Any Galaxy deployements that wish to enable this option simply have to switch this one param from hidden to select. This is a ugly workaround - but it is a very small workaround - and will hopefully alleviate any potential fears Gert Hulselmans has of Galaxy diverging from his changes. This is only a stop gap until the Galaxy upload UI supports more advanced options.
I have previously outlined my concerns with the visual clutter on the upload.xml page - this is why I am hiding it by default. If anyone with commit access disagrees - please by all means backout of this individual changeset and restore the full functionality of pull request 171 (I have a terrible eye for this sort of GUI design stuff).
Affected #: 1 file
diff -r 9acf83083258e6b6c9ea867aed97281b27991d0a -r b1121a315205e8152d9c59199443c492340e9f0b tools/data_source/upload.xml
--- a/tools/data_source/upload.xml
+++ b/tools/data_source/upload.xml
@@ -38,7 +38,10 @@
</param><param name="url_paste" type="text" area="true" size="5x35" label="URL/Text" help="Here you may specify a list of URLs (one per line) or paste the contents of a file."/><param name="ftp_files" type="ftpfile" label="Files uploaded via FTP"/>
- <param name="to_posix_lines" type="select" display="checkboxes" multiple="True" label="Convert universal line endings to Posix line endings" help="Turn this option off if you upload a gzip, bz2 or zip archive which contains a binary file.">
+ <!-- Change the following parameter from hidden to select to enable
+ modifying this option via the Web GUI. See Bitbucket pull request
+ 171 for more information. -->
+ <param name="to_posix_lines" type="hidden" display="checkboxes" multiple="True" label="Convert universal line endings to Posix line endings" help="Turn this option off if you upload a gzip, bz2 or zip archive which contains a binary file." value="Yes"><option value="Yes" selected="true">Yes</option></param><param name="space_to_tab" type="select" display="checkboxes" multiple="True" label="Convert spaces to tabs" help="Use this option if you are entering intervals by hand.">
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 for api/tools/show/ when no id is provided.
by commits-noreply@bitbucket.org 16 Jan '14
by commits-noreply@bitbucket.org 16 Jan '14
16 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/41cd069aa739/
Changeset: 41cd069aa739
User: dan
Date: 2014-01-16 22:52:39
Summary: Fix for api/tools/show/ when no id is provided.
Affected #: 1 file
diff -r 71186fb4b179fc051e6919dd0e31e94f9cedc3d6 -r 41cd069aa739f735add1b7c6c4bdb5881dc7ed3b lib/galaxy/webapps/galaxy/buildapp.py
--- a/lib/galaxy/webapps/galaxy/buildapp.py
+++ b/lib/galaxy/webapps/galaxy/buildapp.py
@@ -129,7 +129,7 @@
webapp.mapper.resource( 'role', 'roles', path_prefix='/api' )
webapp.mapper.resource( 'group', 'groups', path_prefix='/api' )
webapp.mapper.resource_with_deleted( 'quota', 'quotas', path_prefix='/api' )
- webapp.mapper.connect( '/api/tools/{id:.*?}', action='show', controller="tools" )
+ webapp.mapper.connect( '/api/tools/{id:.+?}', action='show', controller="tools" )
webapp.mapper.resource( 'tool', 'tools', path_prefix='/api' )
webapp.mapper.resource_with_deleted( 'user', 'users', path_prefix='/api' )
webapp.mapper.resource( 'genome', 'genomes', path_prefix='/api' )
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/71186fb4b179/
Changeset: 71186fb4b179
User: dan
Date: 2014-01-16 22:21:41
Summary: Use toolbox.get_tool instead of toolbox.tools_by_id.get in tools api show().
Affected #: 1 file
diff -r 40a5f3139ecf714090347612ec69e0d964911d85 -r 71186fb4b179fc051e6919dd0e31e94f9cedc3d6 lib/galaxy/webapps/galaxy/api/tools.py
--- a/lib/galaxy/webapps/galaxy/api/tools.py
+++ b/lib/galaxy/webapps/galaxy/api/tools.py
@@ -53,7 +53,7 @@
link_details = util.string_as_bool( kwd.get( 'link_details', False ) )
try:
id = urllib.unquote_plus( id )
- tool = self.app.toolbox.tools_by_id.get( id, None )
+ tool = self.app.toolbox.get_tool( id )
if not tool:
trans.response.status = 404
return { 'error': 'tool not found', 'id': id }
https://bitbucket.org/galaxy/galaxy-central/commits/b2e473cd17cd/
Changeset: b2e473cd17cd
Branch: stable
User: dan
Date: 2014-01-16 22:21:41
Summary: Use toolbox.get_tool instead of toolbox.tools_by_id.get in tools api show().
Affected #: 1 file
diff -r 4e280310697b806aa0e08c80f342e2c93f1558f0 -r b2e473cd17cdd0e5758cee32e74f9be7723658bf lib/galaxy/webapps/galaxy/api/tools.py
--- a/lib/galaxy/webapps/galaxy/api/tools.py
+++ b/lib/galaxy/webapps/galaxy/api/tools.py
@@ -50,7 +50,7 @@
link_details = util.string_as_bool( kwd.get( 'link_details', False ) )
try:
id = urllib.unquote_plus( id )
- tool = self.app.toolbox.tools_by_id.get( id, None )
+ tool = self.app.toolbox.get_tool( id )
if not tool:
trans.response.status = 404
return { 'error': 'tool not found', 'id': 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
commit/galaxy-central: greg: Forgot None in my last commit
by commits-noreply@bitbucket.org 16 Jan '14
by commits-noreply@bitbucket.org 16 Jan '14
16 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/40a5f3139ecf/
Changeset: 40a5f3139ecf
User: greg
Date: 2014-01-16 22:13:47
Summary: Forgot None in my last commit
Affected #: 1 file
diff -r 56492a1d0d352db016e7ba785fcbc9822b604d61 -r 40a5f3139ecf714090347612ec69e0d964911d85 lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -1596,7 +1596,7 @@
return folder_contents
def pretty_print( dict=None ):
- if dict is not:
+ if dict is not None:
return json.to_json_string( dict, sort_keys=True, indent=4 )
def remove_dir( dir ):
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: Re-include deprecated repositories when resetting metadata since they can be dependencies of installable repositories.
by commits-noreply@bitbucket.org 16 Jan '14
by commits-noreply@bitbucket.org 16 Jan '14
16 Jan '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/56492a1d0d35/
Changeset: 56492a1d0d35
User: greg
Date: 2014-01-16 22:02:39
Summary: Re-include deprecated repositories when resetting metadata since they can be dependencies of installable repositories.
Affected #: 3 files
diff -r dec86d2bd3b10c16c91ec2847840c62b5e2bfe59 -r 56492a1d0d352db016e7ba785fcbc9822b604d61 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
@@ -524,7 +524,7 @@
results[ 'repository_status' ].append( message )
stop_time = strftime( "%Y-%m-%d %H:%M:%S" )
results[ 'stop_time' ] = stop_time
- return json.to_json_string( results, sort_keys=True, indent=4 * ' ' )
+ return json.to_json_string( results, sort_keys=True, indent=4 )
@web.expose_api
def show( self, trans, id, **kwd ):
diff -r dec86d2bd3b10c16c91ec2847840c62b5e2bfe59 -r 56492a1d0d352db016e7ba785fcbc9822b604d61 lib/galaxy/webapps/tool_shed/api/repositories.py
--- a/lib/galaxy/webapps/tool_shed/api/repositories.py
+++ b/lib/galaxy/webapps/tool_shed/api/repositories.py
@@ -384,7 +384,7 @@
results = handle_repository( trans, repository, results )
stop_time = strftime( "%Y-%m-%d %H:%M:%S" )
results[ 'stop_time' ] = stop_time
- return json.to_json_string( results, sort_keys=True, indent=4 * ' ' )
+ return json.to_json_string( results, sort_keys=True, indent=4 )
@web.expose_api
def reset_metadata_on_repository( self, trans, payload, **kwd ):
@@ -423,7 +423,7 @@
results = handle_repository( trans, start_time, repository )
stop_time = strftime( "%Y-%m-%d %H:%M:%S" )
results[ 'stop_time' ] = stop_time
- return json.to_json_string( results, sort_keys=True, indent=4 * ' ' )
+ return json.to_json_string( results, sort_keys=True, indent=4 )
@web.expose_api_anonymous
def show( self, trans, id, **kwd ):
diff -r dec86d2bd3b10c16c91ec2847840c62b5e2bfe59 -r 56492a1d0d352db016e7ba785fcbc9822b604d61 lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -877,8 +877,7 @@
username = trans.user.username
clause_list = []
for repository in trans.sa_session.query( trans.model.Repository ) \
- .filter( and_( trans.model.Repository.table.c.deleted == False,
- trans.model.Repository.table.c.deprecated == False ) ):
+ .filter( trans.model.Repository.table.c.deleted == False ):
# Always reset metadata on all repositories of type tool_dependency_definition.
if repository.type == rt_util.TOOL_DEPENDENCY_DEFINITION:
clause_list.append( trans.model.Repository.table.c.id == repository.id )
@@ -905,14 +904,12 @@
else:
if order:
return trans.sa_session.query( trans.model.Repository ) \
- .filter( and_( trans.model.Repository.table.c.deleted == False,
- trans.model.Repository.table.c.deprecated == False ) ) \
+ .filter( trans.model.Repository.table.c.deleted == False ) \
.order_by( trans.model.Repository.table.c.name,
trans.model.Repository.table.c.user_id )
else:
return trans.sa_session.query( trans.model.Repository ) \
- .filter( and_( trans.model.Repository.table.c.deleted == False,
- trans.model.Repository.table.c.deprecated == False ) )
+ .filter( trans.model.Repository.table.c.deleted == False )
else:
# We're in Galaxy.
if order:
@@ -1599,8 +1596,8 @@
return folder_contents
def pretty_print( dict=None ):
- if dict:
- return json.to_json_string( dict, sort_keys=True, indent=4 * ' ' )
+ if dict is not:
+ return json.to_json_string( dict, sort_keys=True, indent=4 )
def remove_dir( dir ):
"""Attempt to remove a directory from disk."""
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