config.py (2632:1bb2f91485ea) | config.py (2655:da93a2088efa) |
---|---|
1# Copyright (c) 2004-2005 The Regents of The University of Michigan 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 --- 780 unchanged lines hidden (view full) --- 789 790 def __getattr__(self, attr): 791 if self.ptype_str: 792 attr = self.ptype_str + '.' + attr 793 return ParamFactory(self.param_desc_class, attr) 794 795 # E.g., Param.Int(5, "number of widgets") 796 def __call__(self, *args, **kwargs): | 1# Copyright (c) 2004-2005 The Regents of The University of Michigan 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 --- 780 unchanged lines hidden (view full) --- 789 790 def __getattr__(self, attr): 791 if self.ptype_str: 792 attr = self.ptype_str + '.' + attr 793 return ParamFactory(self.param_desc_class, attr) 794 795 # E.g., Param.Int(5, "number of widgets") 796 def __call__(self, *args, **kwargs): |
797 caller_frame = inspect.stack()[1][0] | 797 caller_frame = inspect.currentframe().f_back |
798 ptype = None 799 try: 800 ptype = eval(self.ptype_str, 801 caller_frame.f_globals, caller_frame.f_locals) 802 if not isinstance(ptype, type): 803 raise TypeError, \ 804 "Param qualifier is not a type: %s" % ptype 805 except NameError: --- 518 unchanged lines hidden --- | 798 ptype = None 799 try: 800 ptype = eval(self.ptype_str, 801 caller_frame.f_globals, caller_frame.f_locals) 802 if not isinstance(ptype, type): 803 raise TypeError, \ 804 "Param qualifier is not a type: %s" % ptype 805 except NameError: --- 518 unchanged lines hidden --- |