comparison MoinMoin/macro/__init__.py @ 2546:56dbfbde79fe

better error checking in parameter parser, no more TypeError
author Johannes Berg <johannes AT sipsolutions DOT net>
date Mon, 23 Jul 2007 19:37:36 +0200
parents 5477d7f5ad64
children fb88a3706761
comparison
equal deleted inserted replaced
2545:3ef21e54f940 2546:56dbfbde79fe
99 except (TypeError, ValueError), e: 99 except (TypeError, ValueError), e:
100 return self.format_error(e) 100 return self.format_error(e)
101 101
102 def format_error(self, err): 102 def format_error(self, err):
103 """ format an error object for output instead of normal macro output """ 103 """ format an error object for output instead of normal macro output """
104 return self.formatter.text(u'[[%s: %s]]' % (self.name, unicode(err))) 104 return self.formatter.text(u'[[%s: %s]]' % (self.name, err.args[0]))
105 105
106 def execute(self, macro_name, args): 106 def execute(self, macro_name, args):
107 """ Get and execute a macro 107 """ Get and execute a macro
108 108
109 Try to get a plugin macro, or a builtin macro or a language 109 Try to get a plugin macro, or a builtin macro or a language