Permalink
Browse files

Py3k: import fixer

  • Loading branch information...
1 parent 1981689 commit 14d638abe4f821cbbbee41cd330e2d7e89f1e6a5 @bfroehle committed Sep 27, 2012
Showing with 74 additions and 74 deletions.
  1. +1 −1 IPython/config/configurable.py
  2. +1 −1 IPython/deathrow/astyle.py
  3. +1 −1 IPython/deathrow/gui/wx/ipshell_nonblocking.py
  4. +1 −1 IPython/deathrow/gui/wx/ipython_view.py
  5. +2 −2 IPython/deathrow/ibrowse.py
  6. +1 −1 IPython/deathrow/igrid.py
  7. +3 −3 IPython/deathrow/ipipe.py
  8. +1 −1 IPython/deathrow/ipy_profile_none.py
  9. +1 −1 IPython/deathrow/ipy_profile_numpy.py
  10. +1 −1 IPython/deathrow/ipy_profile_scipy.py
  11. +1 −1 IPython/deathrow/ipy_profile_sh.py
  12. +1 −1 IPython/deathrow/ipy_traits_completer.py
  13. +1 −1 IPython/deathrow/oldfrontend/process/__init__.py
  14. +1 −1 IPython/deathrow/oldfrontend/process/killableprocess.py
  15. +1 −1 IPython/deathrow/oldfrontend/process/pipedprocess.py
  16. +1 −1 IPython/deathrow/oldfrontend/wx/ipythonx.py
  17. +1 −1 IPython/deathrow/oldfrontend/wx/wx_frontend.py
  18. +2 −2 IPython/external/argparse/__init__.py
  19. +1 −1 IPython/external/decorator/__init__.py
  20. +2 −2 IPython/external/decorators/__init__.py
  21. +2 −2 IPython/external/decorators/_decorators.py
  22. +1 −1 IPython/external/path/__init__.py
  23. +1 −1 IPython/external/pexpect/__init__.py
  24. +1 −1 IPython/external/simplegeneric/__init__.py
  25. +1 −1 IPython/external/ssh/tunnel.py
  26. +5 −5 IPython/frontend/qt/console/console_widget.py
  27. +5 −5 IPython/frontend/qt/console/frontend_widget.py
  28. +1 −1 IPython/frontend/qt/console/history_console_widget.py
  29. +2 −2 IPython/frontend/qt/console/ipython_widget.py
  30. +1 −1 IPython/frontend/qt/console/rich_ipython_widget.py
  31. +1 −1 IPython/frontend/qt/kernelmanager.py
  32. +1 −1 IPython/parallel/tests/test_client.py
  33. +1 −1 IPython/quarantine/ipy_app_completers.py
  34. +1 −1 IPython/quarantine/ipy_system_conf.py
  35. +1 −1 IPython/testing/__init__.py
  36. +3 −3 IPython/testing/decorators.py
  37. +2 −2 IPython/testing/plugin/iptest.py
  38. +3 −3 IPython/utils/pickleutil.py
  39. +1 −1 IPython/utils/upgradedir.py
  40. +1 −1 IPython/zmq/completer.py
  41. +1 −1 IPython/zmq/displayhook.py
  42. +1 −1 IPython/zmq/entry_point.py
  43. +2 −2 IPython/zmq/frontend.py
  44. +1 −1 IPython/zmq/iostream.py
  45. +5 −5 IPython/zmq/ipkernel.py
  46. +3 −3 IPython/zmq/kernelmanager.py
  47. +1 −1 IPython/zmq/zmqshell.py
@@ -23,7 +23,7 @@
import datetime
from copy import deepcopy
-from loader import Config
+from .loader import Config
from IPython.utils.traitlets import HasTraits, Instance
from IPython.utils.text import indent, wrap_paragraphs
@@ -260,7 +260,7 @@ def write(self, stream, styled=True):
try:
- import ipipe
+ from . import ipipe
except ImportError:
pass
else:
@@ -21,7 +21,7 @@
import sys
import os
import locale
-from thread_ex import ThreadEx
+from .thread_ex import ThreadEx
from IPython.core import iplib
import IPython.utils.io
@@ -47,7 +47,7 @@
else:
ENCODING = 'utf-8'
-from ipshell_nonblocking import NonBlockingIPShell
+from .ipshell_nonblocking import NonBlockingIPShell
class WxNonBlockingIPShell(NonBlockingIPShell):
'''
@@ -4,7 +4,7 @@
from IPython.core import ipapi
-import astyle, ipipe
+from . import astyle, ipipe
# Python 2.3 compatibility
@@ -18,7 +18,7 @@
try:
sorted
except NameError:
- from ipipe import sorted
+ from .ipipe import sorted
class UnassignedKeyError(Exception):
@@ -8,7 +8,7 @@
try:
sorted
except NameError:
- from ipipe import sorted
+ from .ipipe import sorted
try:
set
except:
@@ -2150,7 +2150,7 @@ def xformat(value, mode, maxlength):
-import astyle
+from . import astyle
class idump(Display):
# The approximate maximum length of a column entry
@@ -2281,11 +2281,11 @@ def __xrepr__(self, mode="default"):
try:
- from ibrowse import ibrowse
+ from .ibrowse import ibrowse
except ImportError:
# No curses (probably Windows) => try igrid
try:
- from igrid import igrid
+ from .igrid import igrid
except ImportError:
# no wx either => use ``idump`` as the default display.
defaultdisplay = idump
@@ -1,4 +1,4 @@
""" Config file for 'default' profile """
# get various stuff that are there for historical / familiarity reasons
-import ipy_legacy
+from . import ipy_legacy
@@ -6,7 +6,7 @@
"""
from IPython.core import ipapi
-import ipy_defaults
+from . import ipy_defaults
def main():
ip = ipapi.get()
@@ -7,7 +7,7 @@
"""
from IPython.core import ipapi
-import ipy_defaults
+from . import ipy_defaults
def main():
ip = ipapi.get()
@@ -14,7 +14,7 @@
# The import below effectively obsoletes your old-style ipythonrc[.ini],
# so consider yourself warned!
-import ipy_defaults
+from . import ipy_defaults
def main():
ip = ipapi.get()
@@ -206,7 +206,7 @@ class Bunch(object): pass
# Reset the threshold to the default, in case the test is running inside an
# instance of ipython that changed it
- import ipy_traits_completer
+ from . import ipy_traits_completer
ipy_traits_completer.COMPLETE_THRESHOLD = 3
assert ip.complete('t.ed') ==[]
@@ -14,6 +14,6 @@
a GUI event loop.
"""
-from pipedprocess import PipedProcess
+from .pipedprocess import PipedProcess
@@ -77,7 +77,7 @@ def __str__(self):
# something else than cmd.
skip = True
else:
- import winprocess
+ from . import winprocess
else:
import signal
@@ -15,7 +15,7 @@
#-------------------------------------------------------------------------------
# Imports
#-------------------------------------------------------------------------------
-from killableprocess import Popen, PIPE
+from .killableprocess import Popen, PIPE
from threading import Thread
from time import sleep
import os
@@ -12,7 +12,7 @@
""" % e.args[0]
raise e
-from wx_frontend import WxController
+from .wx_frontend import WxController
import __builtin__
@@ -33,7 +33,7 @@
# Ipython-specific imports.
from IPython.frontend.process import PipedProcess
-from console_widget import ConsoleWidget, _COMPLETE_BUFFER_MARKER, \
+from .console_widget import ConsoleWidget, _COMPLETE_BUFFER_MARKER, \
_ERROR_MARKER, _INPUT_MARKER
from IPython.frontend.prefilterfrontend import PrefilterFrontEnd
@@ -7,5 +7,5 @@
from argparse import *
from argparse import SUPPRESS
except (ImportError, AttributeError):
- from _argparse import *
- from _argparse import SUPPRESS
+ from ._argparse import *
+ from ._argparse import SUPPRESS
@@ -1,4 +1,4 @@
try:
from decorator import *
except ImportError:
- from _decorator import *
+ from ._decorator import *
@@ -2,8 +2,8 @@
from numpy.testing.decorators import *
from numpy.testing.noseclasses import KnownFailure
except ImportError:
- from _decorators import *
+ from ._decorators import *
try:
- from _numpy_testing_noseclasses import KnownFailure
+ from ._numpy_testing_noseclasses import KnownFailure
except ImportError:
pass
@@ -20,9 +20,9 @@
#from numpy.testing.utils import \
# WarningManager, WarningMessage
# Our version:
-from _numpy_testing_utils import WarningManager
+from ._numpy_testing_utils import WarningManager
try:
- from _numpy_testing_noseclasses import KnownFailureTest
+ from ._numpy_testing_noseclasses import KnownFailureTest
except:
pass
@@ -1,4 +1,4 @@
try:
from path import *
except ImportError:
- from _path import *
+ from ._path import *
@@ -2,4 +2,4 @@
import pexpect
from pexpect import *
except ImportError:
- from _pexpect import *
+ from ._pexpect import *
@@ -1,4 +1,4 @@
try:
from simplegeneric import *
except ImportError:
- from _simplegeneric import *
+ from ._simplegeneric import *
@@ -34,7 +34,7 @@
except ImportError:
paramiko = None
else:
- from forward import forward_tunnel
+ from .forward import forward_tunnel
try:
from IPython.external import pexpect
@@ -21,11 +21,11 @@
from IPython.frontend.qt.util import MetaQObjectHasTraits, get_font
from IPython.utils.text import columnize
from IPython.utils.traitlets import Bool, Enum, Integer, Unicode
-from ansi_code_processor import QtAnsiCodeProcessor
-from completion_widget import CompletionWidget
-from completion_html import CompletionHtml
-from completion_plain import CompletionPlain
-from kill_ring import QtKillRing
+from .ansi_code_processor import QtAnsiCodeProcessor
+from .completion_widget import CompletionWidget
+from .completion_html import CompletionHtml
+from .completion_plain import CompletionPlain
+from .kill_ring import QtKillRing
#-----------------------------------------------------------------------------
@@ -16,11 +16,11 @@
from IPython.core.oinspect import call_tip
from IPython.frontend.qt.base_frontend_mixin import BaseFrontendMixin
from IPython.utils.traitlets import Bool, Instance, Unicode
-from bracket_matcher import BracketMatcher
-from call_tip_widget import CallTipWidget
-from completion_lexer import CompletionLexer
-from history_console_widget import HistoryConsoleWidget
-from pygments_highlighter import PygmentsHighlighter
+from .bracket_matcher import BracketMatcher
+from .call_tip_widget import CallTipWidget
+from .completion_lexer import CompletionLexer
+from .history_console_widget import HistoryConsoleWidget
+from .pygments_highlighter import PygmentsHighlighter
class FrontendHighlighter(PygmentsHighlighter):
@@ -3,7 +3,7 @@
# Local imports
from IPython.utils.traitlets import Bool
-from console_widget import ConsoleWidget
+from .console_widget import ConsoleWidget
class HistoryConsoleWidget(ConsoleWidget):
@@ -22,8 +22,8 @@
from IPython.core.inputsplitter import IPythonInputSplitter, \
transform_ipy_prompt
from IPython.utils.traitlets import Bool, Unicode
-from frontend_widget import FrontendWidget
-import styles
+from .frontend_widget import FrontendWidget
+from . import styles
#-----------------------------------------------------------------------------
# Constants
@@ -17,7 +17,7 @@
# Local imports
from IPython.utils.traitlets import Bool
from IPython.frontend.qt.svg import save_svg, svg_to_clipboard, svg_to_image
-from ipython_widget import IPythonWidget
+from .ipython_widget import IPythonWidget
class RichIPythonWidget(IPythonWidget):
@@ -8,7 +8,7 @@
from IPython.utils.traitlets import Type
from IPython.zmq.kernelmanager import KernelManager, SubSocketChannel, \
ShellSocketChannel, StdInSocketChannel, HBSocketChannel
-from util import MetaQObjectHasTraits, SuperQObject
+from .util import MetaQObjectHasTraits, SuperQObject
class SocketChannelQObject(SuperQObject):
@@ -30,7 +30,7 @@
from IPython.parallel import AsyncResult, AsyncHubResult
from IPython.parallel import LoadBalancedView, DirectView
-from clienttest import ClusterTestCase, segfault, wait, add_engines
+from .clienttest import ClusterTestCase, segfault, wait, add_engines
def setup():
add_engines(4, total=True)
@@ -9,7 +9,7 @@
ip = ipapi.get()
-from ipy_completers import *
+from .ipy_completers import *
ip.set_hook('complete_command', apt_completer, re_key = '.*apt-get')
ip.set_hook('complete_command', svn_completer, str_key = 'svn')
@@ -15,7 +15,7 @@
import sys
-import ext_rescapture # var = !ls and var = %magic
+from . import ext_rescapture # var = !ls and var = %magic
import pspersistence # %store magic
import clearcmd # %clear
@@ -21,7 +21,7 @@ def test(all=False):
# Do the import internally, so that this function doesn't increase total
# import time
- from iptest import run_iptestall
+ from .iptest import run_iptestall
run_iptestall(inc_slow=all)
# So nose doesn't try to run this as a test itself and we end up with an
@@ -60,12 +60,12 @@
# We already have python3-compliant code for parametric tests
if sys.version[0]=='2':
- from _paramtestpy2 import parametric, ParametricTestCase
+ from ._paramtestpy2 import parametric, ParametricTestCase
else:
- from _paramtestpy3 import parametric, ParametricTestCase
+ from ._paramtestpy3 import parametric, ParametricTestCase
# Expose the unittest-driven decorators
-from ipunittest import ipdoctest, ipdocstring
+from .ipunittest import ipdoctest, ipdocstring
# Grab the numpy-specific decorators which we keep in a file that we
# occasionally update from upstream: decorators.py is a copy of
@@ -6,8 +6,8 @@
from nose.plugins.builtin import plugins
from nose.plugins.doctests import Doctest
-import ipdoctest
-from ipdoctest import IPDocTestRunner
+from . import ipdoctest
+from .ipdoctest import IPDocTestRunner
if __name__ == '__main__':
print 'WARNING: this code is incomplete!'
@@ -30,9 +30,9 @@
except:
numpy = None
-import codeutil
-import py3compat
-from importstring import import_item
+from . import codeutil
+from . import py3compat
+from .importstring import import_item
from IPython.config import Application
@@ -9,7 +9,7 @@
try:
from IPython.external.path import path
except ImportError:
- from path import path
+ from .path import path
import hashlib, pickle
Oops, something went wrong.

0 comments on commit 14d638a

Please sign in to comment.