mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
indentation fixes
This commit is contained in:
committed by
Nicola Soranzo
parent
2160a03272
commit
8b9aa5d8df
@@ -67,7 +67,7 @@ class DatasetsController( BaseAPIController, UsesVisualizationMixin ):
|
||||
# Default: return dataset as dict.
|
||||
if hda_ldda == 'hda':
|
||||
return self.hda_serializer.serialize_to_view( dataset,
|
||||
view=kwd.get( 'view', 'detailed' ), user=trans.user, trans=trans )
|
||||
view=kwd.get( 'view', 'detailed' ), user=trans.user, trans=trans )
|
||||
else:
|
||||
rval = dataset.to_dict()
|
||||
|
||||
@@ -111,7 +111,7 @@ class DatasetsController( BaseAPIController, UsesVisualizationMixin ):
|
||||
# If there is a chrom, check for data on the chrom.
|
||||
if chrom:
|
||||
data_provider = trans.app.data_provider_registry.get_data_provider( trans,
|
||||
original_dataset=dataset, source='index' )
|
||||
original_dataset=dataset, source='index' )
|
||||
if not data_provider.has_data( chrom ):
|
||||
return dataset.conversion_messages.NO_DATA
|
||||
|
||||
@@ -286,7 +286,7 @@ class DatasetsController( BaseAPIController, UsesVisualizationMixin ):
|
||||
if raw:
|
||||
if filename and filename != 'index':
|
||||
file_path = trans.app.object_store.get_filename( hda.dataset,
|
||||
extra_dir=( 'dataset_%s_files' % hda.dataset.id ), alt_name=filename)
|
||||
extra_dir=( 'dataset_%s_files' % hda.dataset.id ), alt_name=filename)
|
||||
else:
|
||||
file_path = hda.file_name
|
||||
rval = open( file_path )
|
||||
|
||||
@@ -56,8 +56,8 @@ class GroupRolesAPIController( BaseAPIController ):
|
||||
for gra in group.roles:
|
||||
if gra.role == role:
|
||||
item = dict( id=role_id,
|
||||
name=role.name,
|
||||
url=url_for( 'group_role', group_id=group_id, id=role_id) ) # TODO Fix This
|
||||
name=role.name,
|
||||
url=url_for( 'group_role', group_id=group_id, id=role_id) ) # TODO Fix This
|
||||
if not item:
|
||||
item = "role %s not in group %s" % (role.name, group.name)
|
||||
except Exception, e:
|
||||
@@ -82,8 +82,8 @@ class GroupRolesAPIController( BaseAPIController ):
|
||||
for gra in group.roles:
|
||||
if gra.role == role:
|
||||
item = dict( id=role_id,
|
||||
name=role.name,
|
||||
url=url_for( 'group_role', group_id=group_id, id=role_id) )
|
||||
name=role.name,
|
||||
url=url_for( 'group_role', group_id=group_id, id=role_id) )
|
||||
if not item:
|
||||
gra = trans.app.model.GroupRoleAssociation( group, role )
|
||||
# Add GroupRoleAssociation
|
||||
|
||||
@@ -56,8 +56,8 @@ class GroupUsersAPIController( BaseAPIController ):
|
||||
for uga in group.users:
|
||||
if uga.user == user:
|
||||
item = dict( id=user_id,
|
||||
email=user.email,
|
||||
url=url_for( 'group_user', group_id=group_id, id=user_id) ) # TODO Fix This
|
||||
email=user.email,
|
||||
url=url_for( 'group_user', group_id=group_id, id=user_id) ) # TODO Fix This
|
||||
if not item:
|
||||
item = "user %s not in group %s" % (user.email, group.name)
|
||||
except Exception, e:
|
||||
@@ -82,8 +82,8 @@ class GroupUsersAPIController( BaseAPIController ):
|
||||
for uga in group.users:
|
||||
if uga.user == user:
|
||||
item = dict( id=user_id,
|
||||
email=user.email,
|
||||
url=url_for( 'group_user', group_id=group_id, id=user_id) )
|
||||
email=user.email,
|
||||
url=url_for( 'group_user', group_id=group_id, id=user_id) )
|
||||
if not item:
|
||||
uga = trans.app.model.UserGroupAssociation( user, group )
|
||||
# Add UserGroupAssociations
|
||||
|
||||
@@ -123,7 +123,7 @@ class HistoriesController( BaseAPIController, ExportsHistoryMixin, ImportsHistor
|
||||
rval = []
|
||||
for history in histories:
|
||||
history_dict = self.history_serializer.serialize_to_view( history,
|
||||
user=trans.user, trans=trans, **serialization_params )
|
||||
user=trans.user, trans=trans, **serialization_params )
|
||||
rval.append( history_dict )
|
||||
return rval
|
||||
|
||||
@@ -183,7 +183,7 @@ class HistoriesController( BaseAPIController, ExportsHistoryMixin, ImportsHistor
|
||||
history = self.history_manager.get_accessible( self.decode_id( history_id ), trans.user, current_history=trans.history )
|
||||
|
||||
return self.history_serializer.serialize_to_view( history,
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
|
||||
@expose_api_anonymous
|
||||
def citations( self, trans, history_id, **kwd ):
|
||||
@@ -249,7 +249,7 @@ class HistoriesController( BaseAPIController, ExportsHistoryMixin, ImportsHistor
|
||||
trans.sa_session.flush()
|
||||
|
||||
return self.history_serializer.serialize_to_view( new_history,
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
|
||||
@expose_api
|
||||
def delete( self, trans, id, **kwd ):
|
||||
@@ -288,7 +288,7 @@ class HistoriesController( BaseAPIController, ExportsHistoryMixin, ImportsHistor
|
||||
self.history_manager.purge( history )
|
||||
|
||||
return self.history_serializer.serialize_to_view( history,
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
|
||||
@expose_api
|
||||
def undelete( self, trans, id, **kwd ):
|
||||
@@ -311,7 +311,7 @@ class HistoriesController( BaseAPIController, ExportsHistoryMixin, ImportsHistor
|
||||
self.history_manager.undelete( history )
|
||||
|
||||
return self.history_serializer.serialize_to_view( history,
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
|
||||
@expose_api
|
||||
def update( self, trans, id, payload, **kwd ):
|
||||
@@ -340,7 +340,7 @@ class HistoriesController( BaseAPIController, ExportsHistoryMixin, ImportsHistor
|
||||
|
||||
self.history_deserializer.deserialize( history, payload, user=trans.user, trans=trans )
|
||||
return self.history_serializer.serialize_to_view( history,
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
|
||||
@expose_api
|
||||
def archive_export( self, trans, id, **kwds ):
|
||||
|
||||
@@ -111,7 +111,7 @@ class HistoryContentsController( BaseAPIController, UsesLibraryMixin, UsesLibrar
|
||||
|
||||
def __collection_dict( self, trans, dataset_collection_instance, view="collection" ):
|
||||
return dictify_dataset_collection_instance( dataset_collection_instance,
|
||||
security=trans.security, parent=dataset_collection_instance.history, view=view )
|
||||
security=trans.security, parent=dataset_collection_instance.history, view=view )
|
||||
|
||||
@expose_api_anonymous
|
||||
def show( self, trans, id, history_id, **kwd ):
|
||||
@@ -140,7 +140,7 @@ class HistoryContentsController( BaseAPIController, UsesLibraryMixin, UsesLibrar
|
||||
def __show_dataset( self, trans, id, **kwd ):
|
||||
hda = self.hda_manager.get_accessible( self.decode_id( id ), trans.user )
|
||||
return self.hda_serializer.serialize_to_view( hda,
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
|
||||
def __show_dataset_collection( self, trans, id, history_id, **kwd ):
|
||||
try:
|
||||
@@ -210,7 +210,7 @@ class HistoryContentsController( BaseAPIController, UsesLibraryMixin, UsesLibrar
|
||||
# examples. See also bioblend and API tests for specific examples.
|
||||
|
||||
history = self.history_manager.get_owned( self.decode_id( history_id ), trans.user,
|
||||
current_history=trans.history )
|
||||
current_history=trans.history )
|
||||
|
||||
type = payload.get( 'type', 'dataset' )
|
||||
if type == 'dataset':
|
||||
@@ -253,7 +253,7 @@ class HistoryContentsController( BaseAPIController, UsesLibraryMixin, UsesLibrar
|
||||
if not hda:
|
||||
return None
|
||||
return self.hda_serializer.serialize_to_view( hda,
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
|
||||
def __create_dataset_collection( self, trans, history, payload, **kwd ):
|
||||
source = kwd.get("source", "new_collection")
|
||||
@@ -344,7 +344,7 @@ class HistoryContentsController( BaseAPIController, UsesLibraryMixin, UsesLibrar
|
||||
if payload.get( 'deleted', False ):
|
||||
self.hda_manager.stop_creating_job( hda )
|
||||
return self.hda_serializer.serialize_to_view( hda,
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
|
||||
return {}
|
||||
|
||||
@@ -403,7 +403,7 @@ class HistoryContentsController( BaseAPIController, UsesLibraryMixin, UsesLibrar
|
||||
else:
|
||||
self.hda_manager.delete( hda )
|
||||
return self.hda_serializer.serialize_to_view( hda,
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
user=trans.user, trans=trans, **self._parse_serialization_params( kwd, 'detailed' ) )
|
||||
|
||||
def __handle_unknown_contents_type( self, trans, contents_type ):
|
||||
raise exceptions.UnknownContentsType('Unknown contents type: %s' % type)
|
||||
|
||||
@@ -120,7 +120,7 @@ class ToolShedRepositoriesController( BaseAPIController ):
|
||||
|
||||
def __get_value_mapper( self, trans, tool_shed_repository ):
|
||||
value_mapper = { 'id' : trans.security.encode_id( tool_shed_repository.id ),
|
||||
'error_message' : tool_shed_repository.error_message or '' }
|
||||
'error_message' : tool_shed_repository.error_message or '' }
|
||||
return value_mapper
|
||||
|
||||
@expose_api
|
||||
|
||||
@@ -63,7 +63,7 @@ class VisualizationsController( BaseAPIController, UsesVisualizationMixin, Shara
|
||||
visualization = self.get_visualization( trans, id, check_ownership=False, check_accessible=True )
|
||||
dictionary = trans.security.encode_dict_ids( self.get_visualization_dict( visualization ) )
|
||||
dictionary[ 'url' ] = web.url_for( controller='visualization',
|
||||
action="display_by_username_and_slug", username=visualization.user.username, slug=visualization.slug )
|
||||
action="display_by_username_and_slug", username=visualization.user.username, slug=visualization.slug )
|
||||
dictionary[ 'annotation' ] = self.get_item_annotation_str( trans.sa_session, trans.user, visualization )
|
||||
|
||||
# need to encode ids in revisions as well
|
||||
|
||||
Reference in New Issue
Block a user