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