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
54 app.add_directive("kernel-abi", KernelCmd)
63 u"""KernelABI (``kernel-abi``) directive"""
82 cwd = path.dirname(doc.current_source)
83 cmd = "get_abi.pl rest --enable-lineno --dir "
87 cmd += " --rst-source"
89 srctree = path.abspath(os.environ["srctree"])
93 # extend PATH with $(srctree)/scripts
96 os.environ["PATH"]
99 shell_env["PATH"] = path_env
107 u"""Run command ``cmd`` and return it's stdout as unicode."""
112 , stdout = subprocess.PIPE
118 out, err = codecs.decode(out, 'utf-8'), codecs.decode(err, 'utf-8')
135 code_block = "\n\n.. code-block:: rst\n :linenos:\n"
140 line_regex = re.compile("^#define LINENO (\S+)\#([0-9]+)$")
160 ln = int(match.group(2)) - 1