commit/galaxy-central: smcmanus: Removed dead code
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/508b95f29129/ changeset: 508b95f29129 user: smcmanus date: 2012-09-28 00:03:53 summary: Removed dead code affected #: 1 file diff -r 2a2bc1ee4ac7557014a50549e8a8c32746a6ca96 -r 508b95f2912926ae954d6b7e16aaac4408c85eec lib/galaxy/web/controllers/library_common.py --- a/lib/galaxy/web/controllers/library_common.py +++ b/lib/galaxy/web/controllers/library_common.py @@ -93,64 +93,6 @@ } return rval - def display_folder_hierarchy( self, trans_in, cntrller_in, use_panels_in, library_in, created_ldda_ids_in, hidden_folder_ids_in, show_deleted_in, comptypes_in, current_user_roles_in, message_in, status ): - log.debug( "display_folder_hierarchy: enter" ) - # SM: Determine if this is an admin user (trans.user_is_admin and cntrller - # is library_admin). If so, then the user gets add, modify, manage permissions. - # Otherwise, if this is the library/requests controller then lookup those - # three permissions. Otherwise, it's all not true. - # - # Now get the library's info_assocation (?). TODO: Look into this. - # Determine if there are accessible folders: - # 1. Is the root folder accessible to this user? - # 2. IS the root folder accessible to this user (without looking downward)? - # 3. Is this guy an admin OR is the root folder accessible to this user? - # Evidently roles are used each time. - # - # Then show management buttons and links, and then call render_folders - - # render_folder: - # Repeat determining if this is an admin user: - # is_admin = trans.user_is_admin() and cntrller == 'library_admin' - # Turn the list of created lddas into a list - split by comma, turn one - # element into its own list, and leave lists alone. - # (Christ) If this is an admin user, then all permissions are granted. - # O.w., if this is the library controller, - # determine the folder ids along with whether the folders can be - # shown, and determine the other three admin permissions. - # O.w., no modifications are allowed - it's view-only. - # Get the form type and (sigh) again get the folder's info_association (?) - # Display information about the folder. - # Get the list of deleted (if shown) and non-deleted datasets and subfolders. - # Call render_folder for every subfolder - # For every library dataset, determine the ldda. If there is an ldda, then - # determine if the ldda's dataset can be displayed. - - # TODO: Move this to a security function/method later. - is_admin = trans.user_is_admin() and cntrller == 'library_admin' - - if is_admin: - can_add = can_modify = can_manage = True - elif cntrller in [ 'library', 'requests' ]: - can_add = trans.app.security_agent.can_add_library_item( current_user_roles_in, library ) - can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles_in, library ) - can_manage = trans.app.security_agent.can_manage_library_item( current_user_roles_in, library ) - else: - can_add = can_modify = can_manage = False - - info_association, inherited = library_in.get_info_association() - log.debug( "type(info_association): %s" % type(info_association) ) - log.debug( "type(inherited): %s" % type(inherited) ) - - # SM: determine if folders are accessible underneath here: - has_accessible_folders = is_admin or trans.app.security_agent.has_accessible_folders( trans, library.root_folder, trans.user, current_user_roles_in ) - if has_accessible_folders and cntrller in ['library', 'requests']: - self.display_folder( 'library', library.root_folder, 0, created_ldda_ids, library, hidden_folder_ids, tracked_datasets, show_deleted = show_deleted, parent=None, root_folder=True, simple=simple ) - elif ( trans_in.user_is_admin() and cntrller in [ 'library_admin', 'requests_admin' ] ): - # SM: TODO: Start here. - pass - pass - @web.expose def browse_library( self, trans, cntrller, **kwd ): params = util.Params( kwd ) @@ -187,34 +129,22 @@ message += "message \"This job is running\" is cleared from the \"Information\" column below for each selected dataset." status = "info" comptypes = get_comptypes( trans ) - # SM: Retrieve the entire hierarchy and pass it to the template to fill in. - # We'll eliminate the mako from retrieving stuff for now. - # SM: TODO: Add configuration item - # if trans.app.config.optimize_folders: - if False: - hierarchy = self.display_folder_hierarchy( trans, cntrller, use_panels, library, - created_ldda_ids, hidden_folder_ids, - show_deleted, comptypes, - current_user_roles, message, - status ) - - else: - try: - # SM: TODO: Add configuration variable asap. - return trans.fill_template( '/library/common/browse_library.mako', - cntrller=cntrller, - use_panels=use_panels, - library=library, - created_ldda_ids=created_ldda_ids, - hidden_folder_ids=hidden_folder_ids, - show_deleted=show_deleted, - comptypes=comptypes, - current_user_roles=current_user_roles, - message=message, - status=status ) - except Exception, e: - message = 'Error attempting to display contents of library (%s): %s.' % ( str( library.name ), str( e ) ) - status = 'error' + try: + # SM: TODO: Add configuration variable asap. + return trans.fill_template( '/library/common/browse_library.mako', + cntrller=cntrller, + use_panels=use_panels, + library=library, + created_ldda_ids=created_ldda_ids, + hidden_folder_ids=hidden_folder_ids, + show_deleted=show_deleted, + comptypes=comptypes, + current_user_roles=current_user_roles, + message=message, + status=status ) + except Exception, e: + message = 'Error attempting to display contents of library (%s): %s.' % ( str( library.name ), str( e ) ) + status = 'error' default_action = params.get( 'default_action', None ) return trans.response.send_redirect( web.url_for( use_panels=use_panels, 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)
-
Bitbucket