22 __all__ = (
"Info",
"getDebugFrame")
29 """An object cognisant of debugging parameters appropriate for module 32 Any request for a value will return False unless that value has 33 been set, either in the module or as an attribute of this object. 37 .. code-block:: python 41 display = lsstDebug.Info(__name__).display 43 will set display to False, unless display has been set with 45 .. code-block:: python 47 lsstDebug.Info(__name__).display = True 49 Why is this interesting? Because you can replace `lsstDebug.Info` with your 52 .. code-block:: python 57 # N.b. lsstDebug.Info(name) would call us recursively 58 di = lsstDebug.getInfo(name) 60 di.display = dict(repair=1, background=2, calibrate=3) 64 lsstDebug.Info = DebugInfo 73 self.__dict__[
"_dict"] = sys.modules[modname].__dict__
77 """Return the value of the variable "what" in ``self.__modname`` 79 return self._dict.get(what,
False)
82 """Set the value of the variable "what" in ``self.__modname`` 84 self._dict[what] = value
92 Attempt to extract a frame for displaying a product called ``name`` 93 from the ```debugDisplay`` variable. 95 Per the above, an instance of `Info` can return an arbitrary object 96 (or nothing) as its ``display`` attribute. It is convenient -- though not 97 required -- that it be a dictionary mapping data products to frame 98 numbers, as shown in the `lsstDebug.Info` example. Given such a dictionary, 99 this function extracts and returns the appropriate frame number. If 100 ``debugDisplay`` is not a collection, or if ``name`` is not found within 101 it, we return `None`. 105 debugDisplay : `object` 106 The contents of lsstDebug.Info(__name__).display. 108 The name of the data product to be displayed. 113 A frame number, or `None`. 115 if hasattr(debugDisplay,
"__contains__")
and name
in debugDisplay:
116 return debugDisplay[name]
def __getattr__(self, what)
def __setattr__(self, what, value)
def __init__(self, modname)
def getDebugFrame(debugDisplay, name)