lsst.ip.diffim
22.0.1-19-gb93eaa13+5fd7b36ef7
python
lsst
gdb
ip
diffim
printers.py
Go to the documentation of this file.
1
2
import
gdb
3
import
sys
4
5
try
:
6
import
gdb.printing
7
8
# example from meas_alg
9
class
CRPixelPrinter
(object):
10
"Print a CRPixel"
11
12
def
__init__
(self, val):
13
self.
val
val = val
14
15
def
to_string
(self):
16
return
"{id=%d (%d, %d)}"
% (self.
val
val[
"id"
], self.
val
val[
"col"
], self.
val
val[
"row"
])
17
18
printers = []
19
20
def
register
(obj):
21
"Register my pretty-printers with objfile Obj."
22
23
if
obj
is
None
:
24
obj = gdb
25
26
for
p
in
printers:
27
gdb.printing.register_pretty_printer(obj, p)
28
29
def
build_ip_diffim_dictionary
():
30
printer = gdb.printing.RegexpCollectionPrettyPrinter(
"ip_diffim"
)
31
32
# example from meas_alg
33
# printer.add_printer('lsst::meas::algorithms::CRPixel',
34
# '^lsst::meas::algorithms::CRPixel', CRPixelPrinter)
35
36
return
printer
37
38
printers.append(
build_ip_diffim_dictionary
())
39
40
except
ImportError:
41
def
register
(*args, **kwargs):
42
print(
"Your version of gdb is too old to load the ip.diffim python pretty printers"
, file=sys.stderr)
43
pass
44
45
pass
lsst.gdb.ip.diffim.printers.CRPixelPrinter
Definition:
printers.py:9
lsst.gdb.ip.diffim.printers.CRPixelPrinter.to_string
def to_string(self)
Definition:
printers.py:15
lsst.gdb.ip.diffim.printers.CRPixelPrinter.val
val
Definition:
printers.py:13
lsst.gdb.ip.diffim.printers.CRPixelPrinter.__init__
def __init__(self, val)
Definition:
printers.py:12
lsst.gdb.ip.diffim.printers.register
def register(obj)
Definition:
printers.py:20
lsst.gdb.ip.diffim.printers.build_ip_diffim_dictionary
def build_ip_diffim_dictionary()
Definition:
printers.py:29
Generated on Wed Oct 6 2021 01:30:38 for lsst.ip.diffim by
1.9.1