• Home
  • Raw
  • Download

Lines Matching full:self

61     def run(self):  argument
62 env = self.state.document.settings.env
64 os.path.expandvars(self.arguments[0]))
68 raise self.severe(
70 % (self.name, path))
72 self.arguments[0] = path
76 #return super(KernelInclude, self).run() # won't work, see HINTs in _run()
77 return self._run()
79 def _run(self): argument
87 if not self.state.document.settings.file_insertion_enabled:
88 raise self.warning('"%s" directive disabled.' % self.name)
89 source = self.state_machine.input_lines.source(
90 self.lineno - self.state_machine.input_offset - 1)
92 path = directives.path(self.arguments[0])
94 path = os.path.join(self.standard_include_path, path[1:-1])
100 encoding = self.options.get(
101 'encoding', self.state.document.settings.input_encoding)
102 e_handler=self.state.document.settings.input_encoding_error_handler
103 tab_width = self.options.get(
104 'tab-width', self.state.document.settings.tab_width)
106 self.state.document.settings.record_dependencies.add(path)
111 raise self.severe('Problems with "%s" directive path:\n'
114 (self.name, SafeString(path)))
116 raise self.severe('Problems with "%s" directive path:\n%s.' %
117 (self.name, ErrorString(error)))
118 startline = self.options.get('start-line', None)
119 endline = self.options.get('end-line', None)
127 raise self.severe('Problem with "%s" directive:\n%s' %
128 (self.name, ErrorString(error)))
131 after_text = self.options.get('start-after', None)
136 raise self.severe('Problem with "start-after" option of "%s" '
137 'directive:\nText not found.' % self.name)
139 before_text = self.options.get('end-before', None)
144 raise self.severe('Problem with "end-before" option of "%s" '
145 'directive:\nText not found.' % self.name)
150 if 'literal' in self.options:
157 classes=self.options.get('class', []))
159 self.add_name(literal_block)
160 if 'number-lines' in self.options:
162 startline = int(self.options['number-lines'] or 1)
164 raise self.error(':number-lines: with non-integer '
179 if 'code' in self.options:
180 self.options['source'] = path
181 codeblock = CodeBlock(self.name,
182 [self.options.pop('code')], # arguments
183 self.options,
185 self.lineno,
186 self.content_offset,
187 self.block_text,
188 self.state,
189 self.state_machine)
191 self.state_machine.insert_input(include_lines, path)