2020-06-14 08:59:23 +08:00
|
|
|
|
#!/usr/bin/python
|
2019-12-19 16:11:17 +08:00
|
|
|
|
|
|
|
|
|
import os
|
2020-06-14 08:59:23 +08:00
|
|
|
|
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
|
2019-12-19 16:11:17 +08:00
|
|
|
|
import update_res_common as common
|
|
|
|
|
|
2020-06-14 08:59:23 +08:00
|
|
|
|
|
|
|
|
|
APP_ROOT = common.getcwd()
|
2019-12-19 16:11:17 +08:00
|
|
|
|
if APP_ROOT.endswith('scripts'):
|
2020-06-14 08:59:23 +08:00
|
|
|
|
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, 'src/assets.c')
|
|
|
|
|
THEMES = ['default']
|
|
|
|
|
|
|
|
|
|
common.init(AWTK_ROOT, ASSETS_ROOT, THEMES, ASSET_C)
|
|
|
|
|
common.update_res()
|