• Home
  • Raw
  • Download

Lines Matching +full:p +full:- +full:state

1 # coding=utf-8
47 """Extract kernel-doc comments from the specified file"""
55 'no-identifiers': directives.unchanged,
61 env = self.state.document.settings.env
62 cmd = [env.config.kerneldoc_bin, '-rst', '-enable-lineno']
64 # Pass the version string to kernel-doc, as it needs to use a different
67 cmd += ['-sphinx-version', sphinx.__version__]
75 tab_width = self.options.get('tab-width', self.state.document.settings.tab_width)
83 cmd += ['-export']
86 cmd += ['-internal']
89 cmd += ['-function', str(self.options.get('doc'))]
94 cmd += ['-function', i]
96 cmd += ['-no-doc-sections']
98 if 'no-identifiers' in self.options:
99 no_identifiers = self.options.get('no-identifiers').split()
102 cmd += ['-nosymbol', i]
107 cmd += ['-export-file', f]
113 'calling kernel-doc \'%s\'' % (" ".join(cmd)))
115 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
116 out, err = p.communicate()
118 out, err = codecs.decode(out, 'utf-8'), codecs.decode(err, 'utf-8')
120 if p.returncode != 0:
124 … 'kernel-doc \'%s\' failed with return code %d' % (" ".join(cmd), p.returncode))
125 return [nodes.error(None, nodes.paragraph(text = "kernel-doc missing"))]
133 line_regex = re.compile(r"^\.\. LINENO ([0-9]+)$")
138 lineoffset = int(match.group(1)) - 1
151 kernellog.warn(env.app, 'kernel-doc \'%s\' processing failed with: %s' %
153 return [nodes.error(None, nodes.paragraph(text = "kernel-doc missing"))]
156 with switch_source_input(self.state, result):
157 self.state.nested_parse(result, 0, node, match_titles=1)
164 app.add_directive('kernel-doc', KernelDocDirective)