• Home
  • Raw
  • Download

Lines Matching +full:self +full:-

1 # coding=utf-8
47 """Extract kernel-doc comments from the specified file"""
55 'no-identifiers': directives.unchanged,
60 def run(self): argument
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__]
69 filename = env.config.kerneldoc_srctree + '/' + self.arguments[0]
75 tab_width = self.options.get('tab-width', self.state.document.settings.tab_width)
78 if 'functions' in self.options:
79 self.options['identifiers'] = self.options.get('functions')
82 if 'export' in self.options:
83 cmd += ['-export']
84 export_file_patterns = str(self.options.get('export')).split()
85 elif 'internal' in self.options:
86 cmd += ['-internal']
87 export_file_patterns = str(self.options.get('internal')).split()
88 elif 'doc' in self.options:
89 cmd += ['-function', str(self.options.get('doc'))]
90 elif 'identifiers' in self.options:
91 identifiers = self.options.get('identifiers').split()
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)))
118 out, err = codecs.decode(out, 'utf-8'), codecs.decode(err, 'utf-8')
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
141 doc = str(env.srcdir) + "/" + env.docname + ":" + str(self.lineno)
146 self.do_parse(result, node)
151 kernellog.warn(env.app, 'kernel-doc \'%s\' processing failed with: %s' %
153 return [nodes.error(None, nodes.paragraph(text = "kernel-doc missing"))]
155 def do_parse(self, result, node): argument
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)