Mercurial > public > mercurial-scm > hg-stable
diff mercurial/ui.py @ 2335:f0680b2d1d64
add ui.print_exc(), make all traceback printing central.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Mon, 22 May 2006 08:47:53 -0700 |
parents | 3dc6f2501dbc |
children | af81d8770620 |
line wrap: on
line diff
--- a/mercurial/ui.py Sun May 21 23:39:25 2006 -0700 +++ b/mercurial/ui.py Mon May 22 08:47:53 2006 -0700 @@ -9,7 +9,7 @@ from i18n import gettext as _ from demandload import * demandload(globals(), "errno getpass os re smtplib socket sys tempfile") -demandload(globals(), "templater util") +demandload(globals(), "templater traceback util") class ui(object): def __init__(self, verbose=False, debug=False, quiet=False, @@ -335,3 +335,11 @@ else: mail = sendmail(self, method) return mail + + def print_exc(self): + '''print exception traceback if traceback printing enabled. + only to call in exception handler. returns true if traceback + printed.''' + if self.traceback: + traceback.print_exc() + return self.traceback