Esempio n. 1
0
def run():
    for theme in themes:
        print('=========================' + theme +
              ' begin =========================')
        common.init(AWTK_ROOT, ASSETS_ROOT, theme, ASSET_C)
        common.updateRes()
        print('=========================' + theme +
              ' end =========================\n')
    common.genAssetC(themes, ASSET_C)
Esempio n. 2
0
def buildTools():
    common.init(AWTK_ROOT, ASSETS_ROOT, 'default', ASSET_C)
    os.system('scons ' + common.toExe('bsvggen'))
    os.system('scons ' + common.toExe('strgen'))
    os.system('scons ' + common.toExe('resgen'))
    os.system('scons ' + common.toExe('themegen'))
    os.system('scons ' + common.toExe('imagegen'))
    os.system('scons ' + common.toExe('fontgen'))
    os.system('scons ' + common.toExe('xml_to_ui'))
Esempio n. 3
0
def run(awtk_root, is_excluded_file_handler = None):
    global DPI
    global AWTK_ROOT
    global TOOLS_ROOT
    global THEMES
    global APP_THEME
    global APP_ROOT
    global ASSETS_ROOT
    global OUTPUT_ROOT
    global IS_GENERATE_INC_RES
    global IS_GENERATE_INC_BITMAP

    AWTK_ROOT = awtk_root
    APP_ROOT = common.getcwd()
    action = common.get_action()
    if APP_ROOT.endswith('scripts'):
        APP_ROOT = os.path.dirname(APP_ROOT)

    os.chdir(APP_ROOT)

    DPI = 'x1'
    THEMES = []
    APP_THEME = 'default'
    IS_GENERATE_INC_RES = True
    IS_GENERATE_INC_BITMAP = True
    TOOLS_ROOT = common.join_path(AWTK_ROOT, 'bin')
    AWTK_ROOT = common.join_path(APP_ROOT, AWTK_ROOT)
    ASSETS_ROOT = common.join_path(APP_ROOT, 'design')
    OUTPUT_ROOT = common.join_path(APP_ROOT, 'res/assets')

    use_default_theme_config()

    ASSET_C = common.join_path(OUTPUT_ROOT, '../assets.inc')
    if action == 'json':
        ASSET_C = common.join_path(APP_ROOT, 'assets_web.js')

    if not is_dependencies_ok():
        print('For details, please read scripts/README.md.')
    elif len(THEMES) == 0:
        print('Not found theme.')
        print('For details, please read scripts/README.md.')
    else:
        common.init(AWTK_ROOT, ASSETS_ROOT, THEMES, ASSET_C, OUTPUT_ROOT)
        common.set_tools_dir(TOOLS_ROOT)
        common.set_dpi(DPI)
        common.set_app_theme(APP_THEME)
        common.set_enable_generate_inc_res(IS_GENERATE_INC_RES)
        common.set_enable_generate_inc_bitmap(IS_GENERATE_INC_BITMAP)
        common.set_is_excluded_file_handler(is_excluded_file_handler)
        on_generate_res_event()
        common.update_res()

        if isinstance(THEMES[0], dict):
            if action != 'clean' and action != 'web' and action != 'json' and action != 'pinyin':
                common.gen_res_c(False)
import os
import sys 
import update_res_common as common

APP_ROOT=os.getcwd()
if APP_ROOT.endswith('scripts'):
  APP_ROOT=os.path.dirname(APP_ROOT)

os.chdir(APP_ROOT);
AWTK_ROOT=APP_ROOT
ASSETS_ROOT=common.joinPath(APP_ROOT, 'demos/assets')
ASSET_C=common.joinPath(APP_ROOT, 'demos/assets.c')

common.init(AWTK_ROOT, ASSETS_ROOT, ASSET_C);

def buildTools():
  os.system('scons '+common.toExe('bsvggen'))
  os.system('scons '+common.toExe('strgen'))
  os.system('scons '+common.toExe('resgen'))
  os.system('scons '+common.toExe('themegen'))
  os.system('scons '+common.toExe('imagegen'))
  os.system('scons '+common.toExe('fontgen'))
  os.system('scons '+common.toExe('xml_to_ui'))

def run():
  common.updateRes()

if sys.argv[1]=='all':
  buildTools()

run()
Esempio n. 5
0
#!/usr/bin/python

import os
import sys

# try add AWTK_ROOT/scripts to system environment
AWTK_ROOT = '../awtk'
if os.path.exists(AWTK_ROOT):
    sys.path.append(AWTK_ROOT + '/scripts')
elif not os.path.isabs(AWTK_ROOT):
    AWTK_ROOT = '../' + AWTK_ROOT
    if os.path.exists(AWTK_ROOT):
        sys.path.append(AWTK_ROOT + '/scripts')

# AWTK_ROOT/scripts/update_res_common.py
import update_res_common as common

APP_ROOT = common.getcwd()
if APP_ROOT.endswith('scripts'):
    APP_ROOT = os.path.dirname(APP_ROOT)

os.chdir(APP_ROOT)

AWTK_ROOT = common.join_path(APP_ROOT, AWTK_ROOT)
ASSETS_ROOT = common.join_path(APP_ROOT, 'assets')
ASSET_C = common.join_path(APP_ROOT, 'demos/assets.c')
THEMES = ['default']

common.init(AWTK_ROOT, ASSETS_ROOT, THEMES, ASSET_C)
common.update_res()
Esempio n. 6
0
import os
import sys 
AWTK_ROOT='$AWTK_ROOT'
sys.path.append(os.path.join(AWTK_ROOT, "scripts"))
import update_res_common as common

APP_ROOT=os.getcwd()

ASSETS_ROOT=common.joinPath(APP_ROOT, 'assets')
ASSET_C=common.joinPath(APP_ROOT, 'assets.c')

common.init(AWTK_ROOT, ASSETS_ROOT, 'default', ASSET_C);

common.updateRes()
Esempio n. 7
0
#!/usr/bin/python

import os
import sys
import update_res_common as common

APP_ROOT = os.getcwd()
if APP_ROOT.endswith('scripts'):
    APP_ROOT = os.path.dirname(APP_ROOT)

os.chdir(APP_ROOT)
AWTK_ROOT = APP_ROOT
ASSETS_ROOT = common.joinPath(APP_ROOT, 'demo_qr/assets')
ASSET_C = common.joinPath(APP_ROOT, 'demo_qr/assets.c')

common.init(AWTK_ROOT + '/awtk', ASSETS_ROOT, ASSET_C)


def buildTools():
    os.system('scons ' + common.toExe('resgen'))
    os.system('scons ' + common.toExe('themegen'))
    os.system('scons ' + common.toExe('imagegen'))
    os.system('scons ' + common.toExe('fontgen'))
    os.system('scons ' + common.toExe('xml_to_ui'))


def run():
    common.updateRes()


# if sys.argv[1]=='all':
#!/usr/bin/python

import os
import sys 
import update_res_common as common

APP_ROOT=os.getcwd()
if APP_ROOT.endswith('scripts'):
  APP_ROOT=os.path.dirname(APP_ROOT)

os.chdir(APP_ROOT);
AWTK_ROOT=APP_ROOT
ASSETS_ROOT=common.joinPath(APP_ROOT, 'src/assets')
ASSET_C=common.joinPath(APP_ROOT, 'src/assets.c')

common.init(AWTK_ROOT + '../../awtk', ASSETS_ROOT, ASSET_C);

def buildTools():
  os.system('scons '+common.toExe('resgen'))
  os.system('scons '+common.toExe('themegen'))
  os.system('scons '+common.toExe('imagegen'))
  os.system('scons '+common.toExe('fontgen'))
  os.system('scons '+common.toExe('xml_to_ui'))

def run():
  common.updateRes()

if sys.argv[1]=='all':
  buildTools()

run()
Esempio n. 9
0
#!/usr/bin/python

import os
import sys 
sys.path.append("../awtk/scripts") 
sys.path.append("../../awtk/scripts") 
 
import update_res_common as common

APP_ROOT=os.getcwd()
if APP_ROOT.endswith('scripts'):
  APP_ROOT=os.path.dirname(APP_ROOT)

os.chdir(APP_ROOT);
AWTK_ROOT=common.joinPath(APP_ROOT, '../awtk');
ASSETS_ROOT=common.joinPath(APP_ROOT, 'assets')
ASSET_C=common.joinPath(APP_ROOT, 'src/assets.c')
themes = ['default']

for theme in themes:
    print('========================='+theme+' begin =========================')
    common.init(AWTK_ROOT, ASSETS_ROOT, theme, ASSET_C)
    common.updateRes()
    print('========================='+theme+' end =========================\n')
common.genAssetC(themes, ASSET_C)
Esempio n. 10
0
def run():
    common.init(AWTK_ROOT, ASSETS_ROOT, THEMES, ASSET_C)
    common.set_is_excluded_file_handler(is_excluded_file)
    common.update_res()
Esempio n. 11
0
AWTK_ROOT = common.join_path(APP_ROOT, AWTK_ROOT)
ASSETS_ROOT = common.join_path(APP_ROOT, 'design')
ASSET_C = common.join_path(APP_ROOT, 'res/assets.inc')
OUTPUT_ROOT = common.join_path(APP_ROOT, 'res/assets')
DPI = 'x1'
THEMES = []
IS_GENERATE_INC_RES = True
IS_GENERATE_INC_BITMAP = True
APP_THEME = 'default'

use_default_theme_config()

if not is_dependencies_ok():
    print('For details, please read scripts/README.md.')
elif len(THEMES) == 0:
    print('Not found theme.')
    print('For details, please read scripts/README.md.')
else:
    common.init(AWTK_ROOT, ASSETS_ROOT, THEMES, ASSET_C, OUTPUT_ROOT)
    common.set_tools_dir(TOOLS_ROOT)
    common.set_dpi(DPI)
    common.set_app_theme(APP_THEME)
    common.set_enable_generate_inc_res(IS_GENERATE_INC_RES)
    common.set_enable_generate_inc_bitmap(IS_GENERATE_INC_BITMAP)
    common.update_res()

    if isinstance(THEMES[0], dict):
        action = common.get_action()
        if action != 'clean' and action != 'web' and action != 'json' and action != 'pinyin':
            common.gen_res_c(False)