1 import sys, os, re, textwrap, traceback, linda
2 from linda import clparser
3 from linda.debug import dprint
4 from linda.mygettext import translation
5
8 self.check_type = self.tag = self.pkg_name = self.desc = ''
9 self.level = 0
10 self.exit_status = 0
11 if hasattr(self, 'init'):
12 getattr(self, 'init')()
13
15 self.check_type = type
16 self.level = level
17
19 for x in self.type:
20 if x.isupper():
21 self.type_char = x
22 break
23
25 if self.type_char == 'E' and self.exit_status == 2:
26 self.exit_status = 2
27
29 self.description = []
30 for desc in self.return_trans(self.tag):
31 self.description.append(desc)
32 self.description[1] = '\n'.join(map(lambda x: ' %s' % x, \
33 textwrap.wrap(self.description[1])))
34
41
42 - def print_out(self, tag, data, output_data, pkg_name):
43 self.tag = tag
44 self.data = data
45 self.output_data = output_data
46 self.pkg_name = pkg_name
47 self.type = self.output_data['Type']
48 self.type_single_char()
49 self.fetch_desc()
50 self.change_exit_status()
51 self.check_formatargs()
52 self.print_short()
53 if clparser['info']:
54 print_desc = 0
55 if self.output_data.has_key('seen'):
56 if not self.output_data['seen']:
57 print_desc = 1
58 else:
59 print_desc = 1
60 if print_desc:
61 self.output_data['seen'] = 1
62 self.print_long()
63
65 print self.description[1]
66
68 if self.output_data.has_key('Justification'):
69 print " Justification: %s" % self.output_data['Justification']
70
72 trans = translation('linda')
73 translations = []
74 for type in ('s', 'l'):
75 translations.append(unicode(trans.gettext('%s_%s' % (tag, type)), \
76 trans.charset(), 'replace').encode(trans.charset()))
77 return translations
78
100
103