Commit c0032ce1 authored by cjerdonek@webkit.org's avatar cjerdonek@webkit.org
Browse files

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
parent f6062b1c
2010-03-13 Chris Jerdonek <cjerdonek@webkit.org>
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@webkit.org>
 
Reviewed by Adam Barth.
......
# 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.
......@@ -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):
......
......@@ -28,7 +28,7 @@
import time
from mechanize import HTTPError
from webkitpy.thirdparty.autoinstalled import HTTPError
from webkitpy.webkit_logging import log
......
......@@ -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")
......
......@@ -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.
......
# 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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment