2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/f8cf776ff12f/
Changeset: f8cf776ff12f
Branch: stable
User: greg
Date: 2013-06-12 15:09:33
Summary: Make sure custom datatypes contained in newly installed tool shed repositories are loaded into the upload form's File Format select list. Also, when an installed repository is uninstalled, remove the appropriate datatype extensions from the upload form's select list.
Affected #: 3 files
diff -r 7105c53139d4b8649e6a3714bc117118989712a2 -r f8cf776ff12f480ff0be89bc7b92c0e9c7658b0e lib/galaxy/datatypes/registry.py
--- a/lib/galaxy/datatypes/registry.py
+++ b/lib/galaxy/datatypes/registry.py
@@ -121,6 +121,8 @@
# TODO: Handle deactivating datatype converters, etc before removing from self.datatypes_by_extension.
self.log.debug( "Removing datatype with extension '%s' from the registry." % extension )
del self.datatypes_by_extension[ extension ]
+ if extension in self.upload_file_formats:
+ self.upload_file_formats.remove( extension )
can_process_datatype = False
else:
can_process_datatype = ( extension and ( dtype or type_extension ) ) and ( extension not in self.datatypes_by_extension or override )
@@ -165,7 +167,7 @@
self.mimetypes_by_extension[ extension ] = mimetype
if datatype_class.track_type:
self.available_tracks.append( extension )
- if display_in_upload:
+ if display_in_upload and extension not in self.upload_file_formats:
self.upload_file_formats.append( extension )
# Max file size cut off for setting optional metadata
self.datatypes_by_extension[ extension ].max_optional_metadata_filesize = elem.get( 'max_optional_metadata_filesize', None )
diff -r 7105c53139d4b8649e6a3714bc117118989712a2 -r f8cf776ff12f480ff0be89bc7b92c0e9c7658b0e lib/tool_shed/util/datatype_util.py
--- a/lib/tool_shed/util/datatype_util.py
+++ b/lib/tool_shed/util/datatype_util.py
@@ -2,6 +2,8 @@
import os
import tempfile
from galaxy import eggs
+from galaxy.util import asbool
+from tool_shed.util import tool_util
from tool_shed.util import xml_util
import tool_shed.util.shed_util_common as suc
@@ -81,6 +83,12 @@
os.chmod( proprietary_datatypes_config, 0644 )
# Load proprietary datatypes
app.datatypes_registry.load_datatypes( root_dir=app.config.root, config=proprietary_datatypes_config, deactivate=deactivate, override=override )
+ if deactivate:
+ # Reload the upload tool to eliminate deactivated datatype extensions from the file_type select list.
+ tool_util.reload_upload_tools( app )
+ else:
+ append_to_datatypes_registry_upload_file_formats( app, registration )
+ tool_util.reload_upload_tools( app )
if datatype_files is not None:
try:
os.unlink( proprietary_datatypes_config )
@@ -88,6 +96,16 @@
pass
return converter_path, display_path
+def append_to_datatypes_registry_upload_file_formats( app, elem ):
+ # See if we have any datatypes that should be displayed in the upload tool's file_type select list.
+ for datatype_elem in elem.findall( 'datatype' ):
+ extension = datatype_elem.get( 'extension', None )
+ display_in_upload = datatype_elem.get( 'display_in_upload', None )
+ if extension is not None and display_in_upload is not None:
+ display_in_upload = asbool( str( display_in_upload ) )
+ if display_in_upload and extension not in app.datatypes_registry.upload_file_formats:
+ app.datatypes_registry.upload_file_formats.append( extension )
+
def create_repository_dict_for_proprietary_datatypes( tool_shed, name, owner, installed_changeset_revision, tool_dicts, converter_path=None, display_path=None ):
return dict( tool_shed=tool_shed,
repository_name=name,
diff -r 7105c53139d4b8649e6a3714bc117118989712a2 -r f8cf776ff12f480ff0be89bc7b92c0e9c7658b0e lib/tool_shed/util/tool_util.py
--- a/lib/tool_shed/util/tool_util.py
+++ b/lib/tool_shed/util/tool_util.py
@@ -13,6 +13,7 @@
from galaxy.tools.search import ToolBoxSearch
from galaxy.web.form_builder import SelectField
from tool_shed.util import xml_util
+from galaxy.tools.actions.upload import UploadToolAction
import tool_shed.util.shed_util_common as suc
from xml.etree import ElementTree as XmlET
@@ -849,6 +850,13 @@
return True
return False
+def reload_upload_tools( app ):
+ if hasattr( app, 'toolbox' ):
+ for tool_id in app.toolbox.tools_by_id:
+ tool = app.toolbox.tools_by_id[ tool_id ]
+ if isinstance( tool.tool_action, UploadToolAction ):
+ app.toolbox.reload_tool_by_id( tool_id )
+
def remove_from_shed_tool_config( trans, shed_tool_conf_dict, guids_to_remove ):
# A tool shed repository is being uninstalled so change the shed_tool_conf file. Parse the config file to generate the entire list
# of config_elems instead of using the in-memory list since it will be a subset of the entire list if one or more repositories have
https://bitbucket.org/galaxy/galaxy-central/commits/7228f6784623/
Changeset: 7228f6784623
User: greg
Date: 2013-06-12 15:10:25
Summary: Merged from stable
Affected #: 3 files
diff -r 10bd58cc47c538522c37defc80334e805c60d13c -r 7228f6784623ccf84fe125918aa9b88a4336e481 lib/galaxy/datatypes/registry.py
--- a/lib/galaxy/datatypes/registry.py
+++ b/lib/galaxy/datatypes/registry.py
@@ -121,6 +121,8 @@
# TODO: Handle deactivating datatype converters, etc before removing from self.datatypes_by_extension.
self.log.debug( "Removing datatype with extension '%s' from the registry." % extension )
del self.datatypes_by_extension[ extension ]
+ if extension in self.upload_file_formats:
+ self.upload_file_formats.remove( extension )
can_process_datatype = False
else:
can_process_datatype = ( extension and ( dtype or type_extension ) ) and ( extension not in self.datatypes_by_extension or override )
@@ -165,7 +167,7 @@
self.mimetypes_by_extension[ extension ] = mimetype
if datatype_class.track_type:
self.available_tracks.append( extension )
- if display_in_upload:
+ if display_in_upload and extension not in self.upload_file_formats:
self.upload_file_formats.append( extension )
# Max file size cut off for setting optional metadata
self.datatypes_by_extension[ extension ].max_optional_metadata_filesize = elem.get( 'max_optional_metadata_filesize', None )
diff -r 10bd58cc47c538522c37defc80334e805c60d13c -r 7228f6784623ccf84fe125918aa9b88a4336e481 lib/tool_shed/util/datatype_util.py
--- a/lib/tool_shed/util/datatype_util.py
+++ b/lib/tool_shed/util/datatype_util.py
@@ -2,6 +2,8 @@
import os
import tempfile
from galaxy import eggs
+from galaxy.util import asbool
+from tool_shed.util import tool_util
from tool_shed.util import xml_util
import tool_shed.util.shed_util_common as suc
@@ -81,6 +83,12 @@
os.chmod( proprietary_datatypes_config, 0644 )
# Load proprietary datatypes
app.datatypes_registry.load_datatypes( root_dir=app.config.root, config=proprietary_datatypes_config, deactivate=deactivate, override=override )
+ if deactivate:
+ # Reload the upload tool to eliminate deactivated datatype extensions from the file_type select list.
+ tool_util.reload_upload_tools( app )
+ else:
+ append_to_datatypes_registry_upload_file_formats( app, registration )
+ tool_util.reload_upload_tools( app )
if datatype_files is not None:
try:
os.unlink( proprietary_datatypes_config )
@@ -88,6 +96,16 @@
pass
return converter_path, display_path
+def append_to_datatypes_registry_upload_file_formats( app, elem ):
+ # See if we have any datatypes that should be displayed in the upload tool's file_type select list.
+ for datatype_elem in elem.findall( 'datatype' ):
+ extension = datatype_elem.get( 'extension', None )
+ display_in_upload = datatype_elem.get( 'display_in_upload', None )
+ if extension is not None and display_in_upload is not None:
+ display_in_upload = asbool( str( display_in_upload ) )
+ if display_in_upload and extension not in app.datatypes_registry.upload_file_formats:
+ app.datatypes_registry.upload_file_formats.append( extension )
+
def create_repository_dict_for_proprietary_datatypes( tool_shed, name, owner, installed_changeset_revision, tool_dicts, converter_path=None, display_path=None ):
return dict( tool_shed=tool_shed,
repository_name=name,
diff -r 10bd58cc47c538522c37defc80334e805c60d13c -r 7228f6784623ccf84fe125918aa9b88a4336e481 lib/tool_shed/util/tool_util.py
--- a/lib/tool_shed/util/tool_util.py
+++ b/lib/tool_shed/util/tool_util.py
@@ -13,6 +13,7 @@
from galaxy.tools.search import ToolBoxSearch
from galaxy.web.form_builder import SelectField
from tool_shed.util import xml_util
+from galaxy.tools.actions.upload import UploadToolAction
import tool_shed.util.shed_util_common as suc
from xml.etree import ElementTree as XmlET
@@ -902,6 +903,13 @@
return True
return False
+def reload_upload_tools( app ):
+ if hasattr( app, 'toolbox' ):
+ for tool_id in app.toolbox.tools_by_id:
+ tool = app.toolbox.tools_by_id[ tool_id ]
+ if isinstance( tool.tool_action, UploadToolAction ):
+ app.toolbox.reload_tool_by_id( tool_id )
+
def remove_from_shed_tool_config( trans, shed_tool_conf_dict, guids_to_remove ):
# A tool shed repository is being uninstalled so change the shed_tool_conf file. Parse the config file to generate the entire list
# of config_elems instead of using the in-memory list since it will be a subset of the entire list if one or more repositories have
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/172bab449347/
Changeset: 172bab449347
User: jgoecks
Date: 2013-06-11 17:56:35
Summary: Update supported versions in Cuffdiff wrapper.
Affected #: 1 file
diff -r e92fb12cd68749e4e621cbc6f564bf5e5bdec5f4 -r 172bab449347f3fb5a62e9f2e294880b2f3dd121 tools/ngs_rna/cuffdiff_wrapper.xml
--- a/tools/ngs_rna/cuffdiff_wrapper.xml
+++ b/tools/ngs_rna/cuffdiff_wrapper.xml
@@ -1,5 +1,5 @@
<tool id="cuffdiff" name="Cuffdiff" version="0.0.5">
- <!-- Wrapper supports Cuffdiff versions v1.3.0-v2.0 -->
+ <!-- Wrapper supports Cuffdiff versions 2.1.0-2.1.1 --><description>find significant changes in transcript expression, splicing, and promoter use</description><requirements><requirement type="package">cufflinks</requirement>
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.
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/133ea143710c/
Changeset: 133ea143710c
User: Dave Bouvier
Date: 2013-06-11 15:37:55
Summary: Fix server error when renaming a tool shed category.
Affected #: 1 file
diff -r cda9da16d4f15bf445667ab7ebe5ae979ee6dcc8 -r 133ea143710cc70cb0eda301a5144cb5c8348f24 lib/galaxy/webapps/tool_shed/controllers/admin.py
--- a/lib/galaxy/webapps/tool_shed/controllers/admin.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/admin.py
@@ -227,7 +227,7 @@
if not new_name:
message = 'Enter a valid name'
status = 'error'
- elif category.name != new_name and suc.get_category_by_name( trans, name ):
+ elif category.name != new_name and suc.get_category_by_name( trans, new_name ):
message = 'A category with that name already exists'
status = 'error'
else:
https://bitbucket.org/galaxy/galaxy-central/commits/b0153907bf97/
Changeset: b0153907bf97
Branch: stable
User: Dave Bouvier
Date: 2013-06-11 15:37:55
Summary: Fix server error when renaming a tool shed category.
Affected #: 1 file
diff -r f7413b1cfde3bc0164b3db53d34e3ca809161757 -r b0153907bf9754ded841539e40aca7859dd82051 lib/galaxy/webapps/tool_shed/controllers/admin.py
--- a/lib/galaxy/webapps/tool_shed/controllers/admin.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/admin.py
@@ -231,7 +231,7 @@
if not new_name:
message = 'Enter a valid name'
status = 'error'
- elif category.name != new_name and suc.get_category_by_name( trans, name ):
+ elif category.name != new_name and suc.get_category_by_name( trans, new_name ):
message = 'A category with that name already exists'
status = 'error'
else:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/cda9da16d4f1/
Changeset: cda9da16d4f1
User: greg
Date: 2013-06-11 15:16:07
Summary: Fix deprecated test for element tree element in the tool shed.
Affected #: 1 file
diff -r 8d96629131b057b42963e9d7ef8631c12e0e8122 -r cda9da16d4f15bf445667ab7ebe5ae979ee6dcc8 lib/tool_shed/util/xml_util.py
--- a/lib/tool_shed/util/xml_util.py
+++ b/lib/tool_shed/util/xml_util.py
@@ -87,7 +87,7 @@
return tree, error_message
def xml_to_string( elem, encoding='utf-8', use_indent=False ):
- if elem:
+ if len( elem ):
if use_indent:
# We were called from suc.config_elems_to_xml_file(), so set the level to 1 since level 0 is the <toolbox> tag set.
indent( elem, level=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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8d96629131b0/
Changeset: 8d96629131b0
User: carlfeberhard
Date: 2013-06-10 17:41:36
Summary: base.controller: propagate flags thru Base{UI/API}Controller to BaseController
Affected #: 1 file
diff -r 88873eed009229288e76637246a76746ea63ef57 -r 8d96629131b057b42963e9d7ef8631c12e0e8122 lib/galaxy/web/base/controller.py
--- a/lib/galaxy/web/base/controller.py
+++ b/lib/galaxy/web/base/controller.py
@@ -123,13 +123,20 @@
log.exception( "Invalid %s id ( %s ) specified" % ( class_name, id ) )
raise MessageException( "Invalid %s id ( %s ) specified" % ( class_name, id ), type="error" )
if check_ownership or check_accessible:
- self.security_check( trans, item, check_ownership, check_accessible, id )
+ self.security_check( trans, item, check_ownership, check_accessible )
if deleted == True and not item.deleted:
raise ItemDeletionException( '%s "%s" is not deleted' % ( class_name, getattr( item, 'name', id ) ), type="warning" )
elif deleted == False and item.deleted:
raise ItemDeletionException( '%s "%s" is deleted' % ( class_name, getattr( item, 'name', id ) ), type="warning" )
return item
+ # this should be here - but catching errors from sharable item controllers that *should* have SharableItemMixin
+ # but *don't* then becomes difficult
+ #def security_check( self, trans, item, check_ownership=False, check_accessible=False ):
+ # log.warn( 'BaseController.security_check: %s, %b, %b', str( item ), check_ownership, check_accessible )
+ # # meant to be overridden in SharableSecurityMixin
+ # return item
+
def get_user( self, trans, id, check_ownership=False, check_accessible=False, deleted=None ):
return self.get_object( trans, id, 'User', check_ownership=False, check_accessible=False, deleted=deleted )
@@ -162,7 +169,9 @@
def get_object( self, trans, id, class_name, check_ownership=False, check_accessible=False, deleted=None ):
try:
- return BaseController.get_object( self, trans, id, class_name, check_ownership=False, check_accessible=False, deleted=None )
+ return BaseController.get_object( self, trans, id, class_name,
+ check_ownership=check_ownership, check_accessible=check_accessible, deleted=deleted )
+
except MessageException:
raise # handled in the caller
except:
@@ -174,7 +183,9 @@
def get_object( self, trans, id, class_name, check_ownership=False, check_accessible=False, deleted=None ):
try:
- return BaseController.get_object( self, trans, id, class_name, check_ownership=False, check_accessible=False, deleted=None )
+ return BaseController.get_object( self, trans, id, class_name,
+ check_ownership=check_ownership, check_accessible=check_accessible, deleted=deleted )
+
except ItemDeletionException, e:
raise HTTPBadRequest( detail="Invalid %s id ( %s ) specified" % ( class_name, str( id ) ) )
except MessageException, e:
@@ -232,24 +243,30 @@
# -- Mixins for working with Galaxy objects. --
#
-
class SharableItemSecurityMixin:
""" Mixin for handling security for sharable items. """
def security_check( self, trans, item, check_ownership=False, check_accessible=False ):
""" Security checks for an item: checks if (a) user owns item or (b) item is accessible to user. """
+ # all items are accessible to an admin
+ if trans.user and trans.user_is_admin():
+ return item
+
+ # Verify ownership: there is a current user and that user is the same as the item's
if check_ownership:
- # Verify ownership.
if not trans.user:
raise ItemOwnershipException( "Must be logged in to manage Galaxy items", type='error' )
if item.user != trans.user:
raise ItemOwnershipException( "%s is not owned by the current user" % item.__class__.__name__, type='error' )
+
+ # Verify accessible:
+ # if it's part of a lib - can they access via security
+ # if it's something else (sharable) have they been added to the item's users_shared_with_dot_users
if check_accessible:
if type( item ) in ( trans.app.model.LibraryFolder, trans.app.model.LibraryDatasetDatasetAssociation, trans.app.model.LibraryDataset ):
- if not ( trans.user_is_admin() or trans.app.security_agent.can_access_library_item( trans.get_current_user_roles(), item, trans.user ) ):
+ if not trans.app.security_agent.can_access_library_item( trans.get_current_user_roles(), item, trans.user ):
raise ItemAccessibilityException( "%s is not accessible to the current user" % item.__class__.__name__, type='error' )
else:
- # Verify accessible.
if ( item.user != trans.user ) and ( not item.importable ) and ( trans.user not in item.users_shared_with_dot_users ):
raise ItemAccessibilityException( "%s is not accessible to the current user" % item.__class__.__name__, type='error' )
return item
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.