[tools] add menuconfig GUI by python.
This commit is contained in:
parent
fe556e6332
commit
244c1a810d
|
@ -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:
|
||||
|
|
3714
tools/kconfiglib.py
3714
tools/kconfiglib.py
File diff suppressed because it is too large
Load Diff
|
@ -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)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue