Lines Matching +full:stdout +full:- +full:path
1 # -*- coding: utf-8; mode: python -*-
2 # coding=utf-8
3 # SPDX-License-Identifier: GPL-2.0
6 kernel-abi
9 Implementation of the ``kernel-abi`` reST-directive.
12 :copyright: Copyright (C) 2016-2020 Mauro Carvalho Chehab
13 :maintained-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
16 The ``kernel-abi`` (:py:class:`KernelCmd`) directive calls the
21 .. code-block:: rst
23 .. kernel-abi:: <ABI directory location>
30 Inserts a code-block with the *raw* reST. Sometimes it is helpful to see
42 from os import path
64 app.add_directive("kernel-abi", KernelCmd)
73 u"""KernelABI (``kernel-abi``) directive"""
92 cwd = path.dirname(doc.current_source)
93 cmd = "get_abi.pl rest --enable-lineno --dir "
97 cmd += " --rst-source"
99 srctree = path.abspath(os.environ["srctree"])
103 # extend PATH with $(srctree)/scripts
106 os.environ["PATH"]
109 shell_env["PATH"] = path_env
117 u"""Run command ``cmd`` and return it's stdout as unicode."""
122 , stdout = subprocess.PIPE
128 out, err = codecs.decode(out, 'utf-8'), codecs.decode(err, 'utf-8')
145 code_block = "\n\n.. code-block:: rst\n :linenos:\n"
150 line_regex = re.compile("^#define LINENO (\S+)\#([0-9]+)$")
170 ln = int(match.group(2)) - 1