1
2
3
4
5
6
7
8
9
10
11
12
13 """
14 Generates error debug output
15 Visitor - Visits an error_handler composite
16 """
17
18
19
20
21 from errors import *
22 from error_visitor import error_visitor
23
25 """
26
27 """
29 """
30 @param fd: target file
31 @type fd: file descriptor
32 """
33 self.fd = fd
34 self.seg_count = 0
35 self.st_control_num = 0
36
38 """
39 @param errh: Error_handler instance
40 @type errh: L{error_handler.err_handler}
41 """
42 self.fd.write('%s\n' % errh.id)
43
44 - def visit_root_post(self, errh):
45 """
46 @param errh: Error_handler instance
47 @type errh: L{error_handler.err_handler}
48 """
49 pass
50
52 """
53 @param err_isa: ISA Loop error handler
54 @type err_isa: L{error_handler.err_isa}
55 """
56 self.fd.write('%s\n' % err_isa.id)
57 self.fd.write('-- ISA errors --\n')
58 for err in err_isa.errors:
59 self.fd.write(' %s %s\n' % err)
60 for ele in err_isa.elements:
61 self.fd.write(' %s %s\n' % (ele.id, ele.name))
62 print ele.parent
63 for err in ele.errors:
64 self.fd.write(' ERR %s %s (%s)\n' % err)
65
66 - def visit_isa_post(self, err_isa):
67 """
68 @param err_isa: ISA Loop error handler
69 @type err_isa: L{error_handler.err_isa}
70 """
71 pass
72
74 """
75 @param err_gs: GS Loop error handler
76 @type err_gs: L{error_handler.err_gs}
77 """
78 self.fd.write('%s\n' % err_gs.id)
79 self.fd.write('-- GS errors --\n')
80 for err in err_gs.errors:
81 self.fd.write(' %s %s\n' % err)
82 for ele in err_gs.elements:
83 self.fd.write(' %s %s\n' % (ele.id, ele.name))
84 for err in ele.errors:
85 self.fd.write(' ERR %s %s (%s)\n' % err)
86
87 - def visit_gs_post(self, err_gs):
88 """
89 @param err_gs: GS Loop error handler
90 @type err_gs: L{error_handler.err_gs}
91 """
92
93 self.fd.write('%s POST\n' % err_gs.id)
94
95
96
97 self.fd.write(' GS Ack Code%s\n' % err_gs.ack_code)
98 self.fd.write(' GS st_count_orig%s\n' % err_gs.st_count_orig)
99 self.fd.write(' GS st_count_recv%i\n' % err_gs.st_count_recv)
100 self.fd.write(' GS st_count_accept%i\n' % (err_gs.st_count_recv - err_gs.count_failed_st()))
101
103 """
104 @param err_st: ST Loop error handler
105 @type err_st: L{error_handler.err_st}
106 """
107 self.fd.write('%s\n' % err_st.id)
108 self.fd.write('-- ST errors --\n')
109 for err in err_st.errors:
110 self.fd.write(' ERR %s %s\n' % err)
111 for ele in err_st.elements:
112 self.fd.write(' ST Element: %s %s\n' % (ele.id, ele.name))
113 for err in ele.errors:
114 self.fd.write(' ERR %s %s (%s)\n' % err)
115
116 - def visit_st_post(self, err_st):
117 """
118 @param err_st: ST Loop error handler
119 @type err_st: L{error_handler.err_st}
120 """
121 pass
122
124 """
125 @param err_seg: Segment error handler
126 @type err_seg: L{error_handler.err_seg}
127 """
128
129 self.fd.write('%s %s %s %s\n' % (err_seg.id, err_seg.name, err_seg.get_cur_line(), err_seg.seg_id))
130 for (err_cde, err_str, err_value) in err_seg.errors:
131 self.fd.write(' ERR %s (%s) "%s" \n' % (err_cde, err_value, err_str))
132
133
134
136 """
137 Params: err_ele - error_ele instance
138 @param err_ele: Element error handler
139 @type err_ele: L{error_handler.err_ele}
140 """
141 self.fd.write(' %s %s\n' % (err_ele.id, err_ele.name))
142 for err in err_ele.errors:
143 self.fd.write(' ERR %s %s (%s)\n' % err)
144