Skip to content

Commit 7c8cef6

Browse files
committed
Fix typo
1 parent 8543e3c commit 7c8cef6

25 files changed

+110
-86
lines changed

.travis.install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pip install setuptools
66

77
if [[ $RUN == nosetests ]]; then
88
# core dependencies
9-
pop install -r requirements.txt
9+
pip install -r requirements.txt
1010
# filewatch specific dependencies
1111
pip install watchdog
1212
# jedi specific dependencies

bpython/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
# THE SOFTWARE.
2222

23+
from __future__ import absolute_import
24+
2325
import os.path
2426

2527
try:
26-
from bpython._version import __version__ as version
28+
from ._version import __version__ as version
2729
except ImportError:
2830
version = 'unknown'
2931

@@ -32,5 +34,5 @@
3234

3335

3436
def embed(locals_=None, args=['-i', '-q'], banner=None):
35-
from bpython.curtsies import main
37+
from .curtsies import main
3638
return main(args, locals_, banner)

bpython/_py3compat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
- py3: True if the hosting Python runtime is of Python version 3 or later
3535
"""
3636

37+
from __future__ import absolute_import
38+
3739
import sys
3840

3941
py3 = (sys.version_info[0] == 3)

bpython/args.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
Module to handle command line argument parsing, for all front-ends.
55
"""
66

7-
from __future__ import print_function
7+
from __future__ import print_function, absolute_import
8+
89
import code
910
import imp
1011
import os
1112
import sys
1213
from optparse import OptionParser, OptionGroup
1314

14-
from bpython import __version__
15-
from bpython.config import default_config_path, loadini, Struct
16-
from bpython.translations import _
15+
from . import __version__
16+
from .config import default_config_path, loadini, Struct
17+
from .translations import _
1718

1819

1920
class OptionParserFailed(ValueError):

bpython/autocomplete.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# THE SOFTWARE.
2424
#
2525

26-
from __future__ import unicode_literals
26+
from __future__ import unicode_literals, absolute_import
2727

2828
import __main__
2929
import abc
@@ -37,14 +37,14 @@
3737
from six.moves import range, builtins
3838
from six import string_types, iteritems
3939

40-
from bpython import inspection
41-
from bpython import importcompletion
42-
from bpython import line as lineparts
43-
from bpython.line import LinePart
44-
from bpython._py3compat import py3, try_decode
45-
from bpython.lazyre import LazyReCompile
46-
from bpython.simpleeval import (safe_eval, evaluate_current_expression,
47-
EvaluationError)
40+
from . import inspection
41+
from . import importcompletion
42+
from . import line as lineparts
43+
from .line import LinePart
44+
from ._py3compat import py3, try_decode
45+
from .lazyre import LazyReCompile
46+
from .simpleeval import (safe_eval, evaluate_current_expression,
47+
EvaluationError)
4848

4949
if not py3:
5050
from types import InstanceType, ClassType

bpython/cli.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
# - Instead the suspend key exits the program
4040
# - View source doesn't work on windows unless you install the less program (From GnuUtils or Cygwin)
4141

42-
from __future__ import division
42+
from __future__ import division, absolute_import
4343

4444
import platform
4545
import os
@@ -63,27 +63,27 @@
6363
# These are used for syntax highlighting
6464
from pygments import format
6565
from pygments.formatters import TerminalFormatter
66-
from bpython._py3compat import PythonLexer
66+
from ._py3compat import PythonLexer
6767
from pygments.token import Token
68-
from bpython.formatter import BPythonFormatter
68+
from .formatter import BPythonFormatter
6969

7070
# This for completion
71-
from bpython import importcompletion
71+
from . import importcompletion
7272

7373
# This for config
74-
from bpython.config import Struct, getpreferredencoding
74+
from .config import Struct, getpreferredencoding
7575

7676
# This for keys
77-
from bpython.keys import cli_key_dispatch as key_dispatch
77+
from .keys import cli_key_dispatch as key_dispatch
7878

7979
# This for i18n
80-
from bpython import translations
81-
from bpython.translations import _
80+
from . import translations
81+
from .translations import _
8282

83-
from bpython import repl
84-
from bpython._py3compat import py3
85-
from bpython.pager import page
86-
import bpython.args
83+
from . import repl
84+
from ._py3compat import py3
85+
from .pager import page
86+
from .args import parse as argsparse
8787

8888
if not py3:
8989
import inspect
@@ -1946,7 +1946,7 @@ def main(args=None, locals_=None, banner=None):
19461946
translations.init()
19471947

19481948

1949-
config, options, exec_args = bpython.args.parse(args)
1949+
config, options, exec_args = argsparse(args)
19501950

19511951
# Save stdin, stdout and stderr for later restoration
19521952
orig_stdin = sys.stdin

bpython/clipboard.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323
# THE SOFTWARE.
2424

25+
from __future__ import absolute_import
26+
2527
import subprocess
2628
import os
2729
import platform

bpython/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# encoding: utf-8
22

3-
from __future__ import unicode_literals
3+
from __future__ import unicode_literals, absolute_import
44

55
import os
66
import sys
@@ -9,8 +9,8 @@
99
from six import iterkeys, iteritems
1010
from six.moves.configparser import ConfigParser
1111

12-
from bpython.keys import cli_key_dispatch as key_dispatch
13-
from bpython.autocomplete import SIMPLE as default_completion, ALL_MODES
12+
from .autocomplete import SIMPLE as default_completion, ALL_MODES
13+
from .keys import cli_key_dispatch as cli_key_dispatch
1414

1515

1616
class Struct(object):

bpython/curtsies.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
import curtsies.input
1414
import curtsies.events
1515

16-
from bpython.curtsiesfrontend.repl import BaseRepl
17-
from bpython.curtsiesfrontend.coderunner import SystemExitFromCodeRunner
18-
from bpython.curtsiesfrontend.interpreter import Interp
19-
from bpython import args as bpargs
20-
from bpython import translations
21-
from bpython.translations import _
22-
from bpython.importcompletion import find_iterator
23-
from bpython.curtsiesfrontend import events as bpythonevents
24-
from bpython import inspection
25-
from bpython.repl import extract_exit_value
16+
from .curtsiesfrontend.repl import BaseRepl
17+
from .curtsiesfrontend.coderunner import SystemExitFromCodeRunner
18+
from .curtsiesfrontend.interpreter import Interp
19+
from . import args as bpargs
20+
from . import translations
21+
from .translations import _
22+
from .importcompletion import find_iterator
23+
from .curtsiesfrontend import events as bpythonevents
24+
from . import inspection
25+
from .repl import extract_exit_value
2626

2727
logger = logging.getLogger(__name__)
2828

bpython/filelock.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323
# THE SOFTWARE.
2424

25+
from __future__ import absolute_import
2526

2627
try:
2728
import fcntl

bpython/formatter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
# Pygments really kicks ass, it made it really easy to
2727
# get the exact behaviour I wanted, thanks Pygments.:)
2828

29+
from __future__ import absolute_import
30+
2931
from pygments.formatter import Formatter
3032
from pygments.token import Keyword, Name, Comment, String, Error, \
3133
Number, Operator, Token, Whitespace, Literal, Punctuation

bpython/history.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424
# THE SOFTWARE.
2525

26-
from __future__ import unicode_literals
26+
from __future__ import unicode_literals, absolute_import
2727
import io
2828
import os
2929
import stat
3030
from itertools import islice
3131
from six.moves import range
3232

33-
from bpython.translations import _
34-
from bpython.filelock import FileLock
33+
from .translations import _
34+
from .filelock import FileLock
3535

3636

3737
class History(object):

bpython/importcompletion.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@
2222
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323
# THE SOFTWARE.
2424

25-
from bpython._py3compat import py3, try_decode
26-
from bpython.line import current_word, current_import, \
27-
current_from_import_from, current_from_import_import
25+
from __future__ import absolute_import
26+
27+
from ._py3compat import py3, try_decode
28+
from .line import (current_word, current_import, current_from_import_from,
29+
current_from_import_import)
2830

2931
import imp
3032
import os

bpython/inspection.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2323
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424
# THE SOFTWARE.
25-
#
25+
26+
from __future__ import absolute_import
2627

2728
import inspect
2829
import io
@@ -33,8 +34,8 @@
3334

3435
from pygments.token import Token
3536

36-
from bpython._py3compat import PythonLexer, py3
37-
from bpython.lazyre import LazyReCompile
37+
from ._py3compat import PythonLexer, py3
38+
from .lazyre import LazyReCompile
3839

3940
if not py3:
4041
import types

bpython/keys.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2222
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323
# THE SOFTWARE.
24-
#
24+
25+
from __future__ import absolute_import
2526

2627
import string
2728
from six.moves import range

bpython/lazyre.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323
# THE SOFTWARE.
2424

25+
from __future__ import absolute_import
26+
2527
import re
2628

2729

bpython/line.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
All functions take cursor offset from the beginning of the line and the line of
66
Python code, and return None, or a tuple of the start index, end index, and the
77
word."""
8-
from __future__ import unicode_literals
8+
from __future__ import unicode_literals, absolute_import
99

1010
from itertools import chain
1111
from collections import namedtuple
1212

13-
from bpython.lazyre import LazyReCompile
13+
from .lazyre import LazyReCompile
1414

1515
LinePart = namedtuple('LinePart', ['start', 'stop', 'word'])
1616

bpython/pager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323
# THE SOFTWARE.
2424

25+
from __future__ import absolute_import
2526

2627
import curses
2728
import errno

bpython/paste.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323
# THE SOFTWARE.
2424

25+
from __future__ import absolute_import
26+
2527
from locale import getpreferredencoding
2628
from six.moves.urllib_parse import quote as urlquote, urljoin, urlparse
2729
from string import Template
@@ -30,7 +32,7 @@
3032
import subprocess
3133
import unicodedata
3234

33-
from bpython.translations import _
35+
from .translations import _
3436

3537

3638
class PasteFailed(Exception):

bpython/patch_linecache.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# encoding: utf-8
22

3+
from __future__ import absolute_import
4+
35
import linecache
46

57

bpython/repl.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424
# THE SOFTWARE.
2525

26+
from __future__ import absolute_import
27+
2628
import code
2729
import inspect
2830
import io
@@ -43,17 +45,17 @@
4345

4446
from pygments.token import Token
4547

46-
from bpython import autocomplete
47-
from bpython import inspection
48-
from bpython._py3compat import PythonLexer, py3, prepare_for_exec
49-
from bpython.clipboard import get_clipboard, CopyFailed
50-
from bpython.config import getpreferredencoding
51-
from bpython.formatter import Parenthesis
52-
from bpython.history import History
53-
from bpython.paste import PasteHelper, PastePinnwand, PasteFailed
54-
from bpython.patch_linecache import filename_for_console_input
55-
from bpython.translations import _, ngettext
56-
from bpython import simpleeval
48+
from . import autocomplete
49+
from . import inspection
50+
from ._py3compat import PythonLexer, py3, prepare_for_exec
51+
from .clipboard import get_clipboard, CopyFailed
52+
from .config import getpreferredencoding
53+
from .formatter import Parenthesis
54+
from .history import History
55+
from .paste import PasteHelper, PastePinnwand, PasteFailed
56+
from .patch_linecache import filename_for_console_input
57+
from .translations import _, ngettext
58+
from . import simpleeval
5759

5860

5961
class RuntimeTimer(object):
@@ -101,7 +103,7 @@ def __init__(self, locals=None, encoding=None):
101103
into a bytestring source as part of an encoding comment.
102104
"""
103105

104-
self.encoding = encoding or sys.getdefaultencoding()
106+
self.encoding = encoding or getpreferredencoding()
105107
self.syntaxerror_callback = None
106108

107109
if locals is None:

0 commit comments

Comments
 (0)