Use kconfiglib from $IDF_PATH/tools/kconfig_new

This commit is contained in:
Roland Dobai 2019-09-11 11:18:18 +02:00
parent d52b244ae8
commit a6fc9bf246
4 changed files with 23 additions and 6 deletions

View file

@ -30,7 +30,12 @@ import sys
import tempfile import tempfile
import gen_kconfig_doc import gen_kconfig_doc
import kconfiglib
try:
from . import kconfiglib
except Exception:
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
import kconfiglib
__version__ = "0.1" __version__ = "0.1"

View file

@ -7,12 +7,17 @@ from __future__ import print_function
import argparse import argparse
import confgen import confgen
import json import json
import kconfiglib
import os import os
import sys import sys
import tempfile import tempfile
from confgen import FatalError, __version__ from confgen import FatalError, __version__
try:
from . import kconfiglib
except Exception:
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
import kconfiglib
# Min/Max supported protocol versions # Min/Max supported protocol versions
MIN_PROTOCOL_VERSION = 1 MIN_PROTOCOL_VERSION = 1
MAX_PROTOCOL_VERSION = 2 MAX_PROTOCOL_VERSION = 2

View file

@ -21,8 +21,15 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from __future__ import print_function from __future__ import print_function
import os
import re 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 # Indentation to be used in the generated file
INDENT = ' ' INDENT = ' '

View file

@ -19,11 +19,11 @@ from pyparsing import Word, alphanums, printables, Combine, Literal, hexnums, qu
import sys import sys
try: try:
import kconfiglib from . import kconfiglib
except ImportError: except Exception:
parent_dir_name = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) parent_dir_name = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
kconfig_new_dir = os.path.abspath(parent_dir_name + "/kconfig_new") kconfig_new_dir = os.path.abspath(parent_dir_name + "/kconfig_new")
sys.path.append(kconfig_new_dir) sys.path.insert(0, kconfig_new_dir)
import kconfiglib import kconfiglib