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

https://bitbucket.org/cistrome/cistrome-harvard/ · Python · 27 lines · 21 code · 1 blank · 5 comment · 2 complexity · b5c765443d3d1110e129e6146c6a6fe8 MD5 · raw file

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