Esempio n. 1
0
def init_db(store, use_single_lang=False):
    db_create_tables(store)
    appdata_dict = db_update_appdata(store)

    log.debug("Performing database initialization...")

    config.system_cfg_init(store)

    if GLSettings.skip_wizard:
        NodeFactory(store).set_val('wizard_done', True)

    log.debug("Inserting internationalized strings...")

    if not use_single_lang:
        EnabledLanguage.add_all_supported_langs(store, appdata_dict)
    else:
        EnabledLanguage.add_new_lang(store, u'en', appdata_dict)

    with open(os.path.join(GLSettings.client_path, 'logo.png'),
              'r') as logo_file:
        data = logo_file.read()
        files.db_add_file(store, data, u'logo')

    with open(os.path.join(GLSettings.client_path, 'favicon.ico'),
              'r') as favicon_file:
        data = favicon_file.read()
        files.db_add_file(store, data, u'favicon')
Esempio n. 2
0
def init_db(store, use_single_lang=False):
    db_create_tables(store)
    appdata_dict = db_update_appdata(store)

    log.debug("Performing database initialization...")

    config.system_cfg_init(store)

    if GLSettings.skip_wizard:
        NodeFactory(store).set_val('wizard_done', True)

    log.debug("Inserting internationalized strings...")

    if not use_single_lang:
        EnabledLanguage.add_all_supported_langs(store, appdata_dict)
    else:
        EnabledLanguage.add_new_lang(store, u'en', appdata_dict)

    with open(os.path.join(GLSettings.client_path, 'logo.png'), 'r') as logo_file:
        data = logo_file.read()
        files.db_add_file(store, data, u'logo')

    with open(os.path.join(GLSettings.client_path, 'favicon.ico'), 'r') as favicon_file:
        data = favicon_file.read()
        files.db_add_file(store, data, u'favicon')
Esempio n. 3
0
def init_db(store, use_single_lang=False):
    db_create_tables(store)
    appdata_dict = db_update_appdata(store)

    log.debug("Performing database initialization...")

    config.system_cfg_init(store)

    if not use_single_lang:
        EnabledLanguage.add_all_supported_langs(store, appdata_dict)
    else:
        EnabledLanguage.add_new_lang(store, u'en', appdata_dict)

    with open(os.path.join(GLSettings.client_path, 'data/logo.png'),
              'r') as logo_file:
        data = logo_file.read()
        files.db_add_file(store, data, u'logo')

    with open(os.path.join(GLSettings.client_path, 'data/favicon.ico'),
              'r') as favicon_file:
        data = favicon_file.read()
        files.db_add_file(store, data, u'favicon')