Changes between Version 3 and Version 4 of PythonGuidelines


Ignore:
Timestamp:
Mar 25, 2010 3:30:02 AM (14 years ago)
Author:
Chris Jerdonek
Comment:

Added Basics and Code Structure sub-sections

Legend:

Unmodified
Added
Removed
Modified
  • PythonGuidelines

    v3 v4  
    33Here is an overview of WebKit's use of Python.
    44
     5== Basics ==
     6
     7 * Most of WebKit's Python scripts require Python 2.5 to run.
     8 * Informally, we try to follow [http://www.python.org/dev/peps/pep-0008/ PEP8].  Eventually we may make this official.
     9 * [http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/test-webkitpy Scripts/test-webkitpy] unit tests the Python code.
     10
     11== Code Structure ==
     12
    513 * Most of the Python code is in [http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy WebKitTools/Scripts/webkitpy].
    6  * [http://trac.webkit.org/browser/trunk/WebKitTools/Scripts WebKitTools/Scripts] also contains some Python code in the form of end-user scripts.  Generally, we try to keep as much of the code in webkitpy as possible since this allows the code to be organized more nicely, for unit tests to be in companion files, etc.
     14 * [http://trac.webkit.org/browser/trunk/WebKitTools/Scripts WebKitTools/Scripts] also contains end-user Python scripts (which usually import from webkitpy).
     15 * Generally, we try to keep as much of the Python code in webkitpy as possible since this allows the code to be organized more nicely (for unit tests to be in companion files, etc).
    716 * Unit test files are in correspondence with modules.  For example, if module.py is the name of a module, its unit test file would be module_unittest.py and would lie in the same directory.
    8  * Informally, we try to follow [http://www.python.org/dev/peps/pep-0008/ PEP8].
    9  * We put all third-party Python code in [http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy webkitpy/thirdparty].
    10  * [http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/test-webkitpy Scripts/test-webkitpy] unit tests the Python code.
    11  * Most of WebKit's Python scripts require Python 2.5 to run.
     17 * The root-level folders in webkitpy/ generally correspond to end-user scripts in WebKitTools/Scripts.  For example--
     18  * check-webkit-style -> webkitpy/style/
     19  * new-run-webkit-tests -> webkitpy/layout_tests/
     20  * webkit-patch -> webkit/tool/
     21 * Exceptions to the rule above are--
     22  * webkitpy/common/: code shared by multiple root folders
     23  * webkitpy/python24/: code that needs to work under Python 2.4 (currently just the version-checking code)
     24  * [http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy webkitpy/thirdparty/]: all third-party code in webkitpy
    1225
    1326== Installing a new version of Python ==