From cf80213e6b182e4e2cf5b56309949871f7a03d2b Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 18 Jan 2012 23:44:54 +0000 Subject: [PATCH] Added ipdb() function to help debug SCons scripts --- site_scons/buildutils.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/site_scons/buildutils.py b/site_scons/buildutils.py index 1301c2f42..4d5855884 100644 --- a/site_scons/buildutils.py +++ b/site_scons/buildutils.py @@ -401,3 +401,15 @@ def removeDirectory(name): if os.path.exists(name): print 'Removing directory "%s"' % name shutil.rmtree(name) + +def ipdb(): + """ + Break execution and drop into an IPython debug shell at the point + where this function is called. + """ + from IPython.core.debugger import Pdb + from IPython.core import ipapi + + ip = ipapi.get() + def_colors = ip.colors + Pdb(def_colors).set_trace(sys._getframe().f_back)