(self)
Called from when the program is initialized and config
        path is loaded.
Called from when the program is initialized and config
        path is loaded.
Called from when the program is initialized and config path is loaded .
def initialize(self):
        """Called from when the program is initialized and config
        path is loaded."""
        # TODO: handle automatic assignment
        self._read_cfg()
        self.debug = (self.cfg['pygmy']['debug'] == 'True')
        self.database = dict(self.cfg['database'].items())
        self.schema = self.cfg['pygmy']['schema']
        self.host = self.cfg['pygmy']['host']
        self.port = self.cfg['pygmy']['port']
        self.secret = self.cfg['pygmy']['flask_secret']
        self.logging = self.cfg['logging']
        self.webservice_url = "{0}://{1}:{2}".format(
            self.schema, self.host, self.port)

        if self.database['engine'] == 'sqlite3':
            root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
            data_dir = self.database.get('sqlite_data_dir') or 'data'
            file_name = self.database.get('sqlite_db_file_name') or 'pygmy.db'
            sqlite_path = root_dir + '/' + data_dir + '/' + file_name
            self.database['url'] = 'sqlite:///{}'.format(sqlite_path)
def initialize ( self ) : # TODO: handle automatic assignment self . _read_cfg ( ) self . debug = ( self . cfg [ 'pygmy' ] [ 'debug' ] == 'True' ) self . database = dict ( self . cfg [ 'database' ] . items ( ) ) self . schema = self . cfg [ 'pygmy' ] [ 'schema' ] self . host = self . cfg [ 'pygmy' ] [ 'host' ] self . port = self . cfg [ 'pygmy' ] [ 'port' ] self . secret = self . cfg [ 'pygmy' ] [ 'flask_secret' ] self . logging = self . cfg [ 'logging' ] self . webservice_url = "{0}://{1}:{2}" . format ( self . schema , self . host , self . port ) if self . database [ 'engine' ] == 'sqlite3' : root_dir = os . path . dirname ( os . path . dirname ( os . path . abspath ( __file__ ) ) ) data_dir = self . database . get ( 'sqlite_data_dir' ) or 'data' file_name = self . database . get ( 'sqlite_db_file_name' ) or 'pygmy.db' sqlite_path = root_dir + '/' + data_dir + '/' + file_name self . database [ 'url' ] = 'sqlite:///{}' . format ( sqlite_path )