{ "info": { "author": "Chuck Rhode", "author_email": "CRhode@LacusVeris.com", "bugtrack_url": null, "classifiers": [], "description": "This script reads Python code from standard input and writes a revised\r\nversion to standard output.\r\n\r\nAlternatively, it may be invoked with file names as arguments:\r\n\r\no python PythonTidy.py input output\r\n\r\nSuffice it to say that *input* defaults to \\'-\\', the standard input,\r\nand *output* defaults to \\'-\\', the standard output.\r\n\r\nIt means to encapsulate the wisdom revealed in:\r\n\r\no Rossum, Guido van, and Barry Warsaw. \"PEP 8: Style Guide for Python\r\nCode.\" 23 Mar. 2006. Python.org. 28 Nov. 2006\r\n.\r\n\r\nPython scripts are usually so good looking that no beautification is\r\nrequired. However, from time to time, it may be necessary to alter\r\nthe style to conform to changing standards. This script converts\r\nprograms in a consistent way. It abstracts the pretty presentation of\r\nthe symbolic code from the humdrum[1] process of writing it and\r\ngetting it to work.\r\n\r\nThis script assumes that the input Python code is well-formed and\r\nworks to begin with. It doesn\\'t check. If all goes well, the output\r\nPython code will work, too. Of course, you are advised to test it\r\nfully to be sure.\r\n\r\nThis script should be run only by python.2.5 (and perhaps higher) on\r\nscripts written for that version (and perhaps lower) because of its\r\nlimited knowledge of and expectations for the abstract syntax tree\r\nnode classes returned by the *compiler* module. It wouldn\\'t hurt\r\nmuch to try it from (and on) other versions, though, and it might\r\nactually work.\r\n\r\nSearch this script for \"Python Version Dependency.\"\r\n\r\nMost of the Python 2.5 test suite passes through PythonTidy.py\r\nunimpaired. I ran the Python regression tests for 2.5.2 which is the\r\nversion supported by Debian 5.0 \"Lenny.\"\r\n\r\nOn my system these tests fail before tidying:\r\n\r\no test_imageop\r\no test_pyclbr\r\no test_sys\r\n\r\n282 tests succeed after tidying with the default PythonTidy global\r\nsettings, but these tests fail:\r\n\r\n*test_grammar* exposes bug 6978 in the *compiler* module. Tuples are\r\nimmutable and hashable and thus suitable as dict indices. Whereas a\r\nsingleton tuple literal (x,) is valid as an index, the *compiler*\r\nmodule parses it as x when it appears.\r\n\r\n*test_dis* compares \"disassembled\" Python byte code to what is\r\nexpected. While byte code for a tidied script should be functionally\r\nequivalent to the untidied version, it will not necessarily be\r\nidentical.\r\n\r\n*test_trace* compares the line numbers in a functional trace of a\r\nrunning script with those expected. A statement in a tidied script\r\nwill generally have a line number slightly different from the same\r\nstatement in the untidied version.\r\n\r\n*test_doctest* is an extensive suite of tests of the *doctest* module,\r\nwhich itself is used to document test code within doc strings and at\r\nneed to compare instant results against those expected. One of the\r\ntests in *test_doctest* appears to require line numbers consistent\r\nwith expectations, but tidied scripts generally violate such\r\nconditions as explained above.\r\n\r\nThe more esoteric capabilities of PythonTidy.py had to be turned off\r\nto avoid corrupting the test-suite code. In practice, you\\'ll want to\r\nrun with PERSONAL = True to use all the functionality, and of course \r\nyou\\'ll have the good taste to find and patch all the glitches \r\nit introduces:\r\n\r\n[1] \"Humdrum: A low cart with three wheels, drawn by one horse.\" The\r\nCollaborative International Dictionary of English v.0.48.", "description_content_type": null, "docs_url": null, "download_url": "http://lacusveris.com/PythonTidy/PythonTidy-1.22.python", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "indentation; beautify", "license": "", "maintainer": "", "maintainer_email": "", "name": "PythonTidy", "package_url": "https://pypi.org/project/PythonTidy/", "platform": "", "project_url": "https://pypi.org/project/PythonTidy/", "project_urls": { "Download": "http://lacusveris.com/PythonTidy/PythonTidy-1.22.python" }, "release_url": "https://pypi.org/project/PythonTidy/1.22/", "requires_dist": null, "requires_python": null, "summary": "Cleans up, regularizes, and reformats the text of Python scripts.", "version": "1.22" }, "last_serial": 1590449, "releases": { "1.10": [], "1.11": [], "1.15": [], "1.16": [], "1.20": [], "1.22": [], "1.9": [] }, "urls": [] }