commit/galaxy-central: smcmanus: Re-commit new /api/folders section
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/fc394a686d61/ changeset: fc394a686d61 user: smcmanus date: 2012-10-16 00:09:25 summary: Re-commit new /api/folders section affected #: 6 files diff -r ad2fcd45ae9641fc4e1df49730a70095d85c3790 -r fc394a686d61920b17db1226b7c702612e747015 lib/galaxy/config.py --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -233,6 +233,11 @@ self.amqp[k] = v self.biostar = kwargs.get( 'biostar', None ) self.running_functional_tests = string_as_bool( kwargs.get( 'running_functional_tests', False ) ) + # Experimental: This will not be enabled by default and will hide + # nonproduction code. + # The api_folders refers to whether the API exposes + self.api_folders = string_as_bool( kwargs.get( 'api_folders', False ) ) + def __read_tool_job_config( self, global_conf_parser, section, key ): try: tool_runners_config = global_conf_parser.items( section ) diff -r ad2fcd45ae9641fc4e1df49730a70095d85c3790 -r fc394a686d61920b17db1226b7c702612e747015 lib/galaxy/webapps/galaxy/api/libraries.py --- a/lib/galaxy/webapps/galaxy/api/libraries.py +++ b/lib/galaxy/webapps/galaxy/api/libraries.py @@ -20,6 +20,7 @@ GET /api/libraries/deleted Displays a collection (list) of libraries. """ + log.debug( "LibrariesController.index: enter" ) query = trans.sa_session.query( trans.app.model.Library ) deleted = util.string_as_bool( deleted ) if deleted: @@ -53,6 +54,7 @@ GET /api/libraries/deleted/{encoded_library_id} Displays information about a library. """ + log.debug( "LibraryContentsController.show: enter" ) library_id = id deleted = util.string_as_bool( deleted ) params = util.Params( kwd ) diff -r ad2fcd45ae9641fc4e1df49730a70095d85c3790 -r fc394a686d61920b17db1226b7c702612e747015 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 @@ -13,6 +13,7 @@ class LibraryContentsController( BaseAPIController, UsesLibraryMixin, UsesLibraryMixinItems ): @web.expose_api + # TODO: Add parameter to only get top level of datasets/subfolders. def index( self, trans, library_id, **kwd ): """ GET /api/libraries/{encoded_library_id}/contents diff -r ad2fcd45ae9641fc4e1df49730a70095d85c3790 -r fc394a686d61920b17db1226b7c702612e747015 lib/galaxy/webapps/galaxy/buildapp.py --- a/lib/galaxy/webapps/galaxy/buildapp.py +++ b/lib/galaxy/webapps/galaxy/buildapp.py @@ -60,6 +60,10 @@ # Add the web API webapp.add_api_controllers( 'galaxy.webapps.galaxy.api', app ) + # The /folders section is experimental at this point: + log.debug( "app.config.api_folders: %s" % app.config.api_folders ) + if app.config.api_folders: + webapp.api_mapper.resource( 'folder', 'folders', path_prefix='/api' ) webapp.api_mapper.resource( 'content', 'contents', controller='library_contents', diff -r ad2fcd45ae9641fc4e1df49730a70095d85c3790 -r fc394a686d61920b17db1226b7c702612e747015 lib/galaxy/webapps/galaxy/controllers/library_common.py --- a/lib/galaxy/webapps/galaxy/controllers/library_common.py +++ b/lib/galaxy/webapps/galaxy/controllers/library_common.py @@ -317,6 +317,8 @@ status='done' ) # If not inheritable info_association, redirect to the library. message = "The new folder named '%s' has been added to the data library." % new_folder.name + # SM: This is the second place where the API controller would + # reference the library id: return trans.response.send_redirect( web.url_for( controller='library_common', action='browse_library', cntrller=cntrller, diff -r ad2fcd45ae9641fc4e1df49730a70095d85c3790 -r fc394a686d61920b17db1226b7c702612e747015 scripts/api/library_create_folder.py --- a/scripts/api/library_create_folder.py +++ b/scripts/api/library_create_folder.py @@ -15,6 +15,7 @@ try: data[ 'description' ] = sys.argv[5] except IndexError: + print "Unable to set description; using empty description in its place" data[ 'description' ] = '' submit( sys.argv[1], sys.argv[2], data ) 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