commit/galaxy-central: martenson: didn't want to commit these changes...reverting
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/fe0beae12c30/ Changeset: fe0beae12c30 User: martenson Date: 2013-09-27 16:14:45 Summary: didn't want to commit these changes...reverting Affected #: 1 file diff -r be8a8a9c72f8591ae6311f02314761e4df9fa8e2 -r fe0beae12c30d25fcd192a67043aea2b1cfddafb lib/galaxy/webapps/galaxy/api/library_contents.py --- a/lib/galaxy/webapps/galaxy/api/library_contents.py +++ b/lib/galaxy/webapps/galaxy/api/library_contents.py @@ -36,15 +36,8 @@ * url: the url to get detailed information on the library item """ rval = [] - params = util.Params( kwd, sanitize=False ) - # Recursive search is on by default. - load_recursively = params.get( 'load_recursively', None ) - if load_recursively is not None and load_recursively.lower() == "false": - load_recursively = False - else: - load_recursively = True current_user_roles = trans.get_current_user_roles() - def traverse( folder, load_recursively ): + def traverse( folder ): admin = trans.user_is_admin() rval = [] for subfolder in folder.active_folders: @@ -54,23 +47,20 @@ subfolder.api_path = folder.api_path + '/' + subfolder.name subfolder.api_type = 'folder' rval.append( subfolder ) - if load_recursively: - rval.extend( traverse( subfolder, load_recursively ) ) + rval.extend( traverse( subfolder ) ) for ld in folder.datasets: if not admin: can_access = trans.app.security_agent.can_access_dataset( current_user_roles, ld.library_dataset_dataset_association.dataset ) if (admin or can_access) and not ld.deleted: - log.debug( "type(folder): %s" % type( folder ) ) - log.debug( "type(api_path): %s; folder.api_path: %s" % ( type(folder.api_path), folder.api_path ) ) - log.debug( "attributes of folder: %s" % str(dir(folder)) ) + #log.debug( "type(folder): %s" % type( folder ) ) + #log.debug( "type(api_path): %s; folder.api_path: %s" % ( type(folder.api_path), folder.api_path ) ) + #log.debug( "attributes of folder: %s" % str(dir(folder)) ) ld.api_path = folder.api_path + '/' + ld.name ld.api_type = 'file' rval.append( ld ) return rval try: - if library_id[0] == 'F': - library_id = library_id[1:] decoded_library_id = trans.security.decode_id( library_id ) except TypeError: trans.response.status = 400 @@ -82,25 +72,22 @@ if not library or not ( trans.user_is_admin() or trans.app.security_agent.can_access_library( current_user_roles, library ) ): trans.response.status = 400 return "Invalid library id ( %s ) specified." % str( library_id ) - log.debug( "Root folder type: %s" % type( library.root_folder ) ) + #log.debug( "Root folder type: %s" % type( library.root_folder ) ) encoded_id = 'F' + trans.security.encode_id( library.root_folder.id ) rval.append( dict( id = encoded_id, type = 'folder', name = '/', url = url_for( 'library_content', library_id=library_id, id=encoded_id ) ) ) - log.debug( "Root folder attributes: %s" % str(dir(library.root_folder)) ) + #log.debug( "Root folder attributes: %s" % str(dir(library.root_folder)) ) library.root_folder.api_path = '' - if load_recursively: - for content in traverse( library.root_folder, load_recursively ): - encoded_id = trans.security.encode_id( content.id ) - if content.api_type == 'folder': - encoded_id = 'F' + encoded_id - rval.append( dict( id = encoded_id, - type = content.api_type, - name = content.api_path, - url = url_for( 'library_content', library_id=library_id, id=encoded_id, ) ) ) - else: # We don't load recursively, we need to pass different value to traverse. - pass + for content in traverse( library.root_folder ): + encoded_id = trans.security.encode_id( content.id ) + if content.api_type == 'folder': + encoded_id = 'F' + encoded_id + rval.append( dict( id = encoded_id, + type = content.api_type, + name = content.api_path, + url = url_for( 'library_content', library_id=library_id, id=encoded_id, ) ) ) return rval @web.expose_api 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.
participants (1)
-
commits-noreply@bitbucket.org