Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Fixing other_packages and sys.path #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/test-broken-html.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
parser) can parse.
"""

from _mechanize_dist import ClientForm
from twill.other_packages._mechanize_dist import ClientForm

import twilltestlib
from twill import commands
Expand Down
2 changes: 1 addition & 1 deletion tests/test-checkbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import twill
from twill import namespaces, commands
from twill.errors import TwillAssertionError
from _mechanize_dist import BrowserStateError, ClientForm
from twill.other_packages._mechanize_dist import BrowserStateError, ClientForm

def setup_module():
global url
Expand Down
2 changes: 1 addition & 1 deletion tests/test-encoding.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import twilltestlib
from _mechanize_dist import ClientForm
from twill.other_packages._mechanize_dist import ClientForm
from cStringIO import StringIO

def test_form_parse():
Expand Down
2 changes: 1 addition & 1 deletion tests/test-form.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import twill
from twill import namespaces, commands
from twill.errors import TwillAssertionError
from _mechanize_dist import BrowserStateError, ClientForm
from twill.other_packages._mechanize_dist import BrowserStateError, ClientForm

def test():
url = twilltestlib.get_url()
Expand Down
7 changes: 1 addition & 6 deletions twill/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"set_errout"]

#
# add extensions (twill/extensions) and the the wwwsearch & pyparsing
# add extensions (twill/extensions)
# stuff from twill/included-packages/. NOTE: this works with eggs! hooray!
#

Expand All @@ -43,11 +43,6 @@
extensions = os.path.join(thisdir, 'extensions')
sys.path.append(extensions)

# add other_packages in at the *beginning*, so that the correct
# (patched) versions of pyparsing and mechanize get imported.
wwwsearchlib = os.path.join(thisdir, 'other_packages')
sys.path.insert(0, wwwsearchlib)

# the two core components of twill:
from shell import TwillCommandLoop
from parse import execute_file, execute_string
Expand Down
4 changes: 2 additions & 2 deletions twill/_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"""

# wwwsearch imports
from _mechanize_dist import Browser as MechanizeBrowser
from other_packages._mechanize_dist import Browser as MechanizeBrowser

import wsgi_intercept
from utils import FixedHTTPBasicAuthHandler, FunctioningHTTPRefreshProcessor

def build_http_handler():
from _mechanize_dist._urllib2 import HTTPHandler
from other_packages._mechanize_dist._urllib2 import HTTPHandler

class MyHTTPHandler(HTTPHandler):
def http_open(self, req):
Expand Down
4 changes: 2 additions & 2 deletions twill/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import re

# wwwsearch imports
import _mechanize_dist as mechanize
from _mechanize_dist import BrowserStateError, LinkNotFoundError, ClientForm
import other_packages._mechanize_dist as mechanize
from other_packages._mechanize_dist import BrowserStateError, LinkNotFoundError, ClientForm

# twill package imports
from _browser import PatchedMechanizeBrowser
Expand Down
6 changes: 3 additions & 3 deletions twill/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"""

import sys
import _mechanize_dist as mechanize
from _mechanize_dist import ClientForm
from _mechanize_dist._headersutil import is_html
import other_packages._mechanize_dist as mechanize
from other_packages._mechanize_dist import ClientForm
from other_packages._mechanize_dist._headersutil import is_html

OUT=None
ERR=sys.stderr
Expand Down
2 changes: 1 addition & 1 deletion twill/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from cStringIO import StringIO

from errors import TwillAssertionError, TwillNameError
from pyparsing import OneOrMore, Word, printables, quotedString, Optional, \
from other_packages.pyparsing import OneOrMore, Word, printables, quotedString, Optional, \
alphas, alphanums, ParseException, ZeroOrMore, restOfLine, Combine, \
Literal, Group, removeQuotes, CharsNotIn

Expand Down
10 changes: 5 additions & 5 deletions twill/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
import os
import base64

import subprocess
from other_packages import subprocess

import _mechanize_dist as mechanize
from _mechanize_dist import ClientForm
from _mechanize_dist._util import time
from _mechanize_dist._http import HTTPRefreshProcessor
import other_packages._mechanize_dist as mechanize
from other_packages._mechanize_dist import ClientForm
from other_packages._mechanize_dist._util import time
from other_packages._mechanize_dist._http import HTTPRefreshProcessor

from errors import TwillException

Expand Down