mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-25 00:12:08 +08:00
Merged in jmchilton/galaxy-central-fork-1 (pull request #665)
Add major version to Galaxy, expose via API.
This commit is contained in:
@@ -19,7 +19,7 @@ from galaxy.util import listify
|
||||
from galaxy.util import string_as_bool
|
||||
from galaxy.util.dbkeys import GenomeBuilds
|
||||
from galaxy.web.formatting import expand_pretty_datetime_format
|
||||
|
||||
from .version import VERSION_MAJOR
|
||||
|
||||
log = logging.getLogger( __name__ )
|
||||
|
||||
@@ -63,6 +63,7 @@ class Configuration( object ):
|
||||
# This is not a uwsgi process, or something went horribly wrong.
|
||||
pass
|
||||
|
||||
self.version_major = VERSION_MAJOR
|
||||
# Database related configuration
|
||||
self.database = resolve_path( kwargs.get( "database_file", "database/universe.sqlite" ), self.root )
|
||||
self.database_connection = kwargs.get( "database_connection", False )
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
VERSION_MAJOR = "15.03"
|
||||
@@ -31,6 +31,10 @@ class ConfigurationController( BaseAPIController ):
|
||||
serialization_params = self._parse_serialization_params( kwd, 'all' )
|
||||
return self.get_config_dict( trans, is_admin, **serialization_params )
|
||||
|
||||
@expose_api_anonymous
|
||||
def version( self, trans, **kwds ):
|
||||
return {"version_major": self.app.config.version_major }
|
||||
|
||||
def get_config_dict( self, trans, return_admin=False, view=None, keys=None, default_view='all' ):
|
||||
"""
|
||||
Return a dictionary with (a subset of) current Galaxy settings.
|
||||
@@ -97,6 +101,7 @@ class ConfigSerializer( base.ModelSerializer ):
|
||||
'nginx_upload_path' : _defaults_to( self.url_for( controller='api', action='tools' ) ),
|
||||
'ftp_upload_dir' : _defaults_to( None ),
|
||||
'ftp_upload_site' : _defaults_to( None ),
|
||||
'version_major' : _defaults_to( None ),
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -222,6 +222,9 @@ def populate_api_routes( webapp, app ):
|
||||
webapp.mapper.resource_with_deleted( 'history', 'histories', path_prefix='/api' )
|
||||
webapp.mapper.connect( '/api/histories/{history_id}/citations', action='citations', controller="histories" )
|
||||
webapp.mapper.resource( 'configuration', 'configuration', path_prefix='/api' )
|
||||
webapp.mapper.connect( "configuration_version",
|
||||
"/api/version", controller="configuration",
|
||||
action="version", conditions=dict( method=[ "GET" ] ) )
|
||||
webapp.mapper.resource( 'datatype',
|
||||
'datatypes',
|
||||
path_prefix='/api',
|
||||
|
||||
Reference in New Issue
Block a user