[PyWebMail-Checkins] webmail checker.py, 1.17, 1.18 checker_manage.py, 1.14, 1.15
Status: Beta
Brought to you by:
dubnerm
From: Michael D. <du...@us...> - 2008-03-03 19:22:35
|
Update of /cvsroot/pywebmail/webmail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13865 Modified Files: checker.py checker_manage.py Log Message: support test aliases Index: checker_manage.py =================================================================== RCS file: /cvsroot/pywebmail/webmail/checker_manage.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** checker_manage.py 2 Mar 2008 10:54:29 -0000 1.14 --- checker_manage.py 3 Mar 2008 19:22:30 -0000 1.15 *************** *** 521,524 **** --- 521,528 ---- if py_cfg.has_key('add_args'): checker += ' '+py_cfg['add_args'] + if self.tag_config.has_key('aliases'): + checker += ' -a '+self.tag_config['aliases'] + if py_cfg.has_key('aliases'): + checker += ' -a '+py_cfg['aliases'] checker += self.add_checker_arg executable = py_cfg['executable'] Index: checker.py =================================================================== RCS file: /cvsroot/pywebmail/webmail/checker.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** checker.py 2 Mar 2008 10:53:08 -0000 1.17 --- checker.py 3 Mar 2008 19:22:30 -0000 1.18 *************** *** 185,196 **** try: e = unicode(e) ! except (UnicodeEncodeError,UnicodeDecodeError): try: e = unicode(e,'utf-8') ! except (TypeError,UnicodeEncodeError,UnicodeDecodeError): e = str(e) try: e = unicode(e,'utf-8') ! except (UnicodeEncodeError,UnicodeDecodeError): pass if type(e) == type(u'') and self.parent.output_encoding is not None: --- 185,196 ---- try: e = unicode(e) ! except UnicodeError: try: e = unicode(e,'utf-8') ! except (TypeError,UnicodeError): e = str(e) try: e = unicode(e,'utf-8') ! except UnicodeError: pass if type(e) == type(u'') and self.parent.output_encoding is not None: *************** *** 695,698 **** --- 695,699 ---- def __init__(self, argv, progname=None): + self.aliases = {} self.tests = {} self.output_encoding = None *************** *** 718,722 **** def get_optdefs(self): ! return 'vqt:c:C:d:i:e:n:' def parse_optlist(self, optlist): --- 719,723 ---- def get_optdefs(self): ! return 'vqt:c:C:d:i:e:n:a:' def parse_optlist(self, optlist): *************** *** 730,733 **** --- 731,739 ---- self.parent.output_encoding = None if opt == '-c': self.config_file = optarg + if opt == '-a': + aliases = filter(None, map(lambda s:s.strip(), optarg.split(','))) + aliases = map(lambda s:s.split('=',1), aliases) + for k,v in aliases: + self.aliases[k] = v if opt == '-d': self.db_file = optarg if opt == '-i': self.config_id = optarg *************** *** 963,968 **** if self.tests.has_key(test_name): return self.tests[test_name] ! assert self.config.config.has_section('test_'+test_name), test_name ! test_info = webmail.utils.ConfigSection(self.config.config, 'test_'+test_name) return self.create_test(test_name, test_info) --- 969,977 ---- if self.tests.has_key(test_name): return self.tests[test_name] ! section_name = 'test_'+test_name ! if self.aliases.has_key(test_name): ! section_name = 'test_'+self.aliases[test_name] ! assert self.config.config.has_section(section_name), test_name ! test_info = webmail.utils.ConfigSection(self.config.config, section_name) return self.create_test(test_name, test_info) *************** *** 1018,1026 **** req_resolve(test_name) return map(lambda t:('run_test',t), l) ! if self.tests_done.has_key(test_name.lower()): log.info('Skipping %s (already done)', test_name) return 1 test = self.get_test(test_name) ! self.tests_done[test_name.lower()] = 1 test_thread = threading.Thread(None, test.perform) test_thread.setDaemon(0) --- 1027,1035 ---- req_resolve(test_name) return map(lambda t:('run_test',t), l) ! if self.tests_done.has_key(test_name): log.info('Skipping %s (already done)', test_name) return 1 test = self.get_test(test_name) ! self.tests_done[test_name] = 1 test_thread = threading.Thread(None, test.perform) test_thread.setDaemon(0) |