<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from __future__ import print_function <EOL> from __future__ import unicode_literals <EOL> from __future__ import division <EOL> from pycopia . db import models <EOL> from pycopia . QA import config <EOL> class _Session_builder ( object ) : <EOL> def __getattr__ ( self , name ) : <EOL> global _session <EOL> if isinstance ( _session , _Session_builder ) : <EOL> _session = models . get_session ( ) <EOL> return getattr ( _session , name ) <EOL> _session = _Session_builder ( ) <EOL> class _Config_getter ( object ) : <EOL> def __getattr__ ( self , name ) : <EOL> global _config <EOL> if isinstance ( _config , _Config_getter ) : <EOL> _config = config . get_config ( session = _session ) <EOL> return getattr ( _config , name ) <EOL> _config = _Config_getter ( ) <EOL> def get_environment_names ( ) : <EOL> """<STR_LIT>""" <EOL> envlist = [ r [ <NUM_LIT:0> ] for r in _session . query ( models . Environment . name ) . order_by ( models . Environment . name ) . all ( ) ] <EOL> userenvname = _config . userconfig . get ( "<STR_LIT>" , u"<STR_LIT:default>" ) <EOL> envlist . remove ( userenvname ) <EOL> envlist . insert ( <NUM_LIT:0> , userenvname ) <EOL> return envlist <EOL> def get_report_names ( ) : <EOL> """<STR_LIT>""" <EOL> rlist = _config . reports . keys ( ) <EOL> for notneeded in ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:default>" , "<STR_LIT>" ) : <EOL> try : <EOL> rlist . remove ( notneeded ) <EOL> except ValueError : <EOL> pass <EOL> return rlist <EOL> def get_job_list ( ) : <EOL> return _session . query ( models . TestJob ) . order_by ( models . TestJob . name ) . all ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> from pycopia import autodebug <EOL> print ( get_job_list ( ) ) <EOL> pass </s>
