1 from builtins
import object
29 """An object cognisant of debugging parameters appropriate for module "name"; any request for a value 30 will return False unless that value has been set, either in the module or as an attribute of this object. 35 display = lsstDebug.Info(__name__).display 36 will set display to False, unless display has been set with 37 lsstDebug.Info(__name__).display = True 39 Why is this interesting? Because you can replace lsstDebug.Info with your own version, e.g. 44 di = lsstDebug.getInfo(name) # N.b. lsstDebug.Info(name) would call us recursively 46 di.display = dict(repair=1, background=2, calibrate=3) 50 lsstDebug.Info = DebugInfo 54 self.__dict__[
"_dict"] = sys.modules[modname].__dict__
58 """Return the value of the variable "what" in self.__modname if set, else False""" 59 return self._dict.get(what,
False)
62 """Set the value of the variable "what" in self.__modname to value""" 63 self._dict[what] = value
71 Attempt to extract a frame for displaying a product called `name` from the `debugDisplay` variable. 73 Per the above, an instance of `Info` can return an arbitrary object (or nothing) as its `display` 74 attribute. It is convenient -- though not required -- that it be a dictionary mapping data products 75 to frame numbers, as shown in the `lsstDebug.Info` example. Given such a dictionary, this function 76 extracts and returns the appropriate frame number. If `debugDisplay` is not a collection, or if 77 `name` is not found within it, we return `None`. 79 @param[in] debugDisplay The contents of lsstDebug.Info(__name__).display. 80 @param[in] name The name of the data product to be displayed. 81 @returns A frame number 83 if hasattr(debugDisplay,
"__contains__")
and name
in debugDisplay:
84 return debugDisplay[name]
def __getattr__(self, what)
def __setattr__(self, what, value)
def __init__(self, modname)
def getDebugFrame(debugDisplay, name)