Commit 34a28245 authored by Jonathan Corbet's avatar Jonathan Corbet
Browse files

Merge branch 'python-modules' into docs-mw

scripts/lib was always a bit of an awkward place for Python libraries; give
them a proper home under tools/lib/python.  Put the modules from
tools/docs/lib there for good measure.

The second patch ties them into a single package namespace.  It would be
more aesthetically pleasing to add a kernel layer, so we could say:

  from kernel.kdoc import kdoc_parser

...and have the kernel-specific stuff clearly marked, but that means adding
an empty directory in the hierarchy, which isn't as pleasing.

There are some other "Python library" directories hidden in the kernel
tree; we may eventually want to encourage them to move as well.
parents f690e078 992a9df4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
[MASTER]
init-hook='import sys; sys.path += ["scripts/lib/kdoc", "scripts/lib/abi", "tools/docs/lib"]'
init-hook='import sys; sys.path += ["tools/lib/python"]'
+1 −1
Original line number Diff line number Diff line
@@ -115,6 +115,6 @@ dochelp:
	@echo  '  make PAPER={a4|letter} Specifies the paper size used for LaTeX/PDF output.'
	@echo
	@echo  '  make FONTS_CONF_DENY_VF={path} sets a deny list to block variable Noto CJK fonts'
	@echo  '  for PDF build. See tools/docs/lib/latex_fonts.py for more details'
	@echo  '  for PDF build. See tools/lib/python/kdoc/latex_fonts.py for more details'
	@echo
	@echo  '  Default location for the generated documents is Documentation/output'
+2 −2
Original line number Diff line number Diff line
@@ -43,9 +43,9 @@ from sphinx.util.docutils import switch_source_input
from sphinx.util import logging

srctree = os.path.abspath(os.environ["srctree"])
sys.path.insert(0, os.path.join(srctree, "scripts/lib/abi"))
sys.path.insert(0, os.path.join(srctree, "tools/lib/python"))

from abi_parser import AbiParser
from abi.abi_parser import AbiParser

__version__ = "1.0"

+2 −2
Original line number Diff line number Diff line
@@ -97,9 +97,9 @@ from docutils.parsers.rst.directives.body import CodeBlock, NumberLines
from sphinx.util import logging

srctree = os.path.abspath(os.environ["srctree"])
sys.path.insert(0, os.path.join(srctree, "tools/docs/lib"))
sys.path.insert(0, os.path.join(srctree, "tools/lib/python"))

from parse_data_structs import ParseDataStructs
from kdoc.parse_data_structs import ParseDataStructs

__version__ = "1.0"
logger = logging.getLogger(__name__)
+3 −3
Original line number Diff line number Diff line
@@ -42,10 +42,10 @@ from sphinx.util import logging
from pprint import pformat

srctree = os.path.abspath(os.environ["srctree"])
sys.path.insert(0, os.path.join(srctree, "scripts/lib/kdoc"))
sys.path.insert(0, os.path.join(srctree, "tools/lib/python"))

from kdoc_files import KernelFiles
from kdoc_output import RestFormat
from kdoc.kdoc_files import KernelFiles
from kdoc.kdoc_output import RestFormat

__version__  = '1.0'
kfiles = None
Loading