From 544e9831e8529241669ab7c7fd530a02855b1ee0 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Wed, 11 Sep 2019 11:18:18 +0200 Subject: [PATCH] Use kconfiglib from $IDF_PATH/tools/kconfig_new --- tools/kconfig_new/confgen.py | 6 +++++- tools/kconfig_new/confserver.py | 7 ++++++- tools/kconfig_new/gen_kconfig_doc.py | 8 +++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/tools/kconfig_new/confgen.py b/tools/kconfig_new/confgen.py index 8255592f6..a68a9fe9b 100755 --- a/tools/kconfig_new/confgen.py +++ b/tools/kconfig_new/confgen.py @@ -29,8 +29,12 @@ import tempfile import json import gen_kconfig_doc -import kconfiglib import pprint +try: + from . import kconfiglib +except Exception: + sys.path.insert(0, os.path.dirname(os.path.realpath(__file__))) + import kconfiglib __version__ = "0.1" diff --git a/tools/kconfig_new/confserver.py b/tools/kconfig_new/confserver.py index cf63a598d..02fc1a71c 100755 --- a/tools/kconfig_new/confserver.py +++ b/tools/kconfig_new/confserver.py @@ -6,12 +6,17 @@ from __future__ import print_function import argparse import json -import kconfiglib import os import sys import confgen from confgen import FatalError, __version__ +try: + from . import kconfiglib +except Exception: + sys.path.insert(0, os.path.dirname(os.path.realpath(__file__))) + import kconfiglib + def main(): parser = argparse.ArgumentParser(description='confserver.py v%s - Config Generation Tool' % __version__, prog=os.path.basename(sys.argv[0])) diff --git a/tools/kconfig_new/gen_kconfig_doc.py b/tools/kconfig_new/gen_kconfig_doc.py index af73c886d..4edf1337a 100644 --- a/tools/kconfig_new/gen_kconfig_doc.py +++ b/tools/kconfig_new/gen_kconfig_doc.py @@ -23,7 +23,13 @@ from __future__ import print_function import os import re -import kconfiglib +import sys + +try: + from . import kconfiglib +except Exception: + sys.path.insert(0, os.path.dirname(os.path.realpath(__file__))) + import kconfiglib # Indentation to be used in the generated file INDENT = ' '