Deleted Added
sdiff udiff text old ( 6999:f226c098c393 ) new ( 7672:d609cd948ca0 )
full compact
1# Copyright (c) 2006-2009 Nathan Binkert <nate@binkert.org>
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 117 unchanged lines hidden (view full) ---

126 self.globals = kwargs.pop('globals', type(self).globals)
127 self.locals = kwargs.pop('locals', type(self).locals)
128 self._fix_newlines = \
129 kwargs.pop('fix_newlines', type(self).fix_newlines)
130
131 if args:
132 self.__call__(args)
133
134 def indent(self):
135 self._indent_level += self._indent_spaces
136
137 def dedent(self):
138 assert self._indent_level >= self._indent_spaces
139 self._indent_level -= self._indent_spaces
140
141 def fix(self, status):
142 previous = self._fix_newlines
143 self._fix_newlines = status
144 return previous
145
146 def nofix(self):
147 previous = self._fix_newlines

--- 47 unchanged lines hidden (view full) ---

195 self._data.append(' ' * self._indent_level)
196 self._data.append(line)
197
198 if line or not initial_newline:
199 self._data.append('\n')
200
201 initial_newline = False
202
203 def insert_newline(self):
204 self._data.append('\n')
205
206 def __call__(self, format, *args, **kwargs):
207 frame = inspect.currentframe().f_back
208
209 l = lookup(self, frame, *args, **kwargs)
210 def convert(match):
211 ident = match.group('lone')
212 # check for a lone identifier
213 if ident:
214 indent = match.group('indent') # must be spaces

--- 97 unchanged lines hidden ---