[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
cjerdonek at webkit.org
cjerdonek at webkit.org
Wed Mar 17 18:38:29 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 7d355452f3e9b730ca8410b3d360028016277c62
Author: cjerdonek at webkit.org <cjerdonek at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Mar 13 22:10:04 2010 +0000
Moved all code in webkitpy/__init__.py to another location.
Reviewed by Adam Barth.
https://bugs.webkit.org/show_bug.cgi?id=35828
Keeping webkitpy/__init__.py free of non-trivial code allows
calling code to import initialization code from webkitpy
before any errors or log messages occur due to code in
__init__.py. Such initialization code can include things like
version checking code and logging configuration code. This
also lets us move the autoinstall initialization code to a
location where it only executes if it is needed -- something
we have done in this patch.
* Scripts/webkitpy/__init__.py:
- Moved all executable code to the following location:
webkitpy/thirdparty/autoinstalled/__init__.py
- Added a code comment to keep this file free of non-trivial
code.
* Scripts/webkitpy/bugzilla.py:
- Updated mechanize import statement.
* Scripts/webkitpy/networktransaction.py:
- Updated mechanize import statement.
* Scripts/webkitpy/networktransaction_unittest.py:
- Updated mechanize import statement.
* Scripts/webkitpy/statusserver.py:
- Updated mechanize import statement.
* Scripts/webkitpy/thirdparty/autoinstalled/__init__.py: Added.
- Copied the code from webkitpy/__init__.py and updated it
as necessary.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55969 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index f7dfe9b..e8b8144 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -2,6 +2,45 @@
Reviewed by Adam Barth.
+ Moved all code in webkitpy/__init__.py to another location.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35828
+
+ Keeping webkitpy/__init__.py free of non-trivial code allows
+ calling code to import initialization code from webkitpy
+ before any errors or log messages occur due to code in
+ __init__.py. Such initialization code can include things like
+ version checking code and logging configuration code. This
+ also lets us move the autoinstall initialization code to a
+ location where it only executes if it is needed -- something
+ we have done in this patch.
+
+ * Scripts/webkitpy/__init__.py:
+ - Moved all executable code to the following location:
+ webkitpy/thirdparty/autoinstalled/__init__.py
+ - Added a code comment to keep this file free of non-trivial
+ code.
+
+ * Scripts/webkitpy/bugzilla.py:
+ - Updated mechanize import statement.
+
+ * Scripts/webkitpy/networktransaction.py:
+ - Updated mechanize import statement.
+
+ * Scripts/webkitpy/networktransaction_unittest.py:
+ - Updated mechanize import statement.
+
+ * Scripts/webkitpy/statusserver.py:
+ - Updated mechanize import statement.
+
+ * Scripts/webkitpy/thirdparty/autoinstalled/__init__.py: Added.
+ - Copied the code from webkitpy/__init__.py and updated it
+ as necessary.
+
+2010-03-13 Chris Jerdonek <cjerdonek at webkit.org>
+
+ Reviewed by Adam Barth.
+
Moved webkitpy/mock.py into webkitpy/thirdparty since it is
third-party code.
diff --git a/WebKitTools/Scripts/webkitpy/__init__.py b/WebKitTools/Scripts/webkitpy/__init__.py
index efa8c7a..b376bf2 100644
--- a/WebKitTools/Scripts/webkitpy/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/__init__.py
@@ -1,8 +1,13 @@
# Required for Python to search this directory for module files
-import thirdparty.autoinstall as autoinstall
-
-# List our third-party library dependencies here and where they can be
-# downloaded.
-autoinstall.bind("ClientForm", "http://pypi.python.org/packages/source/C/ClientForm/ClientForm-0.2.10.zip", "ClientForm-0.2.10")
-autoinstall.bind("mechanize", "http://pypi.python.org/packages/source/m/mechanize/mechanize-0.1.11.zip", "mechanize-0.1.11")
+# Keep this file free of any code or import statements that could
+# cause either an error to occur or a log message to be logged.
+# This ensures that calling code can import initialization code from
+# webkitpy before any errors or log messages due to code in this file.
+# Initialization code can include things like version-checking code and
+# logging configuration code.
+#
+# We do not execute any version-checking code or logging configuration
+# code in this file so that callers can opt-in as they want. This also
+# allows different callers to choose different initialization code,
+# as necessary.
diff --git a/WebKitTools/Scripts/webkitpy/bugzilla.py b/WebKitTools/Scripts/webkitpy/bugzilla.py
index 47a1a43..6bd7d82 100644
--- a/WebKitTools/Scripts/webkitpy/bugzilla.py
+++ b/WebKitTools/Scripts/webkitpy/bugzilla.py
@@ -39,13 +39,13 @@ from datetime import datetime # used in timestamp()
from webkitpy.webkit_logging import error, log
from webkitpy.committers import CommitterList
from webkitpy.credentials import Credentials
+from webkitpy.thirdparty.autoinstalled import Browser
from webkitpy.user import User
# WebKit includes a built copy of BeautifulSoup in Scripts/webkitpy/thirdparty
# so this import should always succeed.
from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup, SoupStrainer
-from mechanize import Browser
def parse_bug_id(message):
diff --git a/WebKitTools/Scripts/webkitpy/networktransaction.py b/WebKitTools/Scripts/webkitpy/networktransaction.py
index e053bd6..3121ef5 100644
--- a/WebKitTools/Scripts/webkitpy/networktransaction.py
+++ b/WebKitTools/Scripts/webkitpy/networktransaction.py
@@ -28,7 +28,7 @@
import time
-from mechanize import HTTPError
+from webkitpy.thirdparty.autoinstalled import HTTPError
from webkitpy.webkit_logging import log
diff --git a/WebKitTools/Scripts/webkitpy/networktransaction_unittest.py b/WebKitTools/Scripts/webkitpy/networktransaction_unittest.py
index 3cffe02..abea707 100644
--- a/WebKitTools/Scripts/webkitpy/networktransaction_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/networktransaction_unittest.py
@@ -28,8 +28,8 @@
import unittest
-from mechanize import HTTPError
from webkitpy.networktransaction import NetworkTransaction, NetworkTimeout
+from webkitpy.thirdparty.autoinstalled import HTTPError
class NetworkTransactionTest(unittest.TestCase):
exception = Exception("Test exception")
diff --git a/WebKitTools/Scripts/webkitpy/statusserver.py b/WebKitTools/Scripts/webkitpy/statusserver.py
index 9a56702..1426974 100644
--- a/WebKitTools/Scripts/webkitpy/statusserver.py
+++ b/WebKitTools/Scripts/webkitpy/statusserver.py
@@ -27,8 +27,8 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from webkitpy.networktransaction import NetworkTransaction
+from webkitpy.thirdparty.autoinstalled import Browser
from webkitpy.webkit_logging import log
-from mechanize import Browser
# WebKit includes a built copy of BeautifulSoup in Scripts/webkitpy/thirdparty
# so this import should always succeed.
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/autoinstalled/__init__.py b/WebKitTools/Scripts/webkitpy/thirdparty/autoinstalled/__init__.py
new file mode 100644
index 0000000..f739add
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/autoinstalled/__init__.py
@@ -0,0 +1,11 @@
+# Required for Python to search this directory for module files
+
+import webkitpy.thirdparty.autoinstall as autoinstall
+
+# List our third-party library dependencies here and where they can be
+# downloaded.
+autoinstall.bind("ClientForm", "http://pypi.python.org/packages/source/C/ClientForm/ClientForm-0.2.10.zip", "ClientForm-0.2.10")
+autoinstall.bind("mechanize", "http://pypi.python.org/packages/source/m/mechanize/mechanize-0.1.11.zip", "mechanize-0.1.11")
+
+from mechanize import Browser
+from mechanize import HTTPError
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list