Lines Matching refs:self
7 def __init__(self, header=None, footer=None,
9 self.header = header
10 self.footer = footer
11 self.replaces = replaces
12 self.substitutions = {}
25 self.substitutions[cls, -1] = start
27 self.substitutions[cls, +1] = end
29 def __setstate__(self, state):
30 self.__init__(**state)
39 def __init__(self, options):
41 self.style = config[options.style]
43 self.input = file(options.input, 'rb')
45 self.input = sys.stdin
47 self.output = file(options.output, 'wb')
49 self.output = sys.stdout
51 def highlight(self):
52 input = self.input.read()
59 substitutions = self.style.substitutions
87 for substring, replacement in self.style.replaces:
94 if self.style.header:
95 self.output.write(self.style.header)
96 self.output.write(result.encode('utf-8'))
97 if self.style.footer:
98 self.output.write(self.style.footer)