[tools] add menuconfig GUI by python.

This commit is contained in:
armink 2019-07-13 14:45:05 +08:00
parent fe556e6332
commit 244c1a810d
4 changed files with 4628 additions and 1429 deletions

View File

@ -377,12 +377,17 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
dest = 'pyconfig',
action = 'store_true',
default = False,
help = 'make menuconfig for RT-Thread BSP')
help = 'Python ASCII menuconfig for RT-Thread BSP')
AddOption('--pyconfig-silent',
dest = 'pyconfig_silent',
action = 'store_true',
default = False,
help = 'Don`t show pyconfig window')
AddOption('--guiconfig',
dest = 'guiconfig',
action = 'store_true',
default = False,
help = 'Python GUI menuconfig for RT-Thread BSP')
if GetOption('pyconfig_silent'):
from menuconfig import pyconfig_silent
@ -394,6 +399,11 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
pyconfig(Rtt_Root)
exit(0)
elif GetOption('guiconfig'):
from menuconfig import guiconfig
guiconfig(Rtt_Root)
exit(0)
configfn = GetOption('useconfig')
if configfn:

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,7 @@
# Date Author Notes
# 2017-12-29 Bernard The first version
# 2018-07-31 weety Support pyconfig
# 2019-07-13 armink Support guiconfig
import os
import re
@ -269,3 +270,20 @@ def pyconfig_silent(RTT_ROOT):
# silent mode, force to make rtconfig.h
mk_rtconfig(fn)
# guiconfig for windows and linux
def guiconfig(RTT_ROOT):
import pyguiconfig
touch_env()
env_dir = get_env_dir()
os.environ['PKGS_ROOT'] = os.path.join(env_dir, 'packages')
fn = '.config'
sys.argv = ['guiconfig', 'Kconfig'];
pyguiconfig._main()
# silent mode, force to make rtconfig.h
mk_rtconfig(fn)

2313
tools/pyguiconfig.py Normal file

File diff suppressed because it is too large Load Diff