itAdd debug mode with ipython. - zs - Zeitungsschau rss to email converter Err gopher.r-36.net 70 hgit clone git://r-36.net/zs URL:git://r-36.net/zs gopher.r-36.net 70 1Log /scm/zs//log.gph gopher.r-36.net 70 1Files /scm/zs//files.gph gopher.r-36.net 70 1Refs /scm/zs//refs.gph gopher.r-36.net 70 1LICENSE /scm/zs//file/LICENSE.gph gopher.r-36.net 70 i--- Err gopher.r-36.net 70 1commit 01445b45c7a7c31d732339989a71c957a633bad6 /scm/zs//commit/01445b45c7a7c31d732339989a71c957a633bad6.gph gopher.r-36.net 70 1parent cc1e0defe58a83c1d59a31d72b7e8e7dec726883 /scm/zs//commit/cc1e0defe58a83c1d59a31d72b7e8e7dec726883.gph gopher.r-36.net 70 hAuthor: Christoph Lohmann <20h@r-36.net> URL:mailto:20h@r-36.net gopher.r-36.net 70 iDate: Sat, 10 Feb 2018 16:18:47 +0100 Err gopher.r-36.net 70 i Err gopher.r-36.net 70 iAdd debug mode with ipython. Err gopher.r-36.net 70 i Err gopher.r-36.net 70 iDiffstat: Err gopher.r-36.net 70 i zs | 13 +++++++++++++ Err gopher.r-36.net 70 i Err gopher.r-36.net 70 i1 file changed, 13 insertions(+), 0 deletions(-) Err gopher.r-36.net 70 i--- Err gopher.r-36.net 70 1diff --git a/zs b/zs /scm/zs//file/zs.gph gopher.r-36.net 70 it@@ -122,6 +122,16 @@ def run(db, selfeed=None, dryrun=False, onlychanges=False): Err gopher.r-36.net 70 i except smtplib.SMTPSenderRefused: Err gopher.r-36.net 70 i return Err gopher.r-36.net 70 i Err gopher.r-36.net 70 i+class ExceptionHook: Err gopher.r-36.net 70 i+ instance = None Err gopher.r-36.net 70 i+ Err gopher.r-36.net 70 i+ def __call__(self, *args, **kwargs): Err gopher.r-36.net 70 i+ if self.instance is None: Err gopher.r-36.net 70 i+ from IPython.core import ultratb Err gopher.r-36.net 70 i+ self.instance = ultratb.FormattedTB(mode='Verbose', Err gopher.r-36.net 70 i+ color_scheme='Linux', call_pdb=1) Err gopher.r-36.net 70 i+ return self.instance(*args, **kwargs) Err gopher.r-36.net 70 i+ Err gopher.r-36.net 70 i def usage(app): Err gopher.r-36.net 70 i app = os.path.basename(app) Err gopher.r-36.net 70 i sys.stderr.write("usage: %s [-dhs] cmd\n" % (app)) Err gopher.r-36.net 70 it@@ -151,6 +161,9 @@ def main(args): Err gopher.r-36.net 70 i if len(largs) < 1: Err gopher.r-36.net 70 i usage(args[0]) Err gopher.r-36.net 70 i Err gopher.r-36.net 70 i+ if dodebug == True: Err gopher.r-36.net 70 i+ sys.excepthook = ExceptionHook() Err gopher.r-36.net 70 i+ Err gopher.r-36.net 70 i if largs[0] == "testfeed": Err gopher.r-36.net 70 i if len(largs) < 2: Err gopher.r-36.net 70 i print("usage: %s testfeed URI\n" % \ Err gopher.r-36.net 70 .