Show More
@@ -14,7 +14,7 b' import sys' | |||||
14 | from copy import deepcopy |
|
14 | from copy import deepcopy | |
15 | from collections import defaultdict |
|
15 | from collections import defaultdict | |
16 |
|
16 | |||
17 |
from |
|
17 | from decorator import decorator | |
18 |
|
18 | |||
19 | from IPython.config.configurable import SingletonConfigurable |
|
19 | from IPython.config.configurable import SingletonConfigurable | |
20 | from IPython.config.loader import ( |
|
20 | from IPython.config.loader import ( |
@@ -17,7 +17,7 b' import sys' | |||||
17 | import traceback |
|
17 | import traceback | |
18 | import warnings |
|
18 | import warnings | |
19 |
|
19 | |||
20 |
from |
|
20 | from decorator import decorator | |
21 |
|
21 | |||
22 | from IPython.config.configurable import Configurable |
|
22 | from IPython.config.configurable import Configurable | |
23 | from IPython.core.getipython import get_ipython |
|
23 | from IPython.core.getipython import get_ipython |
@@ -28,7 +28,7 b' import threading' | |||||
28 |
|
28 | |||
29 | # Our own packages |
|
29 | # Our own packages | |
30 | from IPython.config.configurable import Configurable |
|
30 | from IPython.config.configurable import Configurable | |
31 |
from |
|
31 | from decorator import decorator | |
32 | from IPython.utils.decorators import undoc |
|
32 | from IPython.utils.decorators import undoc | |
33 | from IPython.utils.path import locate_profile |
|
33 | from IPython.utils.path import locate_profile | |
34 | from IPython.utils import py3compat |
|
34 | from IPython.utils import py3compat |
@@ -27,6 +27,8 b' import types' | |||||
27 | import subprocess |
|
27 | import subprocess | |
28 | from io import open as io_open |
|
28 | from io import open as io_open | |
29 |
|
29 | |||
|
30 | from pickleshare import PickleShareDB | |||
|
31 | ||||
30 | from IPython.config.configurable import SingletonConfigurable |
|
32 | from IPython.config.configurable import SingletonConfigurable | |
31 | from IPython.core import debugger, oinspect |
|
33 | from IPython.core import debugger, oinspect | |
32 | from IPython.core import magic |
|
34 | from IPython.core import magic | |
@@ -63,7 +65,6 b' from IPython.utils.decorators import undoc' | |||||
63 | from IPython.utils.io import ask_yes_no |
|
65 | from IPython.utils.io import ask_yes_no | |
64 | from IPython.utils.ipstruct import Struct |
|
66 | from IPython.utils.ipstruct import Struct | |
65 | from IPython.utils.path import get_home_dir, get_ipython_dir, get_py_filename, unquote_filename, ensure_dir_exists |
|
67 | from IPython.utils.path import get_home_dir, get_ipython_dir, get_py_filename, unquote_filename, ensure_dir_exists | |
66 | from IPython.utils.pickleshare import PickleShareDB |
|
|||
67 | from IPython.utils.process import system, getoutput |
|
68 | from IPython.utils.process import system, getoutput | |
68 | from IPython.utils.py3compat import (builtin_mod, unicode_type, string_types, |
|
69 | from IPython.utils.py3compat import (builtin_mod, unicode_type, string_types, | |
69 | with_metaclass, iteritems) |
|
70 | with_metaclass, iteritems) |
@@ -27,7 +27,7 b' from IPython.config.configurable import Configurable' | |||||
27 | from IPython.core import oinspect |
|
27 | from IPython.core import oinspect | |
28 | from IPython.core.error import UsageError |
|
28 | from IPython.core.error import UsageError | |
29 | from IPython.core.inputsplitter import ESC_MAGIC, ESC_MAGIC2 |
|
29 | from IPython.core.inputsplitter import ESC_MAGIC, ESC_MAGIC2 | |
30 |
from |
|
30 | from decorator import decorator | |
31 | from IPython.utils.ipstruct import Struct |
|
31 | from IPython.utils.ipstruct import Struct | |
32 | from IPython.utils.process import arg_split |
|
32 | from IPython.utils.process import arg_split | |
33 | from IPython.utils.py3compat import string_types, iteritems |
|
33 | from IPython.utils.py3compat import string_types, iteritems |
@@ -26,7 +26,7 b' from IPython.core.magic import (Magics, magics_class, line_magic,' | |||||
26 | cell_magic, line_cell_magic, |
|
26 | cell_magic, line_cell_magic, | |
27 | register_line_magic, register_cell_magic, |
|
27 | register_line_magic, register_cell_magic, | |
28 | register_line_cell_magic) |
|
28 | register_line_cell_magic) | |
29 |
from |
|
29 | from decorator import decorator | |
30 | from IPython.testing.decorators import skipif |
|
30 | from IPython.testing.decorators import skipif | |
31 | from IPython.testing.tools import AssertPrints |
|
31 | from IPython.testing.tools import AssertPrints | |
32 | from IPython.utils.path import compress_user |
|
32 | from IPython.utils.path import compress_user |
@@ -73,7 +73,7 b' from IPython.testing.skipdoctest import skip_doctest' | |||||
73 | from IPython.core.magic_arguments import ( |
|
73 | from IPython.core.magic_arguments import ( | |
74 | argument, magic_arguments, parse_argstring |
|
74 | argument, magic_arguments, parse_argstring | |
75 | ) |
|
75 | ) | |
76 |
from |
|
76 | from simplegeneric import generic | |
77 | from IPython.utils.py3compat import (str_to_unicode, unicode_to_str, PY3, |
|
77 | from IPython.utils.py3compat import (str_to_unicode, unicode_to_str, PY3, | |
78 | unicode_type) |
|
78 | unicode_type) | |
79 | from IPython.utils.text import dedent |
|
79 | from IPython.utils.text import dedent |
@@ -11,19 +11,14 b' import zmq' | |||||
11 |
|
11 | |||
12 | from IPython.config.application import Application |
|
12 | from IPython.config.application import Application | |
13 | from IPython.utils import io |
|
13 | from IPython.utils import io | |
14 |
|
14 | from IPython.lib.inputhook import _use_appnope | ||
15 |
|
||||
16 | def _on_os_x_10_9(): |
|
|||
17 | import platform |
|
|||
18 | from distutils.version import LooseVersion as V |
|
|||
19 | return sys.platform == 'darwin' and V(platform.mac_ver()[0]) >= V('10.9') |
|
|||
20 |
|
15 | |||
21 | def _notify_stream_qt(kernel, stream): |
|
16 | def _notify_stream_qt(kernel, stream): | |
22 |
|
17 | |||
23 | from IPython.external.qt_for_kernel import QtCore |
|
18 | from IPython.external.qt_for_kernel import QtCore | |
24 |
|
19 | |||
25 |
if _ |
|
20 | if _use_appnope() and kernel._darwin_app_nap: | |
26 |
from |
|
21 | from appnope import nope_scope as context | |
27 | else: |
|
22 | else: | |
28 | from IPython.core.interactiveshell import NoOpContext as context |
|
23 | from IPython.core.interactiveshell import NoOpContext as context | |
29 |
|
24 | |||
@@ -93,10 +88,10 b' def loop_wx(kernel):' | |||||
93 | import wx |
|
88 | import wx | |
94 | from IPython.lib.guisupport import start_event_loop_wx |
|
89 | from IPython.lib.guisupport import start_event_loop_wx | |
95 |
|
90 | |||
96 |
if _ |
|
91 | if _use_appnope() and kernel._darwin_app_nap: | |
97 | # we don't hook up App Nap contexts for Wx, |
|
92 | # we don't hook up App Nap contexts for Wx, | |
98 | # just disable it outright. |
|
93 | # just disable it outright. | |
99 |
from |
|
94 | from appnope import nope | |
100 | nope() |
|
95 | nope() | |
101 |
|
96 | |||
102 | doi = kernel.do_one_iteration |
|
97 | doi = kernel.do_one_iteration |
@@ -3,16 +3,8 b'' | |||||
3 | Inputhook management for GUI event loop integration. |
|
3 | Inputhook management for GUI event loop integration. | |
4 | """ |
|
4 | """ | |
5 |
|
5 | |||
6 | #----------------------------------------------------------------------------- |
|
6 | # Copyright (c) IPython Development Team. | |
7 | # Copyright (C) 2008-2011 The IPython Development Team |
|
7 | # Distributed under the terms of the Modified BSD License. | |
8 | # |
|
|||
9 | # Distributed under the terms of the BSD License. The full license is in |
|
|||
10 | # the file COPYING, distributed as part of this software. |
|
|||
11 | #----------------------------------------------------------------------------- |
|
|||
12 |
|
||||
13 | #----------------------------------------------------------------------------- |
|
|||
14 | # Imports |
|
|||
15 | #----------------------------------------------------------------------------- |
|
|||
16 |
|
8 | |||
17 | try: |
|
9 | try: | |
18 | import ctypes |
|
10 | import ctypes | |
@@ -21,6 +13,7 b' except ImportError:' | |||||
21 | except SystemError: # IronPython issue, 2/8/2014 |
|
13 | except SystemError: # IronPython issue, 2/8/2014 | |
22 | ctypes = None |
|
14 | ctypes = None | |
23 | import os |
|
15 | import os | |
|
16 | import platform | |||
24 | import sys |
|
17 | import sys | |
25 | from distutils.version import LooseVersion as V |
|
18 | from distutils.version import LooseVersion as V | |
26 |
|
19 | |||
@@ -57,8 +50,14 b' def _stdin_ready_nt():' | |||||
57 |
|
50 | |||
58 | def _stdin_ready_other(): |
|
51 | def _stdin_ready_other(): | |
59 | """Return True, assuming there's something to read on stdin.""" |
|
52 | """Return True, assuming there's something to read on stdin.""" | |
60 |
return True |
|
53 | return True | |
|
54 | ||||
|
55 | def _use_appnope(): | |||
|
56 | """Should we use appnope for dealing with OS X app nap? | |||
61 |
|
|
57 | ||
|
58 | Checks if we are on OS X 10.9 or greater. | |||
|
59 | """ | |||
|
60 | return sys.platform == 'darwin' and V(platform.mac_ver()[0]) >= V('10.9') | |||
62 |
|
61 | |||
63 | def _ignore_CTRL_C_posix(): |
|
62 | def _ignore_CTRL_C_posix(): | |
64 | """Ignore CTRL+C (SIGINT).""" |
|
63 | """Ignore CTRL+C (SIGINT).""" | |
@@ -317,9 +316,10 b' class WxInputHook(InputHookBase):' | |||||
317 | raise ValueError("requires wxPython >= 2.8, but you have %s" % wx.__version__) |
|
316 | raise ValueError("requires wxPython >= 2.8, but you have %s" % wx.__version__) | |
318 |
|
317 | |||
319 | from IPython.lib.inputhookwx import inputhook_wx |
|
318 | from IPython.lib.inputhookwx import inputhook_wx | |
320 | from IPython.external.appnope import nope |
|
|||
321 | self.manager.set_inputhook(inputhook_wx) |
|
319 | self.manager.set_inputhook(inputhook_wx) | |
322 | nope() |
|
320 | if _use_appnope(): | |
|
321 | from appnope import nope | |||
|
322 | nope() | |||
323 |
|
323 | |||
324 | import wx |
|
324 | import wx | |
325 | if app is None: |
|
325 | if app is None: | |
@@ -334,8 +334,9 b' class WxInputHook(InputHookBase):' | |||||
334 |
|
334 | |||
335 | This restores appnapp on OS X |
|
335 | This restores appnapp on OS X | |
336 | """ |
|
336 | """ | |
337 | from IPython.external.appnope import nap |
|
337 | if _use_appnope(): | |
338 | nap() |
|
338 | from appnope import nap | |
|
339 | nap() | |||
339 |
|
340 | |||
340 | @inputhook_manager.register('qt', 'qt4') |
|
341 | @inputhook_manager.register('qt', 'qt4') | |
341 | class Qt4InputHook(InputHookBase): |
|
342 | class Qt4InputHook(InputHookBase): | |
@@ -362,10 +363,11 b' class Qt4InputHook(InputHookBase):' | |||||
362 | app = QtGui.QApplication(sys.argv) |
|
363 | app = QtGui.QApplication(sys.argv) | |
363 | """ |
|
364 | """ | |
364 | from IPython.lib.inputhookqt4 import create_inputhook_qt4 |
|
365 | from IPython.lib.inputhookqt4 import create_inputhook_qt4 | |
365 | from IPython.external.appnope import nope |
|
366 | app, inputhook_qt4 = create_inputhook_qt4(self, app) | |
366 | app, inputhook_qt4 = create_inputhook_qt4(self.manager, app) |
|
|||
367 | self.manager.set_inputhook(inputhook_qt4) |
|
367 | self.manager.set_inputhook(inputhook_qt4) | |
368 | nope() |
|
368 | if _use_appnope(): | |
|
369 | from appnope import nope | |||
|
370 | nope() | |||
369 |
|
371 | |||
370 | return app |
|
372 | return app | |
371 |
|
373 | |||
@@ -374,8 +376,9 b' class Qt4InputHook(InputHookBase):' | |||||
374 |
|
376 | |||
375 | This restores appnapp on OS X |
|
377 | This restores appnapp on OS X | |
376 | """ |
|
378 | """ | |
377 | from IPython.external.appnope import nap |
|
379 | if _use_appnope(): | |
378 | nap() |
|
380 | from appnope import nap | |
|
381 | nap() | |||
379 |
|
382 | |||
380 |
|
383 | |||
381 | @inputhook_manager.register('qt5') |
|
384 | @inputhook_manager.register('qt5') |
@@ -12,7 +12,7 b' from datetime import datetime' | |||||
12 | from zmq import MessageTracker |
|
12 | from zmq import MessageTracker | |
13 |
|
13 | |||
14 | from IPython.core.display import clear_output, display, display_pretty |
|
14 | from IPython.core.display import clear_output, display, display_pretty | |
15 |
from |
|
15 | from decorator import decorator | |
16 | from IPython.parallel import error |
|
16 | from IPython.parallel import error | |
17 | from IPython.utils.py3compat import string_types |
|
17 | from IPython.utils.py3compat import string_types | |
18 |
|
18 |
@@ -31,7 +31,7 b' from IPython.utils.path import get_ipython_dir, compress_user' | |||||
31 | from IPython.utils.py3compat import cast_bytes, string_types, xrange, iteritems |
|
31 | from IPython.utils.py3compat import cast_bytes, string_types, xrange, iteritems | |
32 | from IPython.utils.traitlets import (HasTraits, Integer, Instance, Unicode, |
|
32 | from IPython.utils.traitlets import (HasTraits, Integer, Instance, Unicode, | |
33 | Dict, List, Bool, Set, Any) |
|
33 | Dict, List, Bool, Set, Any) | |
34 |
from |
|
34 | from decorator import decorator | |
35 |
|
35 | |||
36 | from IPython.parallel import Reference |
|
36 | from IPython.parallel import Reference | |
37 | from IPython.parallel import error |
|
37 | from IPython.parallel import error |
@@ -8,7 +8,7 b' from __future__ import division' | |||||
8 | import sys |
|
8 | import sys | |
9 | import warnings |
|
9 | import warnings | |
10 |
|
10 | |||
11 |
from |
|
11 | from decorator import decorator | |
12 | from IPython.testing.skipdoctest import skip_doctest |
|
12 | from IPython.testing.skipdoctest import skip_doctest | |
13 |
|
13 | |||
14 | from . import map as Map |
|
14 | from . import map as Map |
@@ -18,7 +18,7 b' from IPython.utils import pickleutil' | |||||
18 | from IPython.utils.traitlets import ( |
|
18 | from IPython.utils.traitlets import ( | |
19 | HasTraits, Any, Bool, List, Dict, Set, Instance, CFloat, Integer |
|
19 | HasTraits, Any, Bool, List, Dict, Set, Instance, CFloat, Integer | |
20 | ) |
|
20 | ) | |
21 |
from |
|
21 | from decorator import decorator | |
22 |
|
22 | |||
23 | from IPython.parallel import util |
|
23 | from IPython.parallel import util | |
24 | from IPython.parallel.controller.dependency import Dependency, dependent |
|
24 | from IPython.parallel.controller.dependency import Dependency, dependent |
@@ -26,7 +26,7 b' import zmq' | |||||
26 | from zmq.eventloop import ioloop, zmqstream |
|
26 | from zmq.eventloop import ioloop, zmqstream | |
27 |
|
27 | |||
28 | # local imports |
|
28 | # local imports | |
29 |
from |
|
29 | from decorator import decorator | |
30 | from IPython.config.application import Application |
|
30 | from IPython.config.application import Application | |
31 | from IPython.config.loader import Config |
|
31 | from IPython.config.loader import Config | |
32 | from IPython.utils.traitlets import Instance, Dict, List, Set, Integer, Enum, CBytes |
|
32 | from IPython.utils.traitlets import Instance, Dict, List, Set, Integer, Enum, CBytes |
@@ -22,7 +22,7 b' from nose import SkipTest' | |||||
22 | import zmq |
|
22 | import zmq | |
23 | from zmq.tests import BaseZMQTestCase |
|
23 | from zmq.tests import BaseZMQTestCase | |
24 |
|
24 | |||
25 |
from |
|
25 | from decorator import decorator | |
26 |
|
26 | |||
27 | from IPython.parallel import error |
|
27 | from IPython.parallel import error | |
28 | from IPython.parallel import Client |
|
28 | from IPython.parallel import Client |
@@ -28,7 +28,7 b' import zmq' | |||||
28 | from zmq.log import handlers |
|
28 | from zmq.log import handlers | |
29 |
|
29 | |||
30 | from IPython.utils.log import get_logger |
|
30 | from IPython.utils.log import get_logger | |
31 |
from |
|
31 | from decorator import decorator | |
32 |
|
32 | |||
33 | from IPython.config.application import Application |
|
33 | from IPython.config.application import Application | |
34 | from IPython.utils.localinterfaces import localhost, is_public_ip, public_ips |
|
34 | from IPython.utils.localinterfaces import localhost, is_public_ip, public_ips |
@@ -62,7 +62,7 b' def stop_console(p, pexpect, t):' | |||||
62 |
|
62 | |||
63 | def start_console(): |
|
63 | def start_console(): | |
64 | "Start `ipython console` using pexpect" |
|
64 | "Start `ipython console` using pexpect" | |
65 |
|
|
65 | import pexpect | |
66 |
|
66 | |||
67 | args = ['-m', 'IPython', 'console', '--colors=NoColor'] |
|
67 | args = ['-m', 'IPython', 'console', '--colors=NoColor'] | |
68 | cmd = sys.executable |
|
68 | cmd = sys.executable |
@@ -60,7 +60,7 b' def test_ipython_embed():' | |||||
60 | @skip_win32 |
|
60 | @skip_win32 | |
61 | def test_nest_embed(): |
|
61 | def test_nest_embed(): | |
62 | """test that `IPython.embed()` is nestable""" |
|
62 | """test that `IPython.embed()` is nestable""" | |
63 |
|
|
63 | import pexpect | |
64 | ipy_prompt = r']:' #ansi color codes give problems matching beyond this |
|
64 | ipy_prompt = r']:' #ansi color codes give problems matching beyond this | |
65 |
|
65 | |||
66 |
|
66 |
@@ -52,7 +52,7 b' import unittest' | |||||
52 | # Third-party imports |
|
52 | # Third-party imports | |
53 |
|
53 | |||
54 | # This is Michele Simionato's decorator module, kept verbatim. |
|
54 | # This is Michele Simionato's decorator module, kept verbatim. | |
55 |
from |
|
55 | from decorator import decorator | |
56 |
|
56 | |||
57 | # Expose the unittest-driven decorators |
|
57 | # Expose the unittest-driven decorators | |
58 | from .ipunittest import ipdoctest, ipdocstring |
|
58 | from .ipunittest import ipdoctest, ipdocstring |
@@ -42,12 +42,6 b' from IPython.external.decorators import KnownFailure, knownfailureif' | |||||
42 |
|
42 | |||
43 | pjoin = path.join |
|
43 | pjoin = path.join | |
44 |
|
44 | |||
45 |
|
||||
46 | #----------------------------------------------------------------------------- |
|
|||
47 | # Globals |
|
|||
48 | #----------------------------------------------------------------------------- |
|
|||
49 |
|
||||
50 |
|
||||
51 | #----------------------------------------------------------------------------- |
|
45 | #----------------------------------------------------------------------------- | |
52 | # Warnings control |
|
46 | # Warnings control | |
53 | #----------------------------------------------------------------------------- |
|
47 | #----------------------------------------------------------------------------- | |
@@ -127,7 +121,7 b' have = {}' | |||||
127 | have['curses'] = test_for('_curses') |
|
121 | have['curses'] = test_for('_curses') | |
128 | have['matplotlib'] = test_for('matplotlib') |
|
122 | have['matplotlib'] = test_for('matplotlib') | |
129 | have['numpy'] = test_for('numpy') |
|
123 | have['numpy'] = test_for('numpy') | |
130 |
have['pexpect'] = test_for(' |
|
124 | have['pexpect'] = test_for('pexpect') | |
131 | have['pymongo'] = test_for('pymongo') |
|
125 | have['pymongo'] = test_for('pymongo') | |
132 | have['pygments'] = test_for('pygments') |
|
126 | have['pygments'] = test_for('pygments') | |
133 | have['qt'] = test_for('IPython.external.qt') |
|
127 | have['qt'] = test_for('IPython.external.qt') |
@@ -21,7 +21,7 b' import os' | |||||
21 | import subprocess as sp |
|
21 | import subprocess as sp | |
22 | import sys |
|
22 | import sys | |
23 |
|
23 | |||
24 | from IPython.external import pexpect |
|
24 | import pexpect | |
25 |
|
25 | |||
26 | # Our own |
|
26 | # Our own | |
27 | from ._process_common import getoutput, arg_split |
|
27 | from ._process_common import getoutput, arg_split |
@@ -1,26 +1,11 b'' | |||||
1 | # encoding: utf-8 |
|
1 | # encoding: utf-8 | |
2 | """Generic functions for extending IPython. |
|
2 | """Generic functions for extending IPython. | |
3 |
|
3 | |||
4 |
See http:// |
|
4 | See http://pypi.python.org/pypi/simplegeneric. | |
5 | """ |
|
5 | """ | |
6 |
|
6 | |||
7 | #----------------------------------------------------------------------------- |
|
|||
8 | # Copyright (C) 2008-2011 The IPython Development Team |
|
|||
9 | # |
|
|||
10 | # Distributed under the terms of the BSD License. The full license is in |
|
|||
11 | # the file COPYING, distributed as part of this software. |
|
|||
12 | #----------------------------------------------------------------------------- |
|
|||
13 |
|
||||
14 | #----------------------------------------------------------------------------- |
|
|||
15 | # Imports |
|
|||
16 | #----------------------------------------------------------------------------- |
|
|||
17 |
|
||||
18 | from IPython.core.error import TryNext |
|
7 | from IPython.core.error import TryNext | |
19 |
from |
|
8 | from simplegeneric import generic | |
20 |
|
||||
21 | #----------------------------------------------------------------------------- |
|
|||
22 | # Imports |
|
|||
23 | #----------------------------------------------------------------------------- |
|
|||
24 |
|
9 | |||
25 |
|
10 | |||
26 | @generic |
|
11 | @generic |
@@ -8,42 +8,21 b' Inheritance diagram:' | |||||
8 | :parts: 3 |
|
8 | :parts: 3 | |
9 | """ |
|
9 | """ | |
10 |
|
10 | |||
11 | #----------------------------------------------------------------------------- |
|
|||
12 | # Copyright (C) 2008-2011 The IPython Development Team |
|
|||
13 | # |
|
|||
14 | # Distributed under the terms of the BSD License. The full license is in |
|
|||
15 | # the file COPYING, distributed as part of this software. |
|
|||
16 | #----------------------------------------------------------------------------- |
|
|||
17 |
|
||||
18 | #----------------------------------------------------------------------------- |
|
|||
19 | # Imports |
|
|||
20 | #----------------------------------------------------------------------------- |
|
|||
21 |
|
||||
22 | import os |
|
11 | import os | |
23 | import re |
|
12 | import re | |
24 | import sys |
|
13 | import sys | |
25 | import textwrap |
|
14 | import textwrap | |
26 | from string import Formatter |
|
15 | from string import Formatter | |
27 |
|
16 | |||
28 | from IPython.external.path import path |
|
|||
29 | from IPython.testing.skipdoctest import skip_doctest_py3, skip_doctest |
|
17 | from IPython.testing.skipdoctest import skip_doctest_py3, skip_doctest | |
30 | from IPython.utils import py3compat |
|
18 | from IPython.utils import py3compat | |
31 |
|
19 | |||
32 | #----------------------------------------------------------------------------- |
|
|||
33 | # Declarations |
|
|||
34 | #----------------------------------------------------------------------------- |
|
|||
35 |
|
||||
36 | # datetime.strftime date format for ipython |
|
20 | # datetime.strftime date format for ipython | |
37 | if sys.platform == 'win32': |
|
21 | if sys.platform == 'win32': | |
38 | date_format = "%B %d, %Y" |
|
22 | date_format = "%B %d, %Y" | |
39 | else: |
|
23 | else: | |
40 | date_format = "%B %-d, %Y" |
|
24 | date_format = "%B %-d, %Y" | |
41 |
|
25 | |||
42 |
|
||||
43 | #----------------------------------------------------------------------------- |
|
|||
44 | # Code |
|
|||
45 | #----------------------------------------------------------------------------- |
|
|||
46 |
|
||||
47 | class LSString(str): |
|
26 | class LSString(str): | |
48 | """String derivative with a special access attributes. |
|
27 | """String derivative with a special access attributes. | |
49 |
|
28 | |||
@@ -52,7 +31,7 b' class LSString(str):' | |||||
52 | .l (or .list) : value as list (split on newlines). |
|
31 | .l (or .list) : value as list (split on newlines). | |
53 | .n (or .nlstr): original value (the string itself). |
|
32 | .n (or .nlstr): original value (the string itself). | |
54 | .s (or .spstr): value as whitespace-separated string. |
|
33 | .s (or .spstr): value as whitespace-separated string. | |
55 | .p (or .paths): list of path objects |
|
34 | .p (or .paths): list of path objects (requires path.py package) | |
56 |
|
35 | |||
57 | Any values which require transformations are computed only once and |
|
36 | Any values which require transformations are computed only once and | |
58 | cached. |
|
37 | cached. | |
@@ -84,6 +63,7 b' class LSString(str):' | |||||
84 | n = nlstr = property(get_nlstr) |
|
63 | n = nlstr = property(get_nlstr) | |
85 |
|
64 | |||
86 | def get_paths(self): |
|
65 | def get_paths(self): | |
|
66 | from path import path | |||
87 | try: |
|
67 | try: | |
88 | return self.__paths |
|
68 | return self.__paths | |
89 | except AttributeError: |
|
69 | except AttributeError: | |
@@ -113,7 +93,7 b' class SList(list):' | |||||
113 | * .l (or .list) : value as list (the list itself). |
|
93 | * .l (or .list) : value as list (the list itself). | |
114 | * .n (or .nlstr): value as a string, joined on newlines. |
|
94 | * .n (or .nlstr): value as a string, joined on newlines. | |
115 | * .s (or .spstr): value as a string, joined on spaces. |
|
95 | * .s (or .spstr): value as a string, joined on spaces. | |
116 | * .p (or .paths): list of path objects |
|
96 | * .p (or .paths): list of path objects (requires path.py package) | |
117 |
|
97 | |||
118 | Any values which require transformations are computed only once and |
|
98 | Any values which require transformations are computed only once and | |
119 | cached.""" |
|
99 | cached.""" | |
@@ -142,6 +122,7 b' class SList(list):' | |||||
142 | n = nlstr = property(get_nlstr) |
|
122 | n = nlstr = property(get_nlstr) | |
143 |
|
123 | |||
144 | def get_paths(self): |
|
124 | def get_paths(self): | |
|
125 | from path import path | |||
145 | try: |
|
126 | try: | |
146 | return self.__paths |
|
127 | return self.__paths | |
147 | except AttributeError: |
|
128 | except AttributeError: |
@@ -63,7 +63,7 b' from setupbase import (' | |||||
63 | find_entry_points, |
|
63 | find_entry_points, | |
64 | build_scripts_entrypt, |
|
64 | build_scripts_entrypt, | |
65 | find_data_files, |
|
65 | find_data_files, | |
66 |
check_for_ |
|
66 | check_for_readline, | |
67 | git_prebuild, |
|
67 | git_prebuild, | |
68 | check_submodule_status, |
|
68 | check_submodule_status, | |
69 | update_submodules, |
|
69 | update_submodules, | |
@@ -78,7 +78,6 b' from setupbase import (' | |||||
78 | install_scripts_for_symlink, |
|
78 | install_scripts_for_symlink, | |
79 | unsymlink, |
|
79 | unsymlink, | |
80 | ) |
|
80 | ) | |
81 | from setupext import setupext |
|
|||
82 |
|
81 | |||
83 | isfile = os.path.isfile |
|
82 | isfile = os.path.isfile | |
84 | pjoin = os.path.join |
|
83 | pjoin = os.path.join | |
@@ -268,14 +267,22 b' if sys.version_info < (3, 3):' | |||||
268 | extras_require['notebook'].extend(extras_require['nbformat']) |
|
267 | extras_require['notebook'].extend(extras_require['nbformat']) | |
269 | extras_require['nbconvert'].extend(extras_require['nbformat']) |
|
268 | extras_require['nbconvert'].extend(extras_require['nbformat']) | |
270 |
|
269 | |||
271 |
install_requires = [ |
|
270 | install_requires = [ | |
|
271 | 'decorator', | |||
|
272 | 'pickleshare', | |||
|
273 | 'simplegeneric>0.8', | |||
|
274 | ] | |||
272 |
|
275 | |||
273 | # add readline |
|
276 | # add platform-specific dependencies | |
274 | if sys.platform == 'darwin': |
|
277 | if sys.platform == 'darwin': | |
275 | if 'bdist_wheel' in sys.argv[1:] or not setupext.check_for_readline(): |
|
278 | install_requires.append('appnope') | |
|
279 | if 'bdist_wheel' in sys.argv[1:] or not check_for_readline(): | |||
276 | install_requires.append('gnureadline') |
|
280 | install_requires.append('gnureadline') | |
277 | elif sys.platform.startswith('win'): |
|
281 | ||
|
282 | if sys.platform.startswith('win'): | |||
278 | extras_require['terminal'].append('pyreadline>=2.0') |
|
283 | extras_require['terminal'].append('pyreadline>=2.0') | |
|
284 | else: | |||
|
285 | install_requires.append('pexpect') | |||
279 |
|
286 | |||
280 | everything = set() |
|
287 | everything = set() | |
281 | for deps in extras_require.values(): |
|
288 | for deps in extras_require.values(): | |
@@ -317,13 +324,6 b" if 'setuptools' in sys.modules:" | |||||
317 | "ipython_win_post_install.py"}} |
|
324 | "ipython_win_post_install.py"}} | |
318 |
|
325 | |||
319 | else: |
|
326 | else: | |
320 | # If we are installing without setuptools, call this function which will |
|
|||
321 | # check for dependencies an inform the user what is needed. This is |
|
|||
322 | # just to make life easy for users. |
|
|||
323 | for install_cmd in ('install', 'symlink'): |
|
|||
324 | if install_cmd in sys.argv: |
|
|||
325 | check_for_dependencies() |
|
|||
326 | break |
|
|||
327 | # scripts has to be a non-empty list, or install_scripts isn't called |
|
327 | # scripts has to be a non-empty list, or install_scripts isn't called | |
328 | setup_args['scripts'] = [e.split('=')[0].strip() for e in find_entry_points()] |
|
328 | setup_args['scripts'] = [e.split('=')[0].strip() for e in find_entry_points()] | |
329 |
|
329 |
@@ -490,37 +490,23 b' class install_scripts_for_symlink(install_scripts):' | |||||
490 | # Verify all dependencies |
|
490 | # Verify all dependencies | |
491 | #--------------------------------------------------------------------------- |
|
491 | #--------------------------------------------------------------------------- | |
492 |
|
492 | |||
493 |
def check_for_ |
|
493 | def check_for_readline(): | |
494 | """Check for IPython's dependencies. |
|
494 | """Check for GNU readline""" | |
495 |
|
495 | try: | ||
496 | This function should NOT be called if running under setuptools! |
|
496 | import gnureadline as readline | |
497 | """ |
|
497 | except ImportError: | |
498 | from setupext.setupext import ( |
|
498 | pass | |
499 | print_line, print_raw, print_status, |
|
499 | else: | |
500 | check_for_sphinx, check_for_pygments, |
|
500 | return True | |
501 | check_for_nose, check_for_pexpect, |
|
501 | try: | |
502 | check_for_pyzmq, check_for_readline, |
|
502 | import readline | |
503 | check_for_jinja2, check_for_tornado |
|
503 | except ImportError: | |
504 | ) |
|
504 | return False | |
505 | print_line() |
|
505 | else: | |
506 | print_raw("BUILDING IPYTHON") |
|
506 | if sys.platform == 'darwin' and 'libedit' in readline.__doc__: | |
507 | print_status('python', sys.version) |
|
507 | print("Ignoring readline linked to libedit", file=sys.stderr) | |
508 | print_status('platform', sys.platform) |
|
508 | return False | |
509 | if sys.platform == 'win32': |
|
509 | return True | |
510 | print_status('Windows version', sys.getwindowsversion()) |
|
|||
511 |
|
||||
512 | print_raw("") |
|
|||
513 | print_raw("OPTIONAL DEPENDENCIES") |
|
|||
514 |
|
||||
515 | check_for_sphinx() |
|
|||
516 | check_for_pygments() |
|
|||
517 | check_for_nose() |
|
|||
518 | if os.name == 'posix': |
|
|||
519 | check_for_pexpect() |
|
|||
520 | check_for_pyzmq() |
|
|||
521 | check_for_tornado() |
|
|||
522 | check_for_readline() |
|
|||
523 | check_for_jinja2() |
|
|||
524 |
|
510 | |||
525 | #--------------------------------------------------------------------------- |
|
511 | #--------------------------------------------------------------------------- | |
526 | # VCS related |
|
512 | # VCS related | |
@@ -670,7 +656,7 b' def get_bdist_wheel():' | |||||
670 | if found: |
|
656 | if found: | |
671 | lis.pop(idx) |
|
657 | lis.pop(idx) | |
672 |
|
658 | |||
673 | for pkg in ("gnureadline", "pyreadline", "mock", "terminado"): |
|
659 | for pkg in ("gnureadline", "pyreadline", "mock", "terminado", "appnope", "pexpect"): | |
674 | _remove_startswith(requires, pkg) |
|
660 | _remove_startswith(requires, pkg) | |
675 | requires.append("gnureadline; sys.platform == 'darwin' and platform.python_implementation == 'CPython'") |
|
661 | requires.append("gnureadline; sys.platform == 'darwin' and platform.python_implementation == 'CPython'") | |
676 | requires.append("terminado (>=0.3.3); extra == 'notebook' and sys.platform != 'win32'") |
|
662 | requires.append("terminado (>=0.3.3); extra == 'notebook' and sys.platform != 'win32'") | |
@@ -678,6 +664,8 b' def get_bdist_wheel():' | |||||
678 | requires.append("pyreadline (>=2.0); extra == 'terminal' and sys.platform == 'win32' and platform.python_implementation == 'CPython'") |
|
664 | requires.append("pyreadline (>=2.0); extra == 'terminal' and sys.platform == 'win32' and platform.python_implementation == 'CPython'") | |
679 | requires.append("pyreadline (>=2.0); extra == 'all' and sys.platform == 'win32' and platform.python_implementation == 'CPython'") |
|
665 | requires.append("pyreadline (>=2.0); extra == 'all' and sys.platform == 'win32' and platform.python_implementation == 'CPython'") | |
680 | requires.append("mock; extra == 'test' and python_version < '3.3'") |
|
666 | requires.append("mock; extra == 'test' and python_version < '3.3'") | |
|
667 | requires.append("appnope; sys.platform == 'darwin'") | |||
|
668 | requires.append("pexpect; sys.platform != 'win32'") | |||
681 | for r in requires: |
|
669 | for r in requires: | |
682 | pkg_info['Requires-Dist'] = r |
|
670 | pkg_info['Requires-Dist'] = r | |
683 | write_pkg_info(metadata_path, pkg_info) |
|
671 | write_pkg_info(metadata_path, pkg_info) |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed | ||
This diff has been collapsed as it changes many lines, (1267 lines changed) Show them Hide them |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed | ||
This diff has been collapsed as it changes many lines, (2123 lines changed) Show them Hide them |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now