1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/56dd83576ce6/
Changeset: 56dd83576ce6
User: jmchilton
Date: 2014-04-27 03:27:07
Summary: Refactor managers into their own module.
Allows cleaner reuse outside of controllers. Small PEP8 fixes.
Affected #: 5 files
diff -r 9dbd0de27e53a2cac3c604c0aa6fb70ffb5ac7d1 -r 56dd83576ce67763863b61ad85104f8d14d978e0 lib/galaxy/managers/__init__.py
--- /dev/null
+++ b/lib/galaxy/managers/__init__.py
@@ -0,0 +1,4 @@
+""" 'Business logic' independent of web transactions/user context (trans)
+should be pushed into models - but logic that requires the context trans
+should be placed under this module.
+"""
diff -r 9dbd0de27e53a2cac3c604c0aa6fb70ffb5ac7d1 -r 56dd83576ce67763863b61ad85104f8d14d978e0 lib/galaxy/managers/hdas.py
--- /dev/null
+++ b/lib/galaxy/managers/hdas.py
@@ -0,0 +1,67 @@
+from galaxy import exceptions
+from ..managers import histories
+
+
+class HDAManager( object ):
+
+ def __init__( self ):
+ self.histories_mgr = histories.HistoryManager()
+
+ def get( self, trans, unencoded_id, check_ownership=True, check_accessible=True ):
+ """
+ """
+ # this is a replacement for UsesHistoryDatasetAssociationMixin because mixins are a bad soln/structure
+ hda = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( unencoded_id )
+ if hda is None:
+ raise exceptions.ObjectNotFound()
+ hda = self.secure( trans, hda, check_ownership, check_accessible )
+ return hda
+
+ def secure( self, trans, hda, check_ownership=True, check_accessible=True ):
+ """
+ checks if (a) user owns item or (b) item is accessible to user.
+ """
+ # all items are accessible to an admin
+ if trans.user and trans.user_is_admin():
+ return hda
+ if check_ownership:
+ hda = self.check_ownership( trans, hda )
+ if check_accessible:
+ hda = self.check_accessible( trans, hda )
+ return hda
+
+ def can_access_dataset( self, trans, hda ):
+ current_user_roles = trans.get_current_user_roles()
+ return trans.app.security_agent.can_access_dataset( current_user_roles, hda.dataset )
+
+ #TODO: is_owner, is_accessible
+
+ def check_ownership( self, trans, hda ):
+ if not trans.user:
+ #if hda.history == trans.history:
+ # return hda
+ raise exceptions.AuthenticationRequired( "Must be logged in to manage Galaxy datasets", type='error' )
+ if trans.user_is_admin():
+ return hda
+ # check for ownership of the containing history and accessibility of the underlying dataset
+ if( self.histories_mgr.is_owner( trans, hda.history )
+ and self.can_access_dataset( trans, hda ) ):
+ return hda
+ raise exceptions.ItemOwnershipException(
+ "HistoryDatasetAssociation is not owned by the current user", type='error' )
+
+ def check_accessible( self, trans, hda ):
+ if trans.user and trans.user_is_admin():
+ return hda
+ # check for access of the containing history...
+ self.histories_mgr.check_accessible( trans, hda.history )
+ # ...then the underlying dataset
+ if self.can_access_dataset( trans, hda ):
+ return hda
+ raise exceptions.ItemAccessibilityException(
+ "HistoryDatasetAssociation is not accessible to the current user", type='error' )
+
+ def err_if_uploading( self, trans, hda ):
+ if hda.state == trans.model.Dataset.states.UPLOAD:
+ raise exceptions.Conflict( "Please wait until this dataset finishes uploading" )
+ return hda
diff -r 9dbd0de27e53a2cac3c604c0aa6fb70ffb5ac7d1 -r 56dd83576ce67763863b61ad85104f8d14d978e0 lib/galaxy/managers/histories.py
--- /dev/null
+++ b/lib/galaxy/managers/histories.py
@@ -0,0 +1,93 @@
+from galaxy import exceptions
+from galaxy.model import orm
+
+
+class HistoryManager( object ):
+ #TODO: all the following would be more useful if passed the user instead of defaulting to trans.user
+
+ def get( self, trans, unencoded_id, check_ownership=True, check_accessible=True, deleted=None ):
+ """
+ Get a History from the database by id, verifying ownership.
+ """
+ # this is a replacement for UsesHistoryMixin because mixins are a bad soln/structure
+ history = trans.sa_session.query( trans.app.model.History ).get( unencoded_id )
+ if history is None:
+ raise exceptions.ObjectNotFound()
+ if deleted is True and not history.deleted:
+ raise exceptions.ItemDeletionException( 'History "%s" is not deleted' % ( history.name ), type="error" )
+ elif deleted is False and history.deleted:
+ raise exceptions.ItemDeletionException( 'History "%s" is deleted' % ( history.name ), type="error" )
+
+ history = self.secure( trans, history, check_ownership, check_accessible )
+ return history
+
+ def by_user( self, trans, user=None, include_deleted=False, only_deleted=False ):
+ """
+ Get all the histories for a given user (defaulting to `trans.user`)
+ ordered by update time and filtered on whether they've been deleted.
+ """
+ # handle default and/or anonymous user (which still may not have a history yet)
+ user = user or trans.user
+ if not user:
+ current_history = trans.get_history()
+ return [ current_history ] if current_history else []
+
+ history_model = trans.model.History
+ query = ( trans.sa_session.query( history_model )
+ .filter( history_model.user == user )
+ .order_by( orm.desc( history_model.table.c.update_time ) ) )
+ if only_deleted:
+ query = query.filter( history_model.deleted == True )
+ elif not include_deleted:
+ query = query.filter( history_model.deleted == False )
+ return query.all()
+
+ def secure( self, trans, history, check_ownership=True, check_accessible=True ):
+ """
+ checks if (a) user owns item or (b) item is accessible to user.
+ """
+ # all items are accessible to an admin
+ if trans.user and trans.user_is_admin():
+ return history
+ if check_ownership:
+ history = self.check_ownership( trans, history )
+ if check_accessible:
+ history = self.check_accessible( trans, history )
+ return history
+
+ def is_current( self, trans, history ):
+ return trans.history == history
+
+ def is_owner( self, trans, history ):
+ # anon users are only allowed to view their current history
+ if not trans.user:
+ return self.is_current( trans, history )
+ return trans.user == history.user
+
+ def check_ownership( self, trans, history ):
+ if trans.user and trans.user_is_admin():
+ return history
+ if not trans.user and not self.is_current( trans, history ):
+ raise exceptions.AuthenticationRequired( "Must be logged in to manage Galaxy histories", type='error' )
+ if self.is_owner( trans, history ):
+ return history
+ raise exceptions.ItemOwnershipException( "History is not owned by the current user", type='error' )
+
+ def is_accessible( self, trans, history ):
+ # admin always have access
+ if trans.user and trans.user_is_admin():
+ return True
+ # owner has implicit access
+ if self.is_owner( trans, history ):
+ return True
+ # importable and shared histories are always accessible
+ if history.importable:
+ return True
+ if trans.user in history.users_shared_with_dot_users:
+ return True
+ return False
+
+ def check_accessible( self, trans, history ):
+ if self.is_accessible( trans, history ):
+ return history
+ raise exceptions.ItemAccessibilityException( "History is not accessible to the current user", type='error' )
diff -r 9dbd0de27e53a2cac3c604c0aa6fb70ffb5ac7d1 -r 56dd83576ce67763863b61ad85104f8d14d978e0 lib/galaxy/webapps/galaxy/api/histories.py
--- a/lib/galaxy/webapps/galaxy/api/histories.py
+++ b/lib/galaxy/webapps/galaxy/api/histories.py
@@ -18,7 +18,7 @@
from galaxy.web.base.controller import ExportsHistoryMixin
from galaxy.web.base.controller import ImportsHistoryMixin
-from galaxy.model import orm
+from galaxy.managers import histories
from galaxy import util
from galaxy.util import string_as_bool
@@ -35,7 +35,7 @@
def __init__( self, app ):
super( HistoriesController, self ).__init__( app )
self.mgrs = util.bunch.Bunch(
- histories = HistoryManager()
+ histories=histories.HistoryManager()
)
def _decode_id( self, trans, id ):
@@ -404,96 +404,3 @@
pass
#log.warn( 'unknown key: %s', str( key ) )
return validated_payload
-
-
-
-
-class HistoryManager( object ):
- #TODO: all the following would be more useful if passed the user instead of defaulting to trans.user
-
- def get( self, trans, unencoded_id, check_ownership=True, check_accessible=True, deleted=None ):
- """
- Get a History from the database by id, verifying ownership.
- """
- # this is a replacement for UsesHistoryMixin because mixins are a bad soln/structure
- history = trans.sa_session.query( trans.app.model.History ).get( unencoded_id )
- if history is None:
- raise exceptions.ObjectNotFound()
- if deleted == True and not history.deleted:
- raise exceptions.ItemDeletionException( 'History "%s" is not deleted' % ( history.name ), type="error" )
- elif deleted == False and history.deleted:
- raise exceptions.ItemDeletionException( 'History "%s" is deleted' % ( history.name ), type="error" )
-
- history = self.secure( trans, history, check_ownership, check_accessible )
- return history
-
- def by_user( self, trans, user=None, include_deleted=False, only_deleted=False ):
- """
- Get all the histories for a given user (defaulting to `trans.user`)
- ordered by update time and filtered on whether they've been deleted.
- """
- # handle default and/or anonymous user (which still may not have a history yet)
- user = user or trans.user
- if not user:
- current_history = trans.get_history()
- return [ current_history ] if current_history else []
-
- history_model = trans.model.History
- query = ( trans.sa_session.query( history_model )
- .filter( history_model.user == user )
- .order_by( orm.desc( history_model.table.c.update_time ) ) )
- if only_deleted:
- query = query.filter( history_model.deleted == True )
- elif not include_deleted:
- query = query.filter( history_model.deleted == False )
- return query.all()
-
- def secure( self, trans, history, check_ownership=True, check_accessible=True ):
- """
- checks if (a) user owns item or (b) item is accessible to user.
- """
- # all items are accessible to an admin
- if trans.user and trans.user_is_admin():
- return history
- if check_ownership:
- history = self.check_ownership( trans, history )
- if check_accessible:
- history = self.check_accessible( trans, history )
- return history
-
- def is_current( self, trans, history ):
- return trans.history == history
-
- def is_owner( self, trans, history ):
- # anon users are only allowed to view their current history
- if not trans.user:
- return self.is_current( trans, history )
- return trans.user == history.user
-
- def check_ownership( self, trans, history ):
- if trans.user and trans.user_is_admin():
- return history
- if not trans.user and not self.is_current( trans, history ):
- raise exceptions.AuthenticationRequired( "Must be logged in to manage Galaxy histories", type='error' )
- if self.is_owner( trans, history ):
- return history
- raise exceptions.ItemOwnershipException( "History is not owned by the current user", type='error' )
-
- def is_accessible( self, trans, history ):
- # admin always have access
- if trans.user and trans.user_is_admin():
- return True
- # owner has implicit access
- if self.is_owner( trans, history ):
- return True
- # importable and shared histories are always accessible
- if history.importable:
- return True
- if trans.user in history.users_shared_with_dot_users:
- return True
- return False
-
- def check_accessible( self, trans, history ):
- if self.is_accessible( trans, history ):
- return history
- raise exceptions.ItemAccessibilityException( "History is not accessible to the current user", type='error' )
diff -r 9dbd0de27e53a2cac3c604c0aa6fb70ffb5ac7d1 -r 56dd83576ce67763863b61ad85104f8d14d978e0 lib/galaxy/webapps/galaxy/api/history_contents.py
--- a/lib/galaxy/webapps/galaxy/api/history_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/history_contents.py
@@ -7,7 +7,6 @@
from galaxy.web import _future_expose_api as expose_api
from galaxy.web import _future_expose_api_anonymous as expose_api_anonymous
-from galaxy.web import _future_expose_api_raw as expose_api_raw
from galaxy.web.base.controller import BaseAPIController
from galaxy.web.base.controller import UsesHistoryDatasetAssociationMixin
@@ -18,7 +17,8 @@
from galaxy.web.base.controller import url_for
-from galaxy.webapps.galaxy.api import histories
+from galaxy.managers import histories
+from galaxy.managers import hdas
import logging
log = logging.getLogger( __name__ )
@@ -30,8 +30,8 @@
def __init__( self, app ):
super( HistoryContentsController, self ).__init__( app )
self.mgrs = util.bunch.Bunch(
- histories = histories.HistoryManager(),
- hdas = HDAManager()
+ histories=histories.HistoryManager(),
+ hdas=hdas.HDAManager()
)
def _decode_id( self, trans, id ):
@@ -434,67 +434,3 @@
def __handle_unknown_contents_type( self, trans, contents_type ):
raise exceptions.UnknownContentsType('Unknown contents type: %s' % type)
-
-class HDAManager( object ):
-
- def __init__( self ):
- self.histories_mgr = histories.HistoryManager()
-
- def get( self, trans, unencoded_id, check_ownership=True, check_accessible=True ):
- """
- """
- # this is a replacement for UsesHistoryDatasetAssociationMixin because mixins are a bad soln/structure
- hda = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( unencoded_id )
- if hda is None:
- raise exceptions.ObjectNotFound()
- hda = self.secure( trans, hda, check_ownership, check_accessible )
- return hda
-
- def secure( self, trans, hda, check_ownership=True, check_accessible=True ):
- """
- checks if (a) user owns item or (b) item is accessible to user.
- """
- # all items are accessible to an admin
- if trans.user and trans.user_is_admin():
- return hda
- if check_ownership:
- hda = self.check_ownership( trans, hda )
- if check_accessible:
- hda = self.check_accessible( trans, hda )
- return hda
-
- def can_access_dataset( self, trans, hda ):
- current_user_roles = trans.get_current_user_roles()
- return trans.app.security_agent.can_access_dataset( current_user_roles, hda.dataset )
-
- #TODO: is_owner, is_accessible
-
- def check_ownership( self, trans, hda ):
- if not trans.user:
- #if hda.history == trans.history:
- # return hda
- raise exceptions.AuthenticationRequired( "Must be logged in to manage Galaxy datasets", type='error' )
- if trans.user_is_admin():
- return hda
- # check for ownership of the containing history and accessibility of the underlying dataset
- if( self.histories_mgr.is_owner( trans, hda.history )
- and self.can_access_dataset( trans, hda ) ):
- return hda
- raise exceptions.ItemOwnershipException(
- "HistoryDatasetAssociation is not owned by the current user", type='error' )
-
- def check_accessible( self, trans, hda ):
- if trans.user and trans.user_is_admin():
- return hda
- # check for access of the containing history...
- self.histories_mgr.check_accessible( trans, hda.history )
- # ...then the underlying dataset
- if self.can_access_dataset( trans, hda ):
- return hda
- raise exceptions.ItemAccessibilityException(
- "HistoryDatasetAssociation is not accessible to the current user", type='error' )
-
- def err_if_uploading( self, trans, hda ):
- if hda.state == trans.model.Dataset.states.UPLOAD:
- raise exceptions.Conflict( "Please wait until this dataset finishes uploading" )
- return hda
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/03efdcca1969/
Changeset: 03efdcca1969
User: martenson
Date: 2014-04-25 23:44:50
Summary: data libraries API: improved deleted folder items handling, pydocs
Affected #: 1 file
diff -r de882c9035116eccd7563c9f89aec586a017ce2f -r 03efdcca196906f3aac9939517096da445ff0bf3 lib/galaxy/webapps/galaxy/api/folder_contents.py
--- a/lib/galaxy/webapps/galaxy/api/folder_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/folder_contents.py
@@ -2,6 +2,7 @@
API operations on the contents of a library folder.
"""
from galaxy import web
+from galaxy import util
from galaxy import exceptions
from galaxy.web import _future_expose_api as expose_api
from galaxy.web import _future_expose_api_anonymous as expose_api_anonymous
@@ -21,10 +22,32 @@
def index( self, trans, folder_id, **kwd ):
"""
GET /api/folders/{encoded_folder_id}/contents
- Displays a collection (list) of a folder's contents (files and folders).
- Encoded folder ID is prepended with 'F' if it is a folder as opposed to a data set which does not have it.
- Full path is provided in response as a separate object providing data for breadcrumb path building.
+
+ Displays a collection (list) of a folder's contents
+ (files and folders). Encoded folder ID is prepended
+ with 'F' if it is a folder as opposed to a data set
+ which does not have it. Full path is provided in
+ response as a separate object providing data for
+ breadcrumb path building.
+
+ :param folder_id: encoded ID of the folder which
+ contents should be library_dataset_dict
+ :type folder_id: encoded string
+
+ :param kwd: keyword dictionary with other params
+ :type kwd: dict
+
+ :returns: dictionary containing all items and metadata
+ :type: dict
+
+ :raises: MalformedId, InconsistentDatabase, ObjectNotFound,
+ InternalServerError
"""
+ deleted = kwd.get( 'deleted', 'missing' )
+ try:
+ deleted = util.asbool( deleted )
+ except ValueError:
+ deleted = False
if ( len( folder_id ) == 17 and folder_id.startswith( 'F' ) ):
try:
@@ -69,7 +92,14 @@
def build_path( folder ):
"""
- Search the path upwards recursively and load the whole route of names and ids for breadcrumb building purposes.
+ Search the path upwards recursively and load the whole route of
+ names and ids for breadcrumb building purposes.
+
+ :param folder: current folder for navigating up
+ :param type: Galaxy LibraryFolder
+
+ :returns: list consisting of full path to the library
+ :type: list
"""
path_to_root = []
# We are almost in root
@@ -89,7 +119,7 @@
update_time = ''
create_time = ''
# Go through every accessible item in the folder and include its meta-data.
- for content_item in self._load_folder_contents( trans, folder ):
+ for content_item in self._load_folder_contents( trans, folder, deleted ):
can_access = trans.app.security_agent.can_access_library_item( current_user_roles, content_item, trans.user )
if ( can_access or ( content_item.api_type == 'folder' and trans.app.security_agent.folder_is_unrestricted( content_item ) ) ):
return_item = {}
@@ -119,31 +149,74 @@
type = content_item.api_type,
name = content_item.name,
update_time = update_time,
- create_time = create_time
+ create_time = create_time,
+ deleted = content_item.deleted
) )
folder_contents.append( return_item )
return { 'metadata' : { 'full_path' : full_path, 'can_add_library_item': can_add_library_item, 'folder_name': folder.name }, 'folder_contents' : folder_contents }
- def _load_folder_contents( self, trans, folder ):
+ def _load_folder_contents( self, trans, folder, include_deleted ):
"""
- Loads all contents of the folder (folders and data sets) but only in the first level.
+ Loads all contents of the folder (folders and data sets) but only
+ in the first level. Include deleted if the flag is set and if the
+ user has access to undelete it.
+
+ :param folder: the folder which contents are being loaded
+ :type folder: Galaxy LibraryFolder
+
+ :param include_deleted: flag, when true the items that are deleted
+ and can be undeleted by current user are shown
+ :type include_deleted: boolean
+
+ :returns: a list containing the requested items
+ :type: list
"""
current_user_roles = trans.get_current_user_roles()
is_admin = trans.user_is_admin()
content_items = []
for subfolder in folder.active_folders:
- if not is_admin:
- can_access, folder_ids = trans.app.security_agent.check_folder_contents( trans.user, current_user_roles, subfolder )
- if (is_admin or can_access) and not subfolder.deleted:
- subfolder.api_type = 'folder'
- content_items.append( subfolder )
+ if subfolder.deleted:
+ if include_deleted:
+ if is_admin:
+ subfolder.api_type = 'folder'
+ content_items.append( subfolder )
+ else:
+ can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles, subfolder )
+ if can_modify:
+ subfolder.api_type = 'folder'
+ content_items.append( subfolder )
+ else:
+ if is_admin:
+ subfolder.api_type = 'folder'
+ content_items.append( subfolder )
+ else:
+ can_access, folder_ids = trans.app.security_agent.check_folder_contents( trans.user, current_user_roles, subfolder )
+ if can_access:
+ subfolder.api_type = 'folder'
+ content_items.append( subfolder )
+
for dataset in folder.datasets:
- if not is_admin:
- can_access = trans.app.security_agent.can_access_dataset( current_user_roles, dataset.library_dataset_dataset_association.dataset )
- if (is_admin or can_access) and not dataset.deleted:
- dataset.api_type = 'file'
- content_items.append( dataset )
+ if dataset.deleted:
+ if include_deleted:
+ if is_admin:
+ dataset.api_type = 'file'
+ content_items.append( dataset )
+ else:
+ can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles, dataset )
+ if can_modify:
+ dataset.api_type = 'file'
+ content_items.append( dataset )
+ else:
+ if is_admin:
+ dataset.api_type = 'file'
+ content_items.append( dataset )
+ else:
+ can_access, folder_ids = trans.app.security_agent.can_access_dataset( current_user_roles, dataset.library_dataset_dataset_association.dataset )
+ if can_access:
+ dataset.api_type = 'file'
+ content_items.append( dataset )
+
return content_items
@expose_api
@@ -157,15 +230,22 @@
:type payload: dict
* folder_id: the parent folder of the new item
- * from_hda_id: (optional) the id of an accessible HDA to copy into the library
- * ldda_message: (optional) the new message attribute of the LDDA created
- * extended_metadata: (optional) dub-dictionary containing any extended
- metadata to associate with the item
+ * from_hda_id: (optional) the id of an accessible HDA to copy
+ into the library
+ * ldda_message: (optional) the new message attribute of the LDDA
+ created
+ * extended_metadata: (optional) dub-dictionary containing any
+ extended metadata to associate with the item
- :returns: a dictionary containing the id, name, and 'show' url of the new item
+ :returns: a dictionary containing the id, name,
+ and 'show' url of the new item
:rtype: dict
+
+ :raises: ObjectAttributeInvalidException,
+ InsufficientPermissionsException, ItemAccessibilityException,
+ InternalServerError
"""
- class_name, encoded_folder_id_16 = self.__decode_library_content_id( trans, encoded_folder_id )
+ encoded_folder_id_16 = self.__decode_library_content_id( trans, encoded_folder_id )
from_hda_id, ldda_message = ( payload.pop( 'from_hda_id', None ), payload.pop( 'ldda_message', '' ) )
if ldda_message:
ldda_message = util.sanitize_html.sanitize_html( ldda_message, 'utf-8' )
@@ -200,8 +280,21 @@
return rval
def __decode_library_content_id( self, trans, encoded_folder_id ):
+ """
+ Identifies whether the id provided is properly encoded
+ LibraryFolder.
+
+ :param encoded_folder_id: encoded id of Galaxy LibraryFolder
+ :type encoded_folder_id: encoded string
+
+ :returns: last 16 chars of the encoded id in case it was Folder
+ (had 'F' prepended)
+ :type: string
+
+ :raises: MalformedId
+ """
if ( len( encoded_folder_id ) == 17 and encoded_folder_id.startswith( 'F' )):
- return 'LibraryFolder', encoded_folder_id[1:]
+ return encoded_folder_id[1:]
else:
raise exceptions.MalformedId( 'Malformed folder id ( %s ) specified, unable to decode.' % str( encoded_folder_id ) )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/de882c903511/
Changeset: de882c903511
User: Jeremy Goecks
Date: 2014-04-25 22:58:21
Summary: Do not propagate keyboard events in JS editable text plugin; this prevents unwanted side effects with other elmements on the page using keyboard events.
Affected #: 1 file
diff -r 986d7190844d5f7b68804242699a8049af80a937 -r de882c9035116eccd7563c9f89aec586a017ce2f static/scripts/galaxy.base.js
--- a/static/scripts/galaxy.base.js
+++ b/static/scripts/galaxy.base.js
@@ -356,6 +356,9 @@
// Enter key.
set_text($(this).val());
}
+
+ // Do not propogate event to avoid unwanted side effects.
+ e.stopPropagation();
});
}
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/267d03b5c9cd/
Changeset: 267d03b5c9cd
User: davebgx
Date: 2014-04-25 20:28:17
Summary: Fix tool shed functional test for repository dependency handling.
Affected #: 1 file
diff -r 666a75d94ee91091d94b65ffbfe700224ad58f15 -r 267d03b5c9cdcad228fd40e12340f01c45f12c60 test/base/twilltestcase.py
--- a/test/base/twilltestcase.py
+++ b/test/base/twilltestcase.py
@@ -18,6 +18,7 @@
from galaxy.web import security
from galaxy.web.framework.helpers import iff
from galaxy.util.json import from_json_string
+from galaxy.util import asbool
from base.asserts import verify_assertions
from galaxy import eggs
@@ -1325,11 +1326,25 @@
params[ key ] = value
if params:
url += '?%s' % urllib.urlencode( params )
+ checked_boxes = dict()
+ unchecked_boxes = dict()
if checkbox_params is not None:
+ for checkbox_field in checkbox_params:
+ if checkbox_field in checked_boxes or checkbox_field in unchecked_boxes:
+ continue
+ if asbool( checkbox_params[ checkbox_field ] ):
+ checked_boxes[ checkbox_field ] = True
+ else:
+ unchecked_boxes[ checkbox_field ] = False
+ # Any checkbox field that is found twice in the controller's incoming parameters is considered checked,
+ # while any field that only appears once is considered unchecked.
+ checkbox_params = '&'.join( [ urllib.urlencode( checked_boxes ),
+ urllib.urlencode( checked_boxes ),
+ urllib.urlencode( unchecked_boxes ) ] )
if params or parsed_url.query:
- url += '&%s&%s' % ( urllib.urlencode( checkbox_params ), urllib.urlencode( checkbox_params ) )
+ url += '&%s' % checkbox_params
else:
- url += '?%s&%s' % ( urllib.urlencode( checkbox_params ), urllib.urlencode( checkbox_params ) )
+ url += '?%s' % checkbox_params
new_url = tc.go( url )
return_code = tc.browser.get_code()
assert return_code in allowed_codes, 'Invalid HTTP return code %s, allowed codes: %s' % \
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/666a75d94ee9/
Changeset: 666a75d94ee9
User: davebgx
Date: 2014-04-25 19:21:32
Summary: Fix for persisting data table entries generated by installed data managers.
Affected #: 1 file
diff -r dda514ffa5e99b1b13bc3d88dbf35c1fb336742d -r 666a75d94ee91091d94b65ffbfe700224ad58f15 lib/galaxy/tools/data_manager/manager.py
--- a/lib/galaxy/tools/data_manager/manager.py
+++ b/lib/galaxy/tools/data_manager/manager.py
@@ -134,15 +134,15 @@
tool_shed_url = tool_elem.find( 'tool_shed' ).text
# Handle protocol changes.
tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( self.data_managers.app, tool_shed_url )
+ # The protocol is not stored in the database.
+ tool_shed = common_util.remove_protocol_from_tool_shed_url( tool_shed_url )
repository_name = tool_elem.find( 'repository_name' ).text
repository_owner = tool_elem.find( 'repository_owner' ).text
installed_changeset_revision = tool_elem.find( 'installed_changeset_revision' ).text
- self.tool_shed_repository_info_dict = dict( tool_shed_url=tool_shed_url,
+ self.tool_shed_repository_info_dict = dict( tool_shed=tool_shed,
name=repository_name,
owner=repository_owner,
installed_changeset_revision=installed_changeset_revision )
- # The protocol is not stored in the database.
- tool_shed = common_util.remove_protocol_from_tool_shed_url( tool_shed_url )
tool_shed_repository = \
suc.get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( self.data_managers.app,
tool_shed,
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.