PageRenderTime 68ms CodeModel.GetById 56ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 1ms

/lib/galaxy/webapps/reports/app.py

https://bitbucket.org/cistrome/cistrome-harvard/
Python | 27 lines | 21 code | 1 blank | 5 comment | 1 complexity | b5c765443d3d1110e129e6146c6a6fe8 MD5 | raw file
 1import sys, config
 2import galaxy.model
 3from galaxy.web import security
 4
 5class UniverseApplication( object ):
 6    """Encapsulates the state of a Universe application"""
 7    def __init__( self, **kwargs ):
 8        print >> sys.stderr, "python path is: " + ", ".join( sys.path )
 9        self.name = "reports"
10        # Read config file and check for errors
11        self.config = config.Configuration( **kwargs )
12        self.config.check()
13        config.configure_logging( self.config )
14        # Determine the database url
15        if self.config.database_connection:
16            db_url = self.config.database_connection
17        else:
18            db_url = "sqlite://%s?isolation_level=IMMEDIATE" % self.config.database
19        # Setup the database engine and ORM
20        self.model = galaxy.model.mapping.init( self.config.file_path,
21                                                db_url,
22                                                self.config.database_engine_options,
23                                                create_tables = True )
24        # Security helper
25        self.security = security.SecurityHelper( id_secret=self.config.id_secret )
26    def shutdown( self ):
27        pass