3 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/ccbec227fcb9/ Changeset: ccbec227fcb9 User: jmchilton Date: 2013-11-17 07:47:26 Summary: Do not reference values before use when GALAXY_TEST_EXTERNAL used. GALAXY_TEST_EXTERNAL still quite broken. Affected #: 1 file diff -r 6ce38346b347dab8f4c7522df7a43874789e40ce -r ccbec227fcb958cb0137603ddad743be9ce8724f scripts/functional_tests.py --- a/scripts/functional_tests.py +++ b/scripts/functional_tests.py @@ -217,9 +217,9 @@ database_auto_migrate = False + galaxy_test_proxy_port = None + psu_production = False if start_server: - psu_production = False - galaxy_test_proxy_port = None if 'GALAXY_TEST_PSU_PRODUCTION' in os.environ: if not galaxy_test_port: raise Exception( 'Please set GALAXY_TEST_PORT to the port to which the proxy server will proxy' ) https://bitbucket.org/galaxy/galaxy-central/commits/91b23579fb92/ Changeset: 91b23579fb92 User: jmchilton Date: 2013-11-17 07:47:26 Summary: Fix logic in tool's populate_state logic to handle multiple uploads. Enables composite uploads through API. Affected #: 1 file diff -r ccbec227fcb958cb0137603ddad743be9ce8724f -r 91b23579fb923ba358bae9768eb08c28e51dfa23 lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -2155,11 +2155,19 @@ #remove extra files while len( group_state ) > len( writable_files ): del group_state[-1] + + # Add new fileupload as needed + while len( writable_files ) > len( group_state ): + new_state = {} + new_state['__index__'] = len( group_state ) + self.fill_in_new_state( trans, input.inputs, new_state, context ) + group_state.append( new_state ) + if any_group_errors: + group_errors.append( {} ) + # Update state - max_index = -1 for i, rep_state in enumerate( group_state ): rep_index = rep_state['__index__'] - max_index = max( max_index, rep_index ) rep_prefix = "%s_%d|" % ( key, rep_index ) rep_errors = self.populate_state( trans, input.inputs, @@ -2174,16 +2182,6 @@ group_errors.append( rep_errors ) else: group_errors.append( {} ) - # Add new fileupload as needed - offset = 1 - while len( writable_files ) > len( group_state ): - new_state = {} - new_state['__index__'] = max_index + offset - offset += 1 - self.fill_in_new_state( trans, input.inputs, new_state, context ) - group_state.append( new_state ) - if any_group_errors: - group_errors.append( {} ) # Were there *any* errors for any repetition? if any_group_errors: errors[input.name] = group_errors https://bitbucket.org/galaxy/galaxy-central/commits/ec285ee50bf7/ Changeset: ec285ee50bf7 User: jmchilton Date: 2013-11-17 07:47:26 Summary: Consolidate duplicated code for loading HDAs from the API. Affected #: 3 files diff -r 91b23579fb923ba358bae9768eb08c28e51dfa23 -r ec285ee50bf72455ad5a7f63d73c0516c185ecd0 lib/galaxy/web/base/controller.py --- a/lib/galaxy/web/base/controller.py +++ b/lib/galaxy/web/base/controller.py @@ -568,6 +568,31 @@ error( "Please wait until this dataset finishes uploading before attempting to view it." ) return hda + def get_history_dataset_association_from_ids( self, trans, id, history_id ): + # Just to echo other TODOs, there seems to be some overlap here, still + # this block appears multiple places (dataset show, history_contents + # show, upcoming history job show) so I am consolodating it here. + # Someone smarter than me should determine if there is some redundancy here. + + # for anon users: + #TODO: check login_required? + #TODO: this isn't actually most_recently_used (as defined in histories) + if( ( trans.user == None ) + and ( history_id == trans.security.encode_id( trans.history.id ) ) ): + history = trans.history + #TODO: dataset/hda by id (from history) OR check_ownership for anon user + hda = self.get_history_dataset_association( trans, history, id, + check_ownership=False, check_accessible=True ) + else: + #TODO: do we really need the history? + history = self.get_history( trans, history_id, + check_ownership=True, check_accessible=True, deleted=False ) + hda = self.get_history_dataset_association( trans, history, id, + check_ownership=True, check_accessible=True ) + return hda + + + def get_hda_list( self, trans, hda_ids, check_ownership=True, check_accessible=False, check_state=True ): """ Returns one or more datasets in a list. diff -r 91b23579fb923ba358bae9768eb08c28e51dfa23 -r ec285ee50bf72455ad5a7f63d73c0516c185ecd0 lib/galaxy/webapps/galaxy/api/datasets.py --- a/lib/galaxy/webapps/galaxy/api/datasets.py +++ b/lib/galaxy/webapps/galaxy/api/datasets.py @@ -255,24 +255,9 @@ datatype prior to display (the defult if raw is unspecified or explicitly false. """ raw = string_as_bool_or_none( raw ) - # Huge amount of code overlap with lib/galaxy/webapps/galaxy/api/history_content:show here. rval = '' try: - # for anon users: - #TODO: check login_required? - #TODO: this isn't actually most_recently_used (as defined in histories) - if( ( trans.user == None ) - and ( history_id == trans.security.encode_id( trans.history.id ) ) ): - history = trans.history - #TODO: dataset/hda by id (from history) OR check_ownership for anon user - hda = self.get_history_dataset_association( trans, history, history_content_id, - check_ownership=False, check_accessible=True ) - - else: - history = self.get_history( trans, history_id, - check_ownership=True, check_accessible=True, deleted=False ) - hda = self.get_history_dataset_association( trans, history, history_content_id, - check_ownership=True, check_accessible=True ) + hda = self.get_history_dataset_association_from_ids( trans, history_content_id, history_id ) display_kwd = kwd.copy() try: diff -r 91b23579fb923ba358bae9768eb08c28e51dfa23 -r ec285ee50bf72455ad5a7f63d73c0516c185ecd0 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 @@ -135,32 +135,17 @@ :returns: dictionary containing detailed HDA information .. seealso:: :func:`galaxy.web.base.controller.UsesHistoryDatasetAssociationMixin.get_hda_dict` """ - hda_dict = {} try: - # for anon users: - #TODO: check login_required? - #TODO: this isn't actually most_recently_used (as defined in histories) - if( ( trans.user == None ) - and ( history_id == trans.security.encode_id( trans.history.id ) ) ): - history = trans.history - #TODO: dataset/hda by id (from history) OR check_ownership for anon user - hda = self.get_history_dataset_association( trans, history, id, - check_ownership=False, check_accessible=True ) - else: - #TODO: do we really need the history? - history = self.get_history( trans, history_id, - check_ownership=True, check_accessible=True, deleted=False ) - hda = self.get_history_dataset_association( trans, history, id, - check_ownership=True, check_accessible=True ) + hda = self.get_history_dataset_association_from_ids( trans, id, history_id ) hda_dict = self.get_hda_dict( trans, hda ) hda_dict[ 'display_types' ] = self.get_old_display_applications( trans, hda ) hda_dict[ 'display_apps' ] = self.get_display_apps( trans, hda ) + return hda_dict except Exception, e: msg = "Error in history API at listing dataset: %s" % ( str(e) ) log.error( msg, exc_info=True ) trans.response.status = 500 return msg - return hda_dict @web.expose_api def create( self, trans, history_id, payload, **kwd ): 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.