Popular recipes tagged "meta:requires=pdb"http://code.activestate.com/recipes/tags/meta:requires=pdb/2012-03-14T15:12:39-07:00ActiveState Code RecipesRPDB (RobotPythonDebugger) -- a smarter way to debug robotframework tests (Python)
2012-03-14T15:12:39-07:00Daniel Cohnhttp://code.activestate.com/recipes/users/4172918/http://code.activestate.com/recipes/578073-rpdb-robotpythondebugger-a-smarter-way-to-debug-ro/
<p style="color: grey">
Python
recipe 578073
by <a href="/recipes/users/4172918/">Daniel Cohn</a>
(<a href="/recipes/tags/debugging/">debugging</a>, <a href="/recipes/tags/decorator/">decorator</a>, <a href="/recipes/tags/pdb/">pdb</a>, <a href="/recipes/tags/redirect/">redirect</a>, <a href="/recipes/tags/robot/">robot</a>, <a href="/recipes/tags/rpdb/">rpdb</a>, <a href="/recipes/tags/stdin/">stdin</a>, <a href="/recipes/tags/stdout/">stdout</a>).
</p>
<p>Robotframework (<a href="http://code.google.com/p/robotframework/" rel="nofollow">http://code.google.com/p/robotframework/</a>) is a tool used to run functional tests against a variety of targets. Tests are organized in the form of keyword tsv or html files, which map input parameters to keyword-argument methods in the test suite. Robot includes a fairly advanced logging mechanism, which is cool -- until you try to debug anything. Debugging is made difficult because robot steals stdin and stdout when it is run, which means bye-bye debugging in the terminal. rpdb solves this in a KISS simple way.</p>
Yielding out of nested routines by metaclass transformation (Python)
2006-11-17T04:16:35-08:00Bernhard Mulderhttp://code.activestate.com/recipes/users/189076/http://code.activestate.com/recipes/498270-yielding-out-of-nested-routines-by-metaclass-trans/
<p style="color: grey">
Python
recipe 498270
by <a href="/recipes/users/189076/">Bernhard Mulder</a>
(<a href="/recipes/tags/threads/">threads</a>).
Revision 2.
</p>
<p>Python 2.5 improved the support for generators, making it easier to
use coroutines. If you want to use coroutines, however, you can not
transfer control out of nested functions. You can eliminate this
restriction by systematically converting regular functions into
generator functions as demonstrated by this recipe <a href="http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/474127" rel="nofollow">http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/474127</a> The script below might
serve as a starting point to do this transformation automatically,
making the use of coroutines (tasklets, lightweight threads...) more
natural.</p>
Twisted / BitTorrent :: Client / Server (Python)
2005-10-30T01:24:39-08:00Jonathan Kolyerhttp://code.activestate.com/recipes/users/452108/http://code.activestate.com/recipes/440555-twisted-bittorrent-client-server/
<p style="color: grey">
Python
recipe 440555
by <a href="/recipes/users/452108/">Jonathan Kolyer</a>
(<a href="/recipes/tags/programs/">programs</a>).
Revision 3.
</p>
<p>Two modules that run a BitTorrent server, and uses Twisted as a client to coordinate control-message passing, and progress monitoring. The server can be run as a separate process, or as a thread within the client -- the same messages can be passed back and forth.</p>
<p>Control messages can cancel individual downloads (or the whole process), as well as pause downloading. Progress queries can be invoked through the client, which will ping the server, and report back each downloads' progress.</p>
Automatically start the debugger on an exception (Python)
2001-07-13T08:39:47-07:00Thomas Hellerhttp://code.activestate.com/recipes/users/98141/http://code.activestate.com/recipes/65287-automatically-start-the-debugger-on-an-exception/
<p style="color: grey">
Python
recipe 65287
by <a href="/recipes/users/98141/">Thomas Heller</a>
(<a href="/recipes/tags/debugging/">debugging</a>).
Revision 5.
</p>
<p>When Python runs a script and an uncatched exception is raised, a traceback is printed and the script is terminated.
Python2.1 has introduced sys.excepthook, which can be used to override the handling of uncaught exceptions. This allows to automatically start the debugger on an unexpected exception, even if python is not running in interactive mode.</p>