lsst.ip.diffim
g432e39061a+6eecc635cf
Loading...
Searching...
No Matches
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
14
15
def
to_string
(self):
16
return
"{id=%d (%d, %d)}"
% (self.
val
[
"id"
], self.
val
[
"col"
], self.
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.__init__
__init__(self, val)
Definition
printers.py:12
lsst.gdb.ip.diffim.printers.CRPixelPrinter.to_string
to_string(self)
Definition
printers.py:15
lsst.gdb.ip.diffim.printers.CRPixelPrinter.val
val
Definition
printers.py:13
lsst.gdb.ip.diffim.printers.build_ip_diffim_dictionary
build_ip_diffim_dictionary()
Definition
printers.py:29
Generated on Sat Jul 15 2023 09:28:57 for lsst.ip.diffim by
1.9.7