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 self.formatter.locals and item in self.frame.f_locals: 59 return self.frame.f_locals[item] 60 |
61 if item in self.dict: 62 return self.dict[item] 63 |
64 if self.formatter.globals and item in self.frame.f_globals: 65 return self.frame.f_globals[item] |
66 |
67 if item in __builtin__.__dict__: 68 return __builtin__.__dict__[item] 69 70 try: 71 item = int(item) 72 return self.args[item] 73 except ValueError: 74 pass --- 43 unchanged lines hidden (view full) --- 118 globals = True 119 locals = True 120 fix_newlines = True 121 def __init__(self, *args, **kwargs): 122 self._data = [] 123 self._dict = {} 124 self._indent_level = 0 125 self._indent_spaces = 4 |
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): --- 177 unchanged lines hidden --- |