{ "info": { "author": "Juraj Onuska", "author_email": "jurajonuska@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "KRT\r\n===\r\n\r\n**Simple, small, interactive, console-based Python debugger.**\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\n- Cross-platform\r\n- Django compatibile\r\n\r\n**KRT** inherits from basic python debugger (called ``bdb``). The main\r\nreason behind development of package was need of user interface during\r\npython script debugging in console (or when graphical interface is not\r\navailable). Although ``pdb`` have the same (and propbably much more)\r\nfunctionality, I found it not so \u201cuser friendly\u201d.\r\n\r\n**Installation**\r\n~~~~~~~~~~~~~~~~\r\n\r\nInstall using ``pip``.\r\n\r\n.. code::\r\n\r\n pip install krt\r\n\r\n**Basic script debugging**\r\n--------------------------\r\n\r\n.. code::\r\n\r\n python krt.py script.py\r\n # or\r\n python -m krt script.py\r\n\r\n**Initializing debugger during program execution**\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\nThis method of initialization allows initialization at specific line.\r\n\r\n.. code:: python\r\n\r\n import krt\r\n\r\n def func(_something, _nothing):\r\n local_var = [1, 2, 3, 4]\r\n # now, initialize krt\r\n krt.trace() \r\n anything = _somethins + _nothing\r\n return anything\r\n\r\nInitializing **krt** via **decorator**. This method will initialize\r\n**krt** at 1st line of decorated method or function.\r\n\r\n.. code:: python\r\n\r\n import krt\r\n\r\n # initialize krt\r\n @krt.debug()\r\n def func(_something, _nothing):\r\n local_var = [1, 2, 3, 4]\r\n anything = _somethins + _nothing\r\n return anything\r\n\r\n**Django usage**\r\n----------------\r\n\r\nOne can use methods mentioned above, but method below allows **krt**\r\ntriggering only if run with pre-defined django command.\r\n\r\nSetting up django command\r\n'''''''''''''''''''''''''\r\n\r\n1. Inside django applicaiton directory, create directory called\r\n ``management``, inside which create directory ``commands``. Following\r\n path, must exists\r\n ``django_project/application/management/commands/``.\r\n2. Create ``__init__.py`` inside ``management`` and ``commands``\r\n directories.\r\n3. Inside directory ``commands``, create file ``.py``, where\r\n ```` will be used with ``manage.py``. Let\u2019s say that we\u2019ve\r\n used ``krt_runserver.py``.\r\n4. Insert into created file: \\`\\`\\`python from\r\n django.core.management.base import BaseCommand from\r\n django.core.management.commands import runserver\r\n\r\n\r\n.. code::\r\n\r\n class Command(runserver.Command): \r\n help = \u201cSets trigger for krt decorators\u201d\r\n\r\n def __init__(self, *args, **kwargs):\r\n from django.conf import settings\r\n setattr(settings, 'krt_django_decorator_trigger_flag', True)\r\n super(Command, self).__init__(*args, **kwargs)\r\n\r\n\r\nUse decorator inside view\r\n'''''''''''''''''''''''''\r\n\r\nDecorator, when used in django project, requires setting of keyword\r\nargument ``django`` to ``True``. If the ``django`` argument is omitted,\r\nthe debugger will be **always initialized**!\r\n\r\n.. code:: python\r\n\r\n from django.http import HttpResponse\r\n from krttest.krt import debug\r\n\r\n @debug(django=True)\r\n def index(request):\r\n return HttpResponse(\"I'm ok.\")\r\n\r\nNow, when the django server is run with created command, **KRT**\r\ndebugger is being initialized on 1st line of view, otherwise the\r\ndecorators are being ignored.\r\n\r\n.. code::\r\n\r\n python ./manage.py krt_runserver", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/nthe/krt/archive/master.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nthe/krt", "keywords": "python,debug,debugger,debugging,console,terminal", "license": "copyright (c) 2016 Juraj Onuska http://github.com/nthe\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\n of this software and associated documentation files (the \"Software\"), to deal\r\n in the Software without restriction, including without limitation the rights to use,\r\n copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the\r\n Software, and to permit persons to whom the Software is furnished to do so,\r\n subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all \r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, \r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES \r\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \r\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\r\n HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r\n IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF\r\n OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS \r\nIN THE SOFTWARE.", "maintainer": "", "maintainer_email": "", "name": "krt", "package_url": "https://pypi.org/project/krt/", "platform": "Linux,MacOS,Windows", "project_url": "https://pypi.org/project/krt/", "project_urls": { "Download": "https://github.com/nthe/krt/archive/master.zip", "Homepage": "https://github.com/nthe/krt" }, "release_url": "https://pypi.org/project/krt/0.2.3/", "requires_dist": null, "requires_python": null, "summary": "Simple, small, interactive, console-based debugger.", "version": "0.2.3" }, "last_serial": 2348156, "releases": { "0.1": [], "0.2": [ { "comment_text": "", "digests": { "md5": "b25946e4d3138dd1356d662a5123440f", "sha256": "9e34b1455738962d85f9ce2972ea311c6f7d0c62a6d65a7fe7775c7a8620b131" }, "downloads": -1, "filename": "krt-0.2.tar.gz", "has_sig": false, "md5_digest": "b25946e4d3138dd1356d662a5123440f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6062, "upload_time": "2016-09-16T12:25:54", "url": "https://files.pythonhosted.org/packages/ae/d9/f8116c227ebdc13ccf8e9f25541282bc04f1a70d83da597082f18fa77ca6/krt-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "1fb3715610db2c296af406bc31aba54f", "sha256": "2376845c18c616628f02ca21968da2e0046f2d681bcf06aade9ba54a9cf88a75" }, "downloads": -1, "filename": "krt-0.2.1.tar.gz", "has_sig": false, "md5_digest": "1fb3715610db2c296af406bc31aba54f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6091, "upload_time": "2016-09-16T16:15:35", "url": "https://files.pythonhosted.org/packages/0f/3e/81b37b43e30e4f5d6e741d6af68d124b8a8227136d494dba094102826010/krt-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "51d3d480ebac71dc2537c5649c58ca11", "sha256": "4434d710fcbe9df0b69474ecbcb1bb4371a356cc8c1723583da1bb17ccccc089" }, "downloads": -1, "filename": "krt-0.2.2.tar.gz", "has_sig": false, "md5_digest": "51d3d480ebac71dc2537c5649c58ca11", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6184, "upload_time": "2016-09-17T16:32:50", "url": "https://files.pythonhosted.org/packages/39/14/1c001e3fa4acff3275b1140c80466e09eb3dca9570a7041f003fc47d5c52/krt-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "5d526e654812da23f63055fa7cd5680c", "sha256": "999e379d5d56e65c08e7b787782080815c5d5a9e1c662727e86d9275932aedcc" }, "downloads": -1, "filename": "krt-0.2.3.tar.gz", "has_sig": false, "md5_digest": "5d526e654812da23f63055fa7cd5680c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6139, "upload_time": "2016-09-17T16:36:12", "url": "https://files.pythonhosted.org/packages/97/ce/d9dfa76801ff28f07e9f933d646a834db70432afb449523e38d977e263c1/krt-0.2.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5d526e654812da23f63055fa7cd5680c", "sha256": "999e379d5d56e65c08e7b787782080815c5d5a9e1c662727e86d9275932aedcc" }, "downloads": -1, "filename": "krt-0.2.3.tar.gz", "has_sig": false, "md5_digest": "5d526e654812da23f63055fa7cd5680c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6139, "upload_time": "2016-09-17T16:36:12", "url": "https://files.pythonhosted.org/packages/97/ce/d9dfa76801ff28f07e9f933d646a834db70432afb449523e38d977e263c1/krt-0.2.3.tar.gz" } ] }