4 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/0255f2f29a2b/ Changeset: 0255f2f29a2b Branch: next-stable User: Dave Bouvier Date: 2013-10-25 20:39:44 Summary: Check for matching in-memory sniffer before appending. Remove sniffer when deactivating or uninstalling a repository. Additional checks for keys existing before deleting them. Affected #: 1 file diff -r 8109823f43c30a7efa744471b657efbc9624b218 -r 0255f2f29a2ba9fd047c89be919453ea90ab731f lib/galaxy/datatypes/registry.py --- a/lib/galaxy/datatypes/registry.py +++ b/lib/galaxy/datatypes/registry.py @@ -217,7 +217,8 @@ if sniffers: for elem in sniffers.findall( 'sniffer' ): # Keep an in-memory list of sniffer elems to enable persistence. - self.sniffer_elems.append( elem ) + if elem not in self.sniffer_elems: + self.sniffer_elems.append( elem ) dtype = elem.get( 'type', None ) if dtype: try: @@ -239,6 +240,8 @@ module = getattr( module, comp ) aclass = getattr( module, datatype_class_name )() if deactivate: + if elem in self.sniffer_elems: + self.sniffer_elems.remove( elem ) for sniffer_class in self.sniff_order: if sniffer_class.__class__ == aclass.__class__: self.sniff_order.remove( sniffer_class ) @@ -463,10 +466,10 @@ target_datatype = elem[2] if installed_repository_dict: converter_path = installed_repository_dict[ 'converter_path' ] + else: + converter_path = self.converters_path + try: config_path = os.path.join( converter_path, tool_config ) - else: - config_path = os.path.join( self.converters_path, tool_config ) - try: converter = toolbox.load_tool( config_path ) if installed_repository_dict: # If the converter is included in an installed tool shed repository, set the tool @@ -484,7 +487,8 @@ converter.id = tool_dict[ 'guid' ] break if deactivate: - del toolbox.tools_by_id[ converter.id ] + if converter.id in toolbox.tools_by_id: + del toolbox.tools_by_id[ converter.id ] if source_datatype in self.datatype_converters: del self.datatype_converters[ source_datatype ][ target_datatype ] self.log.debug( "Deactivated converter: %s", converter.id ) @@ -496,9 +500,9 @@ self.log.debug( "Loaded converter: %s", converter.id ) except Exception, e: if deactivate: - self.log.exception( "Error deactivating converter (%s): %s" % ( config_path, str( e ) ) ) + self.log.exception( "Error deactivating converter from (%s): %s" % ( converter_path, str( e ) ) ) else: - self.log.exception( "Error loading converter (%s): %s" % ( config_path, str( e ) ) ) + self.log.exception( "Error loading converter (%s): %s" % ( converter_path, str( e ) ) ) def load_display_applications( self, installed_repository_dict=None, deactivate=False ): """ If deactivate is False, add display applications from self.display_app_containers or https://bitbucket.org/galaxy/galaxy-central/commits/0101573c8701/ Changeset: 0101573c8701 User: Dave Bouvier Date: 2013-10-25 20:42:50 Summary: Merge fix from next-stable. Affected #: 1 file diff -r c432e846d53d1506dff86d914bb4c513ffaf19d5 -r 0101573c8701fc94bc848c2a785c48d4f3e484c3 lib/galaxy/datatypes/registry.py --- a/lib/galaxy/datatypes/registry.py +++ b/lib/galaxy/datatypes/registry.py @@ -217,7 +217,8 @@ if sniffers: for elem in sniffers.findall( 'sniffer' ): # Keep an in-memory list of sniffer elems to enable persistence. - self.sniffer_elems.append( elem ) + if elem not in self.sniffer_elems: + self.sniffer_elems.append( elem ) dtype = elem.get( 'type', None ) if dtype: try: @@ -239,6 +240,8 @@ module = getattr( module, comp ) aclass = getattr( module, datatype_class_name )() if deactivate: + if elem in self.sniffer_elems: + self.sniffer_elems.remove( elem ) for sniffer_class in self.sniff_order: if sniffer_class.__class__ == aclass.__class__: self.sniff_order.remove( sniffer_class ) @@ -463,10 +466,10 @@ target_datatype = elem[2] if installed_repository_dict: converter_path = installed_repository_dict[ 'converter_path' ] + else: + converter_path = self.converters_path + try: config_path = os.path.join( converter_path, tool_config ) - else: - config_path = os.path.join( self.converters_path, tool_config ) - try: converter = toolbox.load_tool( config_path ) if installed_repository_dict: # If the converter is included in an installed tool shed repository, set the tool @@ -484,7 +487,8 @@ converter.id = tool_dict[ 'guid' ] break if deactivate: - del toolbox.tools_by_id[ converter.id ] + if converter.id in toolbox.tools_by_id: + del toolbox.tools_by_id[ converter.id ] if source_datatype in self.datatype_converters: del self.datatype_converters[ source_datatype ][ target_datatype ] self.log.debug( "Deactivated converter: %s", converter.id ) @@ -496,9 +500,9 @@ self.log.debug( "Loaded converter: %s", converter.id ) except Exception, e: if deactivate: - self.log.exception( "Error deactivating converter (%s): %s" % ( config_path, str( e ) ) ) + self.log.exception( "Error deactivating converter from (%s): %s" % ( converter_path, str( e ) ) ) else: - self.log.exception( "Error loading converter (%s): %s" % ( config_path, str( e ) ) ) + self.log.exception( "Error loading converter (%s): %s" % ( converter_path, str( e ) ) ) def load_display_applications( self, installed_repository_dict=None, deactivate=False ): """ If deactivate is False, add display applications from self.display_app_containers or https://bitbucket.org/galaxy/galaxy-central/commits/870a79ce1a10/ Changeset: 870a79ce1a10 Branch: next-stable User: Dave Bouvier Date: 2013-10-25 20:45:29 Summary: Correctly handle extracting a tarball that does contain all files and directories within a single directory at the root of the archive, but does not contain an entry for the directory itself. Affected #: 1 file diff -r 0255f2f29a2ba9fd047c89be919453ea90ab731f -r 870a79ce1a1048ec941b4ea298b3422ade4fc9e6 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 @@ -43,31 +43,15 @@ os.makedirs( extraction_path ) self.archive.extractall( extraction_path ) else: - # Sort filenames within the archive by length, because if the shortest path entry in the archive is a directory, - # and the next entry has the directory prepended, then everything following that entry must be within that directory. - # For example, consider tarball for BWA 0.5.9: - # bwa-0.5.9.tar.bz2: - # bwa-0.5.9/ - # bwa-0.5.9/bwt.c - # bwa-0.5.9/bwt.h - # bwa-0.5.9/Makefile - # bwa-0.5.9/bwt_gen/ - # bwa-0.5.9/bwt_gen/Makefile - # bwa-0.5.9/bwt_gen/bwt_gen.c - # bwa-0.5.9/bwt_gen/bwt_gen.h - # When sorted by length, one sees a directory at the root of the tarball, and all other tarball contents as - # children of that directory. - filenames = sorted( [ self.getname( item ) for item in contents ], cmp=lambda a,b: cmp( len( a ), len( b ) ) ) - parent_name = filenames[ 0 ] - parent = self.getmember( parent_name ) - first_child = filenames[ 1 ] - if first_child.startswith( parent_name ) and parent is not None and self.isdir( parent ): - if self.getname( parent ) == self.file_name: - self.archive.extractall( os.path.join( path ) ) - extraction_path = os.path.join( path, self.file_name ) - else: - self.archive.extractall( os.path.join( path ) ) - extraction_path = os.path.join( path, self.getname( parent ) ) + # Get the common prefix for all the files in the archive. If the common prefix ends with a slash, + # or self.isdir() returns True, the archive contains a single directory with the desired contents. + # Otherwise, it contains multiple files and/or directories at the root of the archive. + common_prefix = os.path.commonprefix( [ self.getname( item ) for item in contents ] ) + if len( common_prefix ) >= 1 and not common_prefix.endswith( os.sep ) and self.isdir( self.getmember( common_prefix ) ): + common_prefix += os.sep + if common_prefix.endswith( os.sep ): + self.archive.extractall( os.path.join( path ) ) + extraction_path = os.path.join( path, common_prefix ) else: extraction_path = os.path.join( path, self.file_name ) if not os.path.exists( extraction_path ): https://bitbucket.org/galaxy/galaxy-central/commits/a27073465c2f/ Changeset: a27073465c2f User: Dave Bouvier Date: 2013-10-25 20:46:48 Summary: Merge fix from next-stable. Affected #: 1 file diff -r 0101573c8701fc94bc848c2a785c48d4f3e484c3 -r a27073465c2f4925012e1df12e19321aed2b9f4a 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 @@ -43,31 +43,15 @@ os.makedirs( extraction_path ) self.archive.extractall( extraction_path ) else: - # Sort filenames within the archive by length, because if the shortest path entry in the archive is a directory, - # and the next entry has the directory prepended, then everything following that entry must be within that directory. - # For example, consider tarball for BWA 0.5.9: - # bwa-0.5.9.tar.bz2: - # bwa-0.5.9/ - # bwa-0.5.9/bwt.c - # bwa-0.5.9/bwt.h - # bwa-0.5.9/Makefile - # bwa-0.5.9/bwt_gen/ - # bwa-0.5.9/bwt_gen/Makefile - # bwa-0.5.9/bwt_gen/bwt_gen.c - # bwa-0.5.9/bwt_gen/bwt_gen.h - # When sorted by length, one sees a directory at the root of the tarball, and all other tarball contents as - # children of that directory. - filenames = sorted( [ self.getname( item ) for item in contents ], cmp=lambda a,b: cmp( len( a ), len( b ) ) ) - parent_name = filenames[ 0 ] - parent = self.getmember( parent_name ) - first_child = filenames[ 1 ] - if first_child.startswith( parent_name ) and parent is not None and self.isdir( parent ): - if self.getname( parent ) == self.file_name: - self.archive.extractall( os.path.join( path ) ) - extraction_path = os.path.join( path, self.file_name ) - else: - self.archive.extractall( os.path.join( path ) ) - extraction_path = os.path.join( path, self.getname( parent ) ) + # Get the common prefix for all the files in the archive. If the common prefix ends with a slash, + # or self.isdir() returns True, the archive contains a single directory with the desired contents. + # Otherwise, it contains multiple files and/or directories at the root of the archive. + common_prefix = os.path.commonprefix( [ self.getname( item ) for item in contents ] ) + if len( common_prefix ) >= 1 and not common_prefix.endswith( os.sep ) and self.isdir( self.getmember( common_prefix ) ): + common_prefix += os.sep + if common_prefix.endswith( os.sep ): + self.archive.extractall( os.path.join( path ) ) + extraction_path = os.path.join( path, common_prefix ) else: extraction_path = os.path.join( path, self.file_name ) if not os.path.exists( extraction_path ): 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.