Deleted Added
sdiff udiff text old ( 6651:9f6b8815d045 ) new ( 6999:f226c098c393 )
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

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

50 return self.kwargs[item]
51
52 if item == '__file__':
53 return self.frame.f_code.co_filename
54
55 if item == '__line__':
56 return self.frame.f_lineno
57
58 if item in self.dict:
59 return self.dict[item]
60
61 if self.formatter.locals or self.formatter.globals:
62 if self.formatter.locals and item in self.frame.f_locals:
63 return self.frame.f_locals[item]
64
65 if self.formatter.globals and item in self.frame.f_globals:
66 return self.frame.f_globals[item]
67
68 if item in __builtin__.__dict__:
69 return __builtin__.__dict__[item]
70
71 try:
72 item = int(item)
73 return self.args[item]
74 except ValueError:
75 pass

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

119 globals = True
120 locals = True
121 fix_newlines = True
122 def __init__(self, *args, **kwargs):
123 self._data = []
124 self._dict = {}
125 self._indent_level = 0
126 self._indent_spaces = 4
127 self.globals = kwargs.pop('globals',type(self).globals)
128 self.locals = kwargs.pop('locals', type(self).locals)
129 self._fix_newlines = \
130 kwargs.pop('fix_newlines', type(self).fix_newlines)
131
132 if args:
133 self.__call__(args)
134
135 def indent(self):

--- 177 unchanged lines hidden ---