(self)
Main command to create a new shell
Main command to create a new shell
Main command to create a new shell
def command(self):
        """Main command to create a new shell"""
        self.verbose = 3
        if len(self.args) == 0:
            # Assume the .ini file is ./development.ini
            config_file = 'development.ini'
            if not os.path.isfile(config_file):
                raise BadCommand('%sError: CONFIG_FILE not found at: .%s%s\n'
                                 'Please specify a CONFIG_FILE' % \
                                 (self.parser.get_usage(), os.path.sep,
                                  config_file))
        else:
            config_file = self.args[0]

        config_name = 'config:%s' % config_file
        here_dir = os.getcwd()

        if not self.options.quiet:
            # Configure logging from the config file
            self.logging_file_config(config_file)

        # Load the wsgi app first so that everything is initialized right
        wsgiapp = loadapp(config_name, relative_to=here_dir)
        test_app = paste.fixture.TestApp(wsgiapp)

        # Query the test app to setup the environment and get the mapper
        tresponse = test_app.get('/_test_vars')
        mapper = tresponse.config.get('routes.map')
        if mapper:
            print mapper
def command ( self ) : self . verbose = 3 if len ( self . args ) == 0 : # Assume the .ini file is ./development.ini config_file = 'development.ini' if not os . path . isfile ( config_file ) : raise BadCommand ( '%sError: CONFIG_FILE not found at: .%s%s\n' 'Please specify a CONFIG_FILE' % ( self . parser . get_usage ( ) , os . path . sep , config_file ) ) else : config_file = self . args [ 0 ] config_name = 'config:%s' % config_file here_dir = os . getcwd ( ) if not self . options . quiet : # Configure logging from the config file self . logging_file_config ( config_file ) # Load the wsgi app first so that everything is initialized right wsgiapp = loadapp ( config_name , relative_to = here_dir ) test_app = paste . fixture . TestApp ( wsgiapp ) # Query the test app to setup the environment and get the mapper tresponse = test_app . get ( '/_test_vars' ) mapper = tresponse . config . get ( 'routes.map' ) if mapper : print mapper