Changes between Version 5 and Version 6 of PythonGuidelines


Ignore:
Timestamp:
Mar 25, 2010 7:14:20 AM (10 years ago)
Author:
Chris Jerdonek
Comment:

Added note on cleaning *.pyc files.

Legend:

Unmodified
Added
Removed
Modified
  • PythonGuidelines

    v5 v6  
    11= WebKit Python Guidelines and Tips =
    22
    3 Here is an overview of WebKit's use of Python.
     3Below is an overview of WebKit's use of Python.
    44
    55== Basics ==
     
    88 * Informally, we try to follow [http://www.python.org/dev/peps/pep-0008/ PEP8].  Eventually we may make this official.
    99 * [http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/test-webkitpy Scripts/test-webkitpy] unit tests the Python code.
    10  * You can always delete any *.pyc files to make sure you are not mistakenly using the wrong file.  This is often cosmetic and should usually not be necessary.
     10
    1111== Code Structure ==
    1212
     
    2323  * webkitpy/python24/: code that needs to work under Python 2.4 (currently just the version-checking code)
    2424  * [http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy webkitpy/thirdparty/]: all third-party code in webkitpy
     25
     26== Tips ==
     27
     28 * You can use the following command to clean leftover *.pyc files after a batch of file moves.
     29{{{
     30find WebKitTools/Scripts -wholename '*.pyc' | xargs rm
     31}}}
     32 This should usually not be necessary, but it ensures that you are not mistakenly using a wrong file since *.pyc files without a *.py file can still get executed.  Incidentally, we try to use fully-qualified import statements throughout our code so that the location of modules in webkitpy/ is never be ambiguous.
    2533
    2634== Installing a new version of Python ==