LSSTApplications  17.0+10,17.0+51,17.0+88,18.0.0+10,18.0.0+15,18.0.0+34,18.0.0+4,18.0.0+6,18.0.0-2-ge43143a+6,18.1.0-1-g0001055+2,18.1.0-1-g0896a44+10,18.1.0-1-g1349e88+9,18.1.0-1-g2505f39+7,18.1.0-1-g380d4d4+9,18.1.0-1-g5e4b7ea+2,18.1.0-1-g7e8fceb,18.1.0-1-g85f8cd4+7,18.1.0-1-g9a6769a+3,18.1.0-1-ga1a4c1a+6,18.1.0-1-gc037db8+2,18.1.0-1-gd55f500+3,18.1.0-1-ge10677a+7,18.1.0-10-g73b8679e+12,18.1.0-12-gf30922b,18.1.0-13-g451e75588,18.1.0-13-gbfe7f7f,18.1.0-2-g31c43f9+7,18.1.0-2-g9c63283+9,18.1.0-2-gdf0b915+9,18.1.0-2-gf03bb23+2,18.1.0-3-g52aa583+3,18.1.0-3-g8f4a2b1+1,18.1.0-3-g9cb968e+8,18.1.0-4-g7bbbad0,18.1.0-5-g510c42a+8,18.1.0-5-ga46117f,18.1.0-5-gaeab27e+9,18.1.0-6-gdda7f3e+11,18.1.0-8-g4084bf03+1,w.2019.34
LSSTDataManagementBasePackage
printers.py
Go to the documentation of this file.
1 import gdb
2 import sys
3 
4 try:
5  import gdb.printing
6 
8  "Print a CRPixel"
9 
10  def __init__(self, val):
11  self.val = val
12 
13  def to_string(self):
14  return "{id=%d (%d, %d)}" % (self.val["id"], self.val["col"], self.val["row"])
15 
16  printers = []
17 
18  def register(obj):
19  "Register my pretty-printers with objfile Obj."
20 
21  if obj is None:
22  obj = gdb
23 
24  for p in printers:
25  gdb.printing.register_pretty_printer(obj, p)
26 
28  printer = gdb.printing.RegexpCollectionPrettyPrinter("meas_algorithms")
29 
30  printer.add_printer('lsst::meas::algorithms::CRPixel',
31  '^lsst::meas::algorithms::CRPixel', CRPixelPrinter)
32  return printer
33 
34  printers.append(build_meas_algorithms_dictionary())
35 
36 except ImportError as e:
37  def register(*args, exception=e, **kwargs):
38  print("Your version of gdb is too old to load the meas.algorithms python pretty printers: %s" %
39  (exception,), file=sys.stderr)
40  pass
41 
42  pass