{ "info": { "author": "Benji York", "author_email": "benji@zope.com", "bugtrack_url": null, "classifiers": [], "description": "zc.monitorpdb\n=============\n\nzc.montorpdb is a small plugin for the (very) lightweight zc.monitor\nsystem. It allows a user to telnet to a monitor port and invoke a\nPython debugger (PDB) prompt.\n\nTo use it, one must first register the command so zc.monitor is aware of\nit.\n\n >>> import zc.monitorpdb\n >>> import zope.component\n >>> import zc.monitor.interfaces\n >>> zope.component.provideUtility(zc.monitorpdb.command,\n ... zc.monitor.interfaces.IMonitorPlugin, 'pdb')\n\nSince zc.monitor is implemented with zc.ngi, we can use zc.ngi's testing\nhelpers.\n\n >>> import zc.ngi.testing\n >>> connection = zc.ngi.testing.TextConnection()\n >>> server = zc.monitor.Server(connection)\n\nIf we invoke the command, we'll get the appropriate prompt.\n\n >>> connection.test_input('pdb\\n')\n (Pdb)\n\nNow we can do normal pdb things like list the code being executed.\n\n >>> connection.test_input('l\\n')\n 34 global fakeout\n 35\n 36 fakeout = FakeStdout(connection.connection)\n 37 debugger = pdb.Pdb(stdin=None, stdout=fakeout)\n 38 debugger.reset()\n 39 -> debugger.setup(sys._getframe(), None)\n 40\n 41\n 42 def command(connection, *args):\n 43 global debugger\n 44 global fakeout\n (Pdb)\n\nAs well as go \"up\" in the function call stack.\n\n >>> connection.test_input('u\\n')\n > /graphted-storage/workspace/zc.monitorpdb/src/zc/monitorpdb/__init__.py(48)command()\n -> reset(connection)\n (Pdb)\n\nThere is a \"reset\" command that gives us a fresh debugger (just in case\nsomething bad happend to ours and we don't want to restart the host\nprocess). Here we go from the current location being one thing (the\nresult of the previous \"u\" command) to another.\n\n >>> connection.test_input('l\\n')\n 57 return zc.monitor.QUIT_MARKER\n 58 else:\n 59 debugger.onecmd(' '.join(args))\n 60\n 61 connection.write(debugger.prompt)\n 62 -> return zc.monitor.MORE_MARKER\n [EOF]\n (Pdb)\n >>> connection.test_input('reset\\n')\n (Pdb)\n >>> connection.test_input('l\\n')\n 34 global fakeout\n 35\n 36 fakeout = FakeStdout(connection.connection)\n 37 debugger = pdb.Pdb(stdin=None, stdout=fakeout)\n 38 debugger.reset()\n 39 -> debugger.setup(sys._getframe(), None)\n 40\n 41\n 42 def command(connection, *args):\n 43 global debugger\n 44 global fakeout\n (Pdb)\n\n\nSome features don't work, however.\n\n >>> connection.test_input('debug 1+1\\n')\n the \"debug\" command is not supported\n (Pdb)\n\nOnce we're done, we ask to be let go.\n\n >>> connection.test_input('quit\\n')\n -> CLOSE", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "ZPL 2.1", "maintainer": null, "maintainer_email": null, "name": "zc.monitorpdb", "package_url": "https://pypi.org/project/zc.monitorpdb/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/zc.monitorpdb/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/zc.monitorpdb/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "zc.monitor plugin to debug running processes", "version": "1.0.0" }, "last_serial": 802185, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "6fa47b2283cfe09d4ad9c9efbb3cf386", "sha256": "5ca84dd05e30cf8485c922526442cf701fee9e67349dd469efdd85040d9f6a55" }, "downloads": -1, "filename": "zc.monitorpdb-1.0.0.tar.gz", "has_sig": false, "md5_digest": "6fa47b2283cfe09d4ad9c9efbb3cf386", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3576, "upload_time": "2009-10-30T14:49:00", "url": "https://files.pythonhosted.org/packages/8f/e9/93db80c1bcdcf849e5aa0e6781c68ad85f4411416badf743593f26d80896/zc.monitorpdb-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6fa47b2283cfe09d4ad9c9efbb3cf386", "sha256": "5ca84dd05e30cf8485c922526442cf701fee9e67349dd469efdd85040d9f6a55" }, "downloads": -1, "filename": "zc.monitorpdb-1.0.0.tar.gz", "has_sig": false, "md5_digest": "6fa47b2283cfe09d4ad9c9efbb3cf386", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3576, "upload_time": "2009-10-30T14:49:00", "url": "https://files.pythonhosted.org/packages/8f/e9/93db80c1bcdcf849e5aa0e6781c68ad85f4411416badf743593f26d80896/zc.monitorpdb-1.0.0.tar.gz" } ] }