Changes between Version 9 and Version 10 of PythonGuidelines
- Timestamp:
- Mar 31, 2010, 10:54:19 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PythonGuidelines
v9 v10 9 9 * Most of WebKit's Python scripts require Python 2.5 to run. 10 10 * Informally, we try to follow [http://www.python.org/dev/peps/pep-0008/ PEP8]. Eventually we may make this official. 11 * [http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/test-webkitpy Scripts/test-webkitpy] unit tests the Python code. 11 * [http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/test-webkitpy Scripts/test-webkitpy] unit tests the Python code. It also cleans orphan *.pyc files from webkitpy (i.e. .pyc files without a corresponding .py file). You can also do this manually (for all *.pyc files in webkitpy) using the following command: 12 {{{ 13 find WebKitTools/Scripts -wholename '*.pyc' | xargs rm 14 }}} 12 15 13 16 == Code Structure == … … 25 28 * webkitpy/python24/: code that needs to work under Python 2.4 (currently just the version-checking code) 26 29 * [http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy webkitpy/thirdparty/]: all third-party code in webkitpy 27 28 == Tips ==29 30 * You can use the following command to clean leftover *.pyc files after a batch of file moves.31 {{{32 find WebKitTools/Scripts -wholename '*.pyc' | xargs rm33 }}}34 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.35 30 36 31 == Upgrading from Python 2.3 or Python 2.4 ==