提交 244c1a81 编写于 作者: armink_ztl's avatar armink_ztl

[tools] add menuconfig GUI by python.

上级 fe556e63
......@@ -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:
......
此差异已折叠。
......@@ -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)
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册