Now that we have tools/lib/python for our Python modules, turn them into proper packages with a single namespace so that everything can just use tools/lib/python in sys.path. No functional change.
Unified · Split
| @@ -43,9 +43,9 @@ from sphinx.util.docutils import switch_source_input · 42 unmodified lines | ||
| 43 | 43 | from sphinx.util import logging |
| 44 | 44 | |
| 45 | 45 | srctree = os.path.abspath(os.environ["srctree"]) |
| 46 | −sys.path.insert(0, os.path.join(srctree, "tools/lib/python/abi")) | |
| 46 | +sys.path.insert(0, os.path.join(srctree, "tools/lib/python")) | |
| 47 | 47 | |
| 48 | −from abi_parser import AbiParser | |
| 48 | +from abi.abi_parser import AbiParser | |
| 49 | 49 | |
| 50 | 50 | __version__ = "1.0" |
| 51 | 51 | |
| @@ -97,9 +97,9 @@ from docutils.parsers.rst.directives.body import CodeBlock, NumberLines · 96 unmodified lines | ||
| 97 | 97 | from sphinx.util import logging |
| 98 | 98 | |
| 99 | 99 | srctree = os.path.abspath(os.environ["srctree"]) |
| 100 | −sys.path.insert(0, os.path.join(srctree, "tools/lib/python/kdoc")) | |
| 100 | +sys.path.insert(0, os.path.join(srctree, "tools/lib/python")) | |
| 101 | 101 | |
| 102 | −from parse_data_structs import ParseDataStructs | |
| 102 | +from kdoc.parse_data_structs import ParseDataStructs | |
| 103 | 103 | |
| 104 | 104 | __version__ = "1.0" |
| 105 | 105 | logger = logging.getLogger(__name__) |
| @@ -42,10 +42,10 @@ from sphinx.util import logging · 41 unmodified lines | ||
| 42 | 42 | from pprint import pformat |
| 43 | 43 | |
| 44 | 44 | srctree = os.path.abspath(os.environ["srctree"]) |
| 45 | −sys.path.insert(0, os.path.join(srctree, "tools/lib/python/kdoc")) | |
| 45 | +sys.path.insert(0, os.path.join(srctree, "tools/lib/python")) | |
| 46 | 46 | |
| 47 | −from kdoc_files import KernelFiles | |
| 48 | −from kdoc_output import RestFormat | |
| 47 | +from kdoc.kdoc_files import KernelFiles | |
| 48 | +from kdoc.kdoc_output import RestFormat | |
| 49 | 49 | |
| 50 | 50 | __version__ = '1.0' |
| 51 | 51 | kfiles = None |
| @@ -111,7 +111,7 @@ import sys · 110 unmodified lines | ||
| 111 | 111 | |
| 112 | 112 | # Import Python modules |
| 113 | 113 | |
| 114 | −LIB_DIR = "../tools/lib/python/kdoc" | |
| 114 | +LIB_DIR = "../tools/lib/python" | |
| 115 | 115 | SRC_DIR = os.path.dirname(os.path.realpath(__file__)) |
| 116 | 116 | |
| 117 | 117 | sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR)) |
| @@ -292,8 +292,8 @@ def main(): · 174 unmodified lines | ||
| 292 | 292 | logger.warning("Python 3.7 or later is required for correct results") |
| 293 | 293 | |
| 294 | 294 | # Import kernel-doc libraries only after checking Python version |
| 295 | − from kdoc_files import KernelFiles # pylint: disable=C0415 | |
| 296 | − from kdoc_output import RestFormat, ManFormat # pylint: disable=C0415 | |
| 295 | + from kdoc.kdoc_files import KernelFiles # pylint: disable=C0415 | |
| 296 | + from kdoc.kdoc_output import RestFormat, ManFormat # pylint: disable=C0415 | |
| 297 | 297 | |
| 298 | 298 | if args.man: |
| 299 | 299 | out_style = ManFormat(modulename=args.modulename) |
| @@ -17,9 +17,9 @@ import sys · 16 unmodified lines | ||
| 17 | 17 | import os.path |
| 18 | 18 | |
| 19 | 19 | src_dir = os.path.dirname(os.path.realpath(__file__)) |
| 20 | −sys.path.insert(0, os.path.join(src_dir, '../lib/python/kdoc')) | |
| 20 | +sys.path.insert(0, os.path.join(src_dir, '../lib/python')) | |
| 21 | 21 | |
| 22 | −from latex_fonts import LatexFontChecker | |
| 22 | +from kdoc.latex_fonts import LatexFontChecker | |
| 23 | 23 | |
| 24 | 24 | checker = LatexFontChecker() |
| 25 | 25 | |
| @@ -14,15 +14,15 @@ import sys · 13 unmodified lines | ||
| 14 | 14 | |
| 15 | 15 | # Import Python modules |
| 16 | 16 | |
| 17 | −LIB_DIR = "../lib/python/abi" | |
| 17 | +LIB_DIR = "../lib/python" | |
| 18 | 18 | SRC_DIR = os.path.dirname(os.path.realpath(__file__)) |
| 19 | 19 | |
| 20 | 20 | sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR)) |
| 21 | 21 | |
| 22 | −from abi_parser import AbiParser # pylint: disable=C0413 | |
| 23 | −from abi_regex import AbiRegex # pylint: disable=C0413 | |
| 24 | −from helpers import ABI_DIR, DEBUG_HELP # pylint: disable=C0413 | |
| 25 | −from system_symbols import SystemSymbols # pylint: disable=C0413 | |
| 22 | +from abi.abi_parser import AbiParser # pylint: disable=C0413 | |
| 23 | +from abi.abi_regex import AbiRegex # pylint: disable=C0413 | |
| 24 | +from abi.helpers import ABI_DIR, DEBUG_HELP # pylint: disable=C0413 | |
| 25 | +from abi.system_symbols import SystemSymbols # pylint: disable=C0413 | |
| 26 | 26 | |
| 27 | 27 | # Command line classes |
| 28 | 28 | |
| @@ -28,9 +28,9 @@ import argparse, sys · 27 unmodified lines | ||
| 28 | 28 | import os.path |
| 29 | 29 | |
| 30 | 30 | src_dir = os.path.dirname(os.path.realpath(__file__)) |
| 31 | −sys.path.insert(0, os.path.join(src_dir, '../lib/python/kdoc')) | |
| 32 | −from parse_data_structs import ParseDataStructs | |
| 33 | −from enrich_formatter import EnrichFormatter | |
| 31 | +sys.path.insert(0, os.path.join(src_dir, '../lib/python')) | |
| 32 | +from kdoc.parse_data_structs import ParseDataStructs | |
| 33 | +from kdoc.enrich_formatter import EnrichFormatter | |
| 34 | 34 | |
| 35 | 35 | def main(): |
| 36 | 36 | """Main function""" |
| @@ -61,10 +61,9 @@ LIB_DIR = "../lib/python" · 60 unmodified lines | ||
| 61 | 61 | SRC_DIR = os.path.dirname(os.path.realpath(__file__)) |
| 62 | 62 | |
| 63 | 63 | sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR)) |
| 64 | −sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR + '/kdoc')) # temporary | |
| 65 | 64 | |
| 66 | −from python_version import PythonVersion | |
| 67 | −from latex_fonts import LatexFontChecker | |
| 65 | +from kdoc.python_version import PythonVersion | |
| 66 | +from kdoc.latex_fonts import LatexFontChecker | |
| 68 | 67 | from jobserver import JobserverExec # pylint: disable=C0413,C0411,E0401 |
| 69 | 68 | |
| 70 | 69 | # |
| @@ -35,8 +35,8 @@ from glob import glob · 34 unmodified lines | ||
| 35 | 35 | import os.path |
| 36 | 36 | |
| 37 | 37 | src_dir = os.path.dirname(os.path.realpath(__file__)) |
| 38 | −sys.path.insert(0, os.path.join(src_dir, '../lib/python/kdoc')) | |
| 39 | −from python_version import PythonVersion | |
| 38 | +sys.path.insert(0, os.path.join(src_dir, '../lib/python')) | |
| 39 | +from kdoc.python_version import PythonVersion | |
| 40 | 40 | |
| 41 | 41 | RECOMMENDED_VERSION = PythonVersion("3.4.3").version |
| 42 | 42 | MIN_PYTHON_VERSION = PythonVersion("3.7").version |
Empty file added.
Empty file added.
| @@ -17,7 +17,7 @@ from random import randrange, seed · 16 unmodified lines | ||
| 17 | 17 | |
| 18 | 18 | # Import Python modules |
| 19 | 19 | |
| 20 | −from helpers import AbiDebug, ABI_DIR | |
| 20 | +from abi.helpers import AbiDebug, ABI_DIR | |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | class AbiParser: |
| @@ -12,8 +12,8 @@ import sys · 11 unmodified lines | ||
| 12 | 12 | |
| 13 | 13 | from pprint import pformat |
| 14 | 14 | |
| 15 | −from abi_parser import AbiParser | |
| 16 | −from helpers import AbiDebug | |
| 15 | +from abi.abi_parser import AbiParser | |
| 16 | +from abi.helpers import AbiDebug | |
| 17 | 17 | |
| 18 | 18 | class AbiRegex(AbiParser): |
| 19 | 19 | """Extends AbiParser to search ABI nodes with regular expressions""" |
| @@ -15,7 +15,7 @@ from concurrent import futures · 14 unmodified lines | ||
| 15 | 15 | from datetime import datetime |
| 16 | 16 | from random import shuffle |
| 17 | 17 | |
| 18 | −from helpers import AbiDebug | |
| 18 | +from abi.helpers import AbiDebug | |
| 19 | 19 | |
| 20 | 20 | class SystemSymbols: |
| 21 | 21 | """Stores arguments for the class and initialize class vars""" |
Empty file added.
| @@ -13,8 +13,8 @@ import logging · 12 unmodified lines | ||
| 13 | 13 | import os |
| 14 | 14 | import re |
| 15 | 15 | |
| 16 | −from kdoc_parser import KernelDoc | |
| 17 | −from kdoc_output import OutputFormat | |
| 16 | +from kdoc.kdoc_parser import KernelDoc | |
| 17 | +from kdoc.kdoc_output import OutputFormat | |
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | class GlobSourceFiles: |
| @@ -19,8 +19,8 @@ import os · 18 unmodified lines | ||
| 19 | 19 | import re |
| 20 | 20 | from datetime import datetime |
| 21 | 21 | |
| 22 | −from kdoc_parser import KernelDoc, type_param | |
| 23 | −from kdoc_re import KernRe | |
| 22 | +from kdoc.kdoc_parser import KernelDoc, type_param | |
| 23 | +from kdoc.kdoc_re import KernRe | |
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | function_pointer = KernRe(r"([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)", cache=False) |
| @@ -16,8 +16,8 @@ import sys · 15 unmodified lines | ||
| 16 | 16 | import re |
| 17 | 17 | from pprint import pformat |
| 18 | 18 | |
| 19 | −from kdoc_re import NestedMatch, KernRe | |
| 20 | −from kdoc_item import KdocItem | |
| 19 | +from kdoc.kdoc_re import NestedMatch, KernRe | |
| 20 | +from kdoc.kdoc_item import KdocItem | |
| 21 | 21 | |
| 22 | 22 | # |
| 23 | 23 | # Regular expressions used to parse kernel-doc markups at KernelDoc class. |