Show More
@@ -18,7 +18,6 b' http://ipython.org' | |||
|
18 | 18 | #----------------------------------------------------------------------------- |
|
19 | 19 | # Imports |
|
20 | 20 | #----------------------------------------------------------------------------- |
|
21 | from __future__ import absolute_import | |
|
22 | 21 | |
|
23 | 22 | import os |
|
24 | 23 | import sys |
@@ -25,7 +25,6 b' Authors' | |||
|
25 | 25 | #----------------------------------------------------------------------------- |
|
26 | 26 | # Imports |
|
27 | 27 | #----------------------------------------------------------------------------- |
|
28 | from __future__ import print_function | |
|
29 | 28 | |
|
30 | 29 | # Stdlib imports |
|
31 | 30 | import __future__ |
@@ -13,7 +13,6 b' upstream and were accepted as of Python 2.3,' | |||
|
13 | 13 | # Some of this code originated from rlcompleter in the Python standard library |
|
14 | 14 | # Copyright (C) 2001 Python Software Foundation, www.python.org |
|
15 | 15 | |
|
16 | from __future__ import print_function | |
|
17 | 16 | |
|
18 | 17 | import __main__ |
|
19 | 18 | import glob |
@@ -14,7 +14,6 b' These are all loaded by default by IPython.' | |||
|
14 | 14 | #----------------------------------------------------------------------------- |
|
15 | 15 | # Imports |
|
16 | 16 | #----------------------------------------------------------------------------- |
|
17 | from __future__ import print_function | |
|
18 | 17 | |
|
19 | 18 | # Stdlib imports |
|
20 | 19 | import glob |
@@ -18,7 +18,6 b' Authors:' | |||
|
18 | 18 | #----------------------------------------------------------------------------- |
|
19 | 19 | # Imports |
|
20 | 20 | #----------------------------------------------------------------------------- |
|
21 | from __future__ import print_function | |
|
22 | 21 | |
|
23 | 22 | import os |
|
24 | 23 | import sys |
@@ -24,7 +24,6 b' http://www.python.org/2.2.3/license.html"""' | |||
|
24 | 24 | # |
|
25 | 25 | # |
|
26 | 26 | #***************************************************************************** |
|
27 | from __future__ import print_function | |
|
28 | 27 | |
|
29 | 28 | import bdb |
|
30 | 29 | import functools |
@@ -4,7 +4,6 b'' | |||
|
4 | 4 | # Copyright (c) IPython Development Team. |
|
5 | 5 | # Distributed under the terms of the Modified BSD License. |
|
6 | 6 | |
|
7 | from __future__ import print_function | |
|
8 | 7 | |
|
9 | 8 | try: |
|
10 | 9 | from base64 import encodebytes as base64_encode |
@@ -7,7 +7,6 b' This defines a callable class that IPython uses for `sys.displayhook`.' | |||
|
7 | 7 | # Copyright (c) IPython Development Team. |
|
8 | 8 | # Distributed under the terms of the Modified BSD License. |
|
9 | 9 | |
|
10 | from __future__ import print_function | |
|
11 | 10 | |
|
12 | 11 | import sys |
|
13 | 12 | import io as _io |
@@ -15,7 +15,6 b' spec.' | |||
|
15 | 15 | # Copyright (c) IPython Development Team. |
|
16 | 16 | # Distributed under the terms of the Modified BSD License. |
|
17 | 17 | |
|
18 | from __future__ import print_function | |
|
19 | 18 | |
|
20 | 19 | import sys |
|
21 | 20 |
@@ -12,7 +12,6 b' events and the arguments which will be passed to them.' | |||
|
12 | 12 | |
|
13 | 13 | This API is experimental in IPython 2.0, and may be revised in future versions. |
|
14 | 14 | """ |
|
15 | from __future__ import print_function | |
|
16 | 15 | |
|
17 | 16 | class EventManager(object): |
|
18 | 17 | """Manage a collection of events and a sequence of callbacks for each. |
@@ -3,7 +3,6 b'' | |||
|
3 | 3 | # Copyright (c) IPython Development Team. |
|
4 | 4 | # Distributed under the terms of the Modified BSD License. |
|
5 | 5 | |
|
6 | from __future__ import print_function | |
|
7 | 6 | |
|
8 | 7 | import atexit |
|
9 | 8 | import datetime |
@@ -4,7 +4,6 b' An application for managing IPython history.' | |||
|
4 | 4 | |
|
5 | 5 | To be invoked as the `ipython history` subcommand. |
|
6 | 6 | """ |
|
7 | from __future__ import print_function | |
|
8 | 7 | |
|
9 | 8 | import os |
|
10 | 9 | import sqlite3 |
@@ -10,7 +10,6 b'' | |||
|
10 | 10 | # the file COPYING, distributed as part of this software. |
|
11 | 11 | #----------------------------------------------------------------------------- |
|
12 | 12 | |
|
13 | from __future__ import absolute_import, print_function | |
|
14 | 13 | |
|
15 | 14 | import __future__ |
|
16 | 15 | import abc |
@@ -1,6 +1,5 b'' | |||
|
1 | 1 | """Logger class for IPython's logging facilities. |
|
2 | 2 | """ |
|
3 | from __future__ import print_function | |
|
4 | 3 | |
|
5 | 4 | #***************************************************************************** |
|
6 | 5 | # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and |
@@ -1,7 +1,6 b'' | |||
|
1 | 1 | # encoding: utf-8 |
|
2 | 2 | """Magic functions for InteractiveShell. |
|
3 | 3 | """ |
|
4 | from __future__ import print_function | |
|
5 | 4 | |
|
6 | 5 | #----------------------------------------------------------------------------- |
|
7 | 6 | # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and |
@@ -1,7 +1,5 b'' | |||
|
1 | 1 | """Implementation of magic functions that control various automatic behaviors. |
|
2 | 2 | """ |
|
3 | from __future__ import print_function | |
|
4 | from __future__ import absolute_import | |
|
5 | 3 | #----------------------------------------------------------------------------- |
|
6 | 4 | # Copyright (c) 2012 The IPython Development Team. |
|
7 | 5 | # |
@@ -1,7 +1,5 b'' | |||
|
1 | 1 | """Implementation of basic magic functions.""" |
|
2 | 2 | |
|
3 | from __future__ import print_function | |
|
4 | from __future__ import absolute_import | |
|
5 | 3 | |
|
6 | 4 | import argparse |
|
7 | 5 | import io |
@@ -1,7 +1,5 b'' | |||
|
1 | 1 | """Implementation of code management magic functions. |
|
2 | 2 | """ |
|
3 | from __future__ import print_function | |
|
4 | from __future__ import absolute_import | |
|
5 | 3 | #----------------------------------------------------------------------------- |
|
6 | 4 | # Copyright (c) 2012 The IPython Development Team. |
|
7 | 5 | # |
@@ -1,7 +1,5 b'' | |||
|
1 | 1 | """Implementation of configuration-related magic functions. |
|
2 | 2 | """ |
|
3 | from __future__ import print_function | |
|
4 | from __future__ import absolute_import | |
|
5 | 3 | #----------------------------------------------------------------------------- |
|
6 | 4 | # Copyright (c) 2012 The IPython Development Team. |
|
7 | 5 | # |
@@ -4,8 +4,6 b'' | |||
|
4 | 4 | # Copyright (c) IPython Development Team. |
|
5 | 5 | # Distributed under the terms of the Modified BSD License. |
|
6 | 6 | |
|
7 | from __future__ import print_function | |
|
8 | from __future__ import absolute_import | |
|
9 | 7 | |
|
10 | 8 | import ast |
|
11 | 9 | import bdb |
@@ -1,6 +1,5 b'' | |||
|
1 | 1 | """Implementation of magic functions for the extension machinery. |
|
2 | 2 | """ |
|
3 | from __future__ import print_function | |
|
4 | 3 | #----------------------------------------------------------------------------- |
|
5 | 4 | # Copyright (c) 2012 The IPython Development Team. |
|
6 | 5 | # |
@@ -11,7 +11,6 b'' | |||
|
11 | 11 | #----------------------------------------------------------------------------- |
|
12 | 12 | # Imports |
|
13 | 13 | #----------------------------------------------------------------------------- |
|
14 | from __future__ import print_function | |
|
15 | 14 | |
|
16 | 15 | # Stdlib |
|
17 | 16 | import os |
@@ -1,6 +1,5 b'' | |||
|
1 | 1 | """Implementation of namespace-related magic functions. |
|
2 | 2 | """ |
|
3 | from __future__ import print_function | |
|
4 | 3 | #----------------------------------------------------------------------------- |
|
5 | 4 | # Copyright (c) 2012 The IPython Development Team. |
|
6 | 5 | # |
@@ -3,7 +3,6 b'' | |||
|
3 | 3 | Note: this module is named 'osm' instead of 'os' to avoid a collision with the |
|
4 | 4 | builtin. |
|
5 | 5 | """ |
|
6 | from __future__ import print_function | |
|
7 | 6 | #----------------------------------------------------------------------------- |
|
8 | 7 | # Copyright (c) 2012 The IPython Development Team. |
|
9 | 8 | # |
@@ -1,6 +1,5 b'' | |||
|
1 | 1 | """Implementation of magic functions for matplotlib/pylab support. |
|
2 | 2 | """ |
|
3 | from __future__ import print_function | |
|
4 | 3 | #----------------------------------------------------------------------------- |
|
5 | 4 | # Copyright (c) 2012 The IPython Development Team. |
|
6 | 5 | # |
@@ -1,5 +1,4 b'' | |||
|
1 | 1 | """Magic functions for running cells in various scripts.""" |
|
2 | from __future__ import print_function | |
|
3 | 2 | |
|
4 | 3 | # Copyright (c) IPython Development Team. |
|
5 | 4 | # Distributed under the terms of the Modified BSD License. |
@@ -10,8 +10,6 b' reference the name under which an object is being read.' | |||
|
10 | 10 | # Copyright (c) IPython Development Team. |
|
11 | 11 | # Distributed under the terms of the Modified BSD License. |
|
12 | 12 | |
|
13 | from __future__ import print_function | |
|
14 | ||
|
15 | 13 | __all__ = ['Inspector','InspectColors'] |
|
16 | 14 | |
|
17 | 15 | # stdlib modules |
@@ -13,7 +13,6 b' rid of that dependency, we could move it there.' | |||
|
13 | 13 | # Copyright (c) IPython Development Team. |
|
14 | 14 | # Distributed under the terms of the Modified BSD License. |
|
15 | 15 | |
|
16 | from __future__ import print_function | |
|
17 | 16 | |
|
18 | 17 | import os |
|
19 | 18 | import re |
@@ -9,7 +9,6 b' Authors:' | |||
|
9 | 9 | * Min RK |
|
10 | 10 | |
|
11 | 11 | """ |
|
12 | from __future__ import print_function | |
|
13 | 12 | |
|
14 | 13 | #----------------------------------------------------------------------------- |
|
15 | 14 | # Copyright (C) 2008 The IPython Development Team |
@@ -1,6 +1,5 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | """Pylab (matplotlib) support utilities.""" |
|
3 | from __future__ import print_function | |
|
4 | 3 | |
|
5 | 4 | # Copyright (c) IPython Development Team. |
|
6 | 5 | # Distributed under the terms of the Modified BSD License. |
@@ -7,9 +7,6 b' launch InteractiveShell instances, load extensions, etc.' | |||
|
7 | 7 | # Copyright (c) IPython Development Team. |
|
8 | 8 | # Distributed under the terms of the Modified BSD License. |
|
9 | 9 | |
|
10 | from __future__ import absolute_import | |
|
11 | from __future__ import print_function | |
|
12 | ||
|
13 | 10 | import glob |
|
14 | 11 | import os |
|
15 | 12 | import sys |
@@ -1,5 +1,4 b'' | |||
|
1 | 1 | # coding: iso-8859-5 |
|
2 | 2 | # (Unlikely to be the default encoding for most testers.) |
|
3 | 3 | # ������������������� <- Cyrillic characters |
|
4 | from __future__ import unicode_literals | |
|
5 | 4 | u = '����' |
@@ -12,7 +12,6 b' This script is meant to be called by other parts of the test suite that call it' | |||
|
12 | 12 | via %run as if it were executed interactively by the user. As of 2011-05-29, |
|
13 | 13 | test_run.py calls it. |
|
14 | 14 | """ |
|
15 | from __future__ import print_function | |
|
16 | 15 | |
|
17 | 16 | #----------------------------------------------------------------------------- |
|
18 | 17 | # Module imports |
@@ -2,7 +2,6 b'' | |||
|
2 | 2 | |
|
3 | 3 | See test_run for details.""" |
|
4 | 4 | |
|
5 | from __future__ import print_function | |
|
6 | 5 | |
|
7 | 6 | import sys |
|
8 | 7 |
@@ -12,7 +12,6 b'' | |||
|
12 | 12 | #----------------------------------------------------------------------------- |
|
13 | 13 | # Imports |
|
14 | 14 | #----------------------------------------------------------------------------- |
|
15 | from __future__ import print_function | |
|
16 | 15 | |
|
17 | 16 | # Stdlib imports |
|
18 | 17 | import linecache |
@@ -2,7 +2,6 b'' | |||
|
2 | 2 | """Tests for completerlib. |
|
3 | 3 | |
|
4 | 4 | """ |
|
5 | from __future__ import absolute_import | |
|
6 | 5 | |
|
7 | 6 | #----------------------------------------------------------------------------- |
|
8 | 7 | # Imports |
@@ -1,6 +1,5 b'' | |||
|
1 | 1 | """Tests for debugging machinery. |
|
2 | 2 | """ |
|
3 | from __future__ import print_function | |
|
4 | 3 | |
|
5 | 4 | # Copyright (c) IPython Development Team. |
|
6 | 5 | # Distributed under the terms of the Modified BSD License. |
@@ -1,7 +1,6 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | """Tests for CommandChainDispatcher.""" |
|
3 | 3 | |
|
4 | from __future__ import absolute_import | |
|
5 | 4 | |
|
6 | 5 | #----------------------------------------------------------------------------- |
|
7 | 6 | # Imports |
@@ -1,7 +1,6 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | """Tests for the inputsplitter module.""" |
|
3 | 3 | |
|
4 | from __future__ import print_function | |
|
5 | 4 | |
|
6 | 5 | # Copyright (c) IPython Development Team. |
|
7 | 6 | # Distributed under the terms of the Modified BSD License. |
@@ -143,7 +143,6 b' class InteractiveShellTestCase(unittest.TestCase):' | |||
|
143 | 143 | |
|
144 | 144 | def test_future_flags(self): |
|
145 | 145 | """Check that future flags are used for parsing code (gh-777)""" |
|
146 | ip.run_cell('from __future__ import print_function') | |
|
147 | 146 | try: |
|
148 | 147 | ip.run_cell('prfunc_return_val = print(1,2, sep=" ")') |
|
149 | 148 | assert 'prfunc_return_val' in ip.user_ns |
@@ -151,18 +150,6 b' class InteractiveShellTestCase(unittest.TestCase):' | |||
|
151 | 150 | # Reset compiler flags so we don't mess up other tests. |
|
152 | 151 | ip.compile.reset_compiler_flags() |
|
153 | 152 | |
|
154 | def test_future_unicode(self): | |
|
155 | """Check that unicode_literals is imported from __future__ (gh #786)""" | |
|
156 | try: | |
|
157 | ip.run_cell(u'byte_str = "a"') | |
|
158 | assert isinstance(ip.user_ns['byte_str'], str) # string literals are byte strings by default | |
|
159 | ip.run_cell('from __future__ import unicode_literals') | |
|
160 | ip.run_cell(u'unicode_str = "a"') | |
|
161 | assert isinstance(ip.user_ns['unicode_str'], unicode_type) # strings literals are now unicode | |
|
162 | finally: | |
|
163 | # Reset compiler flags so we don't mess up other tests. | |
|
164 | ip.compile.reset_compiler_flags() | |
|
165 | ||
|
166 | 153 | def test_can_pickle(self): |
|
167 | 154 | "Can we pickle objects defined interactively (GH-29)" |
|
168 | 155 | ip = get_ipython() |
@@ -3,7 +3,6 b'' | |||
|
3 | 3 | |
|
4 | 4 | Needs to be run by nose (to make ipython session available). |
|
5 | 5 | """ |
|
6 | from __future__ import absolute_import | |
|
7 | 6 | |
|
8 | 7 | import io |
|
9 | 8 | import os |
@@ -2,7 +2,6 b'' | |||
|
2 | 2 | |
|
3 | 3 | Needs to be run by nose (to make ipython session available). |
|
4 | 4 | """ |
|
5 | from __future__ import absolute_import | |
|
6 | 5 | |
|
7 | 6 | #----------------------------------------------------------------------------- |
|
8 | 7 | # Imports |
@@ -4,7 +4,6 b'' | |||
|
4 | 4 | # Copyright (c) IPython Development Team. |
|
5 | 5 | # Distributed under the terms of the Modified BSD License. |
|
6 | 6 | |
|
7 | from __future__ import print_function | |
|
8 | 7 | |
|
9 | 8 | import os |
|
10 | 9 | import re |
@@ -15,7 +15,6 b' Authors' | |||
|
15 | 15 | * MinRK |
|
16 | 16 | |
|
17 | 17 | """ |
|
18 | from __future__ import absolute_import | |
|
19 | 18 | |
|
20 | 19 | #----------------------------------------------------------------------------- |
|
21 | 20 | # Imports |
@@ -4,7 +4,6 b'' | |||
|
4 | 4 | # Copyright (c) IPython Development Team. |
|
5 | 5 | # Distributed under the terms of the Modified BSD License. |
|
6 | 6 | |
|
7 | from __future__ import print_function | |
|
8 | 7 | |
|
9 | 8 | from io import UnsupportedOperation, BytesIO |
|
10 | 9 |
@@ -11,7 +11,6 b' and we do so in a common test_magic file.' | |||
|
11 | 11 | # Copyright (c) IPython Development Team. |
|
12 | 12 | # Distributed under the terms of the Modified BSD License. |
|
13 | 13 | |
|
14 | from __future__ import absolute_import | |
|
15 | 14 | |
|
16 | 15 | |
|
17 | 16 | import functools |
@@ -88,9 +88,6 b' Inheritance diagram:' | |||
|
88 | 88 | # the file COPYING, distributed as part of this software. |
|
89 | 89 | #***************************************************************************** |
|
90 | 90 | |
|
91 | from __future__ import absolute_import | |
|
92 | from __future__ import unicode_literals | |
|
93 | from __future__ import print_function | |
|
94 | 91 | |
|
95 | 92 | import dis |
|
96 | 93 | import inspect |
@@ -87,7 +87,6 b' Some of the known remaining caveats are:' | |||
|
87 | 87 | |
|
88 | 88 | - C extension modules cannot be reloaded, and so cannot be autoreloaded. |
|
89 | 89 | """ |
|
90 | from __future__ import print_function | |
|
91 | 90 | |
|
92 | 91 | skip_doctest = True |
|
93 | 92 |
@@ -9,7 +9,6 b' To automatically restore stored variables at startup, add this to your' | |||
|
9 | 9 | |
|
10 | 10 | c.StoreMagics.autorestore = True |
|
11 | 11 | """ |
|
12 | from __future__ import print_function | |
|
13 | 12 | |
|
14 | 13 | # Copyright (c) IPython Development Team. |
|
15 | 14 | # Distributed under the terms of the Modified BSD License. |
@@ -21,7 +21,6 b' separate implementation).' | |||
|
21 | 21 | An example notebook is provided in our documentation illustrating interactive |
|
22 | 22 | use of the system. |
|
23 | 23 | """ |
|
24 | from __future__ import print_function | |
|
25 | 24 | |
|
26 | 25 | #***************************************************************************** |
|
27 | 26 | # Copyright (C) 2005-2006 Fernando Perez <fperez@colorado.edu> |
@@ -25,7 +25,6 b' A reference to the original :func:`python:reload` is stored in this module as' | |||
|
25 | 25 | This code is almost entirely based on knee.py, which is a Python |
|
26 | 26 | re-implementation of hierarchical module import. |
|
27 | 27 | """ |
|
28 | from __future__ import print_function | |
|
29 | 28 | #***************************************************************************** |
|
30 | 29 | # Copyright (C) 2001 Nathaniel Gray <n8gray@caltech.edu> |
|
31 | 30 | # |
@@ -170,7 +170,6 b' The following is a very simple example of a valid demo file.' | |||
|
170 | 170 | ################### END EXAMPLE DEMO <ex_demo.py> ############################ |
|
171 | 171 | """ |
|
172 | 172 | |
|
173 | from __future__ import unicode_literals | |
|
174 | 173 | |
|
175 | 174 | #***************************************************************************** |
|
176 | 175 | # Copyright (C) 2005-2006 Fernando Perez. <Fernando.Perez@colorado.edu> |
@@ -179,7 +178,6 b' from __future__ import unicode_literals' | |||
|
179 | 178 | # the file COPYING, distributed as part of this software. |
|
180 | 179 | # |
|
181 | 180 | #***************************************************************************** |
|
182 | from __future__ import print_function | |
|
183 | 181 | |
|
184 | 182 | import os |
|
185 | 183 | import re |
@@ -4,7 +4,6 b' They should honor the line number argument, at least.' | |||
|
4 | 4 | |
|
5 | 5 | Contributions are *very* welcome. |
|
6 | 6 | """ |
|
7 | from __future__ import print_function | |
|
8 | 7 | |
|
9 | 8 | import os |
|
10 | 9 | import pipes |
@@ -2,7 +2,6 b'' | |||
|
2 | 2 | """ |
|
3 | 3 | GLUT Inputhook support functions |
|
4 | 4 | """ |
|
5 | from __future__ import print_function | |
|
6 | 5 | |
|
7 | 6 | #----------------------------------------------------------------------------- |
|
8 | 7 | # Copyright (C) 2008-2011 The IPython Development Team |
@@ -77,7 +77,6 b' Inheritance diagram:' | |||
|
77 | 77 | Portions (c) 2009 by Robert Kern. |
|
78 | 78 | :license: BSD License. |
|
79 | 79 | """ |
|
80 | from __future__ import print_function | |
|
81 | 80 | from contextlib import contextmanager |
|
82 | 81 | import sys |
|
83 | 82 | import types |
@@ -11,7 +11,6 b'' | |||
|
11 | 11 | #----------------------------------------------------------------------------- |
|
12 | 12 | # Imports |
|
13 | 13 | #----------------------------------------------------------------------------- |
|
14 | from __future__ import print_function | |
|
15 | 14 | |
|
16 | 15 | # Stdlib imports |
|
17 | 16 | import time |
@@ -12,7 +12,6 b'' | |||
|
12 | 12 | #----------------------------------------------------------------------------- |
|
13 | 13 | # Imports |
|
14 | 14 | #----------------------------------------------------------------------------- |
|
15 | from __future__ import print_function | |
|
16 | 15 | from tempfile import NamedTemporaryFile, mkdtemp |
|
17 | 16 | from os.path import split, join as pjoin, dirname |
|
18 | 17 |
@@ -4,7 +4,6 b'' | |||
|
4 | 4 | # Copyright (c) IPython Development Team. |
|
5 | 5 | # Distributed under the terms of the Modified BSD License. |
|
6 | 6 | |
|
7 | from __future__ import print_function | |
|
8 | 7 | |
|
9 | 8 | from collections import Counter, defaultdict, deque, OrderedDict |
|
10 | 9 | import types, string |
@@ -119,7 +119,6 b' Authors' | |||
|
119 | 119 | - VáclavŠmilauer <eudoxos-AT-arcig.cz>: Prompt generalizations. |
|
120 | 120 | - Skipper Seabold, refactoring, cleanups, pure python addition |
|
121 | 121 | """ |
|
122 | from __future__ import print_function | |
|
123 | 122 | |
|
124 | 123 | #----------------------------------------------------------------------------- |
|
125 | 124 | # Imports |
@@ -5,8 +5,6 b' An embedded IPython shell.' | |||
|
5 | 5 | # Copyright (c) IPython Development Team. |
|
6 | 6 | # Distributed under the terms of the Modified BSD License. |
|
7 | 7 | |
|
8 | from __future__ import with_statement | |
|
9 | from __future__ import print_function | |
|
10 | 8 | |
|
11 | 9 | import sys |
|
12 | 10 | import warnings |
@@ -1,5 +1,4 b'' | |||
|
1 | 1 | """IPython terminal interface using prompt_toolkit""" |
|
2 | from __future__ import print_function | |
|
3 | 2 | |
|
4 | 3 | import os |
|
5 | 4 | import sys |
@@ -8,8 +8,6 b' line :command:`ipython` program.' | |||
|
8 | 8 | # Copyright (c) IPython Development Team. |
|
9 | 9 | # Distributed under the terms of the Modified BSD License. |
|
10 | 10 | |
|
11 | from __future__ import absolute_import | |
|
12 | from __future__ import print_function | |
|
13 | 11 | |
|
14 | 12 | import logging |
|
15 | 13 | import os |
@@ -3,7 +3,6 b'' | |||
|
3 | 3 | # Copyright (c) IPython Development Team. |
|
4 | 4 | # Distributed under the terms of the Modified BSD License. |
|
5 | 5 | |
|
6 | from __future__ import print_function | |
|
7 | 6 | |
|
8 | 7 | from logging import error |
|
9 | 8 | import os |
@@ -1,5 +1,4 b'' | |||
|
1 | 1 | """Terminal input and output prompts.""" |
|
2 | from __future__ import print_function | |
|
3 | 2 | |
|
4 | 3 | from pygments.token import Token |
|
5 | 4 | import sys |
@@ -1,6 +1,5 b'' | |||
|
1 | 1 | """GLUT Input hook for interactive use with prompt_toolkit |
|
2 | 2 | """ |
|
3 | from __future__ import print_function | |
|
4 | 3 | |
|
5 | 4 | |
|
6 | 5 | # GLUT is quite an old library and it is difficult to ensure proper |
@@ -35,7 +35,6 b' PyGTK input hook for prompt_toolkit.' | |||
|
35 | 35 | Listens on the pipe prompt_toolkit sets up for a notification that it should |
|
36 | 36 | return control to the terminal event loop. |
|
37 | 37 | """ |
|
38 | from __future__ import absolute_import | |
|
39 | 38 | |
|
40 | 39 | import gtk, gobject |
|
41 | 40 |
@@ -1,6 +1,5 b'' | |||
|
1 | 1 | """Enable pyglet to be used interacively with prompt_toolkit |
|
2 | 2 | """ |
|
3 | from __future__ import absolute_import | |
|
4 | 3 | |
|
5 | 4 | import os |
|
6 | 5 | import sys |
@@ -1,6 +1,5 b'' | |||
|
1 | 1 | """Enable wxPython to be used interacively in prompt_toolkit |
|
2 | 2 | """ |
|
3 | from __future__ import absolute_import | |
|
4 | 3 | |
|
5 | 4 | import sys |
|
6 | 5 | import signal |
@@ -24,7 +24,6 b' from IPython.testing.decorators import skip_win32' | |||
|
24 | 24 | |
|
25 | 25 | |
|
26 | 26 | _sample_embed = b""" |
|
27 | from __future__ import print_function | |
|
28 | 27 | import IPython |
|
29 | 28 | |
|
30 | 29 | a = 3 |
@@ -74,7 +73,6 b' def test_nest_embed():' | |||
|
74 | 73 | child = pexpect.spawn(sys.executable, ['-m', 'IPython', '--colors=nocolor'], |
|
75 | 74 | env=env) |
|
76 | 75 | child.expect(ipy_prompt) |
|
77 | child.sendline("from __future__ import print_function") | |
|
78 | 76 | child.expect(ipy_prompt) |
|
79 | 77 | child.sendline("import IPython") |
|
80 | 78 | child.expect(ipy_prompt) |
@@ -5,8 +5,6 b" modifications IPython makes to system behavior don't send the doctest machinery" | |||
|
5 | 5 | into a fit. This code should be considered a gross hack, but it gets the job |
|
6 | 6 | done. |
|
7 | 7 | """ |
|
8 | from __future__ import absolute_import | |
|
9 | from __future__ import print_function | |
|
10 | 8 | |
|
11 | 9 | # Copyright (c) IPython Development Team. |
|
12 | 10 | # Distributed under the terms of the Modified BSD License. |
@@ -17,7 +17,6 b' itself from the command line. There are two ways of running this script:' | |||
|
17 | 17 | # Copyright (c) IPython Development Team. |
|
18 | 18 | # Distributed under the terms of the Modified BSD License. |
|
19 | 19 | |
|
20 | from __future__ import print_function | |
|
21 | 20 | |
|
22 | 21 | import glob |
|
23 | 22 | from io import BytesIO |
@@ -9,7 +9,6 b' test suite.' | |||
|
9 | 9 | # Copyright (c) IPython Development Team. |
|
10 | 10 | # Distributed under the terms of the Modified BSD License. |
|
11 | 11 | |
|
12 | from __future__ import print_function | |
|
13 | 12 | |
|
14 | 13 | import argparse |
|
15 | 14 | import json |
@@ -22,7 +22,6 b' Authors' | |||
|
22 | 22 | - Fernando Perez <Fernando.Perez@berkeley.edu> |
|
23 | 23 | """ |
|
24 | 24 | |
|
25 | from __future__ import absolute_import | |
|
26 | 25 | |
|
27 | 26 | #----------------------------------------------------------------------------- |
|
28 | 27 | # Copyright (C) 2009-2011 The IPython Development Team |
@@ -3,7 +3,6 b'' | |||
|
3 | 3 | This file just contains doctests both using plain python and IPython prompts. |
|
4 | 4 | All tests should be loaded by nose. |
|
5 | 5 | """ |
|
6 | from __future__ import print_function | |
|
7 | 6 | |
|
8 | 7 | def pyfunc(): |
|
9 | 8 | """Some pure python tests... |
@@ -1,7 +1,6 b'' | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | """Nose-based test runner. |
|
3 | 3 | """ |
|
4 | from __future__ import print_function | |
|
5 | 4 | |
|
6 | 5 | from nose.core import main |
|
7 | 6 | from nose.plugins.builtin import plugins |
@@ -2,7 +2,6 b'' | |||
|
2 | 2 | |
|
3 | 3 | This is used by a companion test case. |
|
4 | 4 | """ |
|
5 | from __future__ import print_function | |
|
6 | 5 | |
|
7 | 6 | import gc |
|
8 | 7 |
@@ -3,7 +3,6 b'' | |||
|
3 | 3 | This file just contains doctests both using plain python and IPython prompts. |
|
4 | 4 | All tests should be loaded by nose. |
|
5 | 5 | """ |
|
6 | from __future__ import print_function | |
|
7 | 6 | |
|
8 | 7 | def pyfunc(): |
|
9 | 8 | """Some pure python tests... |
@@ -1,6 +1,5 b'' | |||
|
1 | 1 | """Tests for the decorators we've created for IPython. |
|
2 | 2 | """ |
|
3 | from __future__ import print_function | |
|
4 | 3 | |
|
5 | 4 | # Module imports |
|
6 | 5 | # Std lib |
@@ -13,8 +13,6 b' Tests for testing.tools' | |||
|
13 | 13 | #----------------------------------------------------------------------------- |
|
14 | 14 | # Imports |
|
15 | 15 | #----------------------------------------------------------------------------- |
|
16 | from __future__ import with_statement | |
|
17 | from __future__ import print_function | |
|
18 | 16 | |
|
19 | 17 | import os |
|
20 | 18 | import unittest |
@@ -110,8 +108,7 b' class Test_ipexec_validate(unittest.TestCase, tt.TempFileMixin):' | |||
|
110 | 108 | def test_exception_path(self): |
|
111 | 109 | """Test exception path in exception_validate. |
|
112 | 110 | """ |
|
113 |
self.mktmp(" |
|
|
114 | "import sys\n" | |
|
111 | self.mktmp("import sys\n" | |
|
115 | 112 | "print('A')\n" |
|
116 | 113 | "print('B')\n" |
|
117 | 114 | "print('C', file=sys.stderr)\n" |
@@ -123,8 +120,7 b' class Test_ipexec_validate(unittest.TestCase, tt.TempFileMixin):' | |||
|
123 | 120 | def test_exception_path2(self): |
|
124 | 121 | """Test exception path in exception_validate, expecting windows line endings. |
|
125 | 122 | """ |
|
126 |
self.mktmp(" |
|
|
127 | "import sys\n" | |
|
123 | self.mktmp("import sys\n" | |
|
128 | 124 | "print('A')\n" |
|
129 | 125 | "print('B')\n" |
|
130 | 126 | "print('C', file=sys.stderr)\n" |
@@ -5,7 +5,6 b' Authors' | |||
|
5 | 5 | - Fernando Perez <Fernando.Perez@berkeley.edu> |
|
6 | 6 | """ |
|
7 | 7 | |
|
8 | from __future__ import absolute_import | |
|
9 | 8 | |
|
10 | 9 | #----------------------------------------------------------------------------- |
|
11 | 10 | # Copyright (C) 2009 The IPython Development Team |
@@ -28,9 +28,6 b' It shows how to use the built-in keyword, token and tokenize modules to' | |||
|
28 | 28 | scan Python source code and re-emit it with no changes to its original |
|
29 | 29 | formatting (which is the hard part). |
|
30 | 30 | """ |
|
31 | from __future__ import print_function | |
|
32 | from __future__ import absolute_import | |
|
33 | from __future__ import unicode_literals | |
|
34 | 31 | |
|
35 | 32 | __all__ = ['ANSICodeColors','Parser'] |
|
36 | 33 |
@@ -13,7 +13,6 b' This file is only meant to be imported by process.py, not by end-users.' | |||
|
13 | 13 | #----------------------------------------------------------------------------- |
|
14 | 14 | # Imports |
|
15 | 15 | #----------------------------------------------------------------------------- |
|
16 | from __future__ import print_function | |
|
17 | 16 | |
|
18 | 17 | # Stdlib |
|
19 | 18 | import errno |
@@ -13,7 +13,6 b' This file is only meant to be imported by process.py, not by end-users.' | |||
|
13 | 13 | #----------------------------------------------------------------------------- |
|
14 | 14 | # Imports |
|
15 | 15 | #----------------------------------------------------------------------------- |
|
16 | from __future__ import print_function | |
|
17 | 16 | |
|
18 | 17 | # stdlib |
|
19 | 18 | import os |
@@ -10,7 +10,6 b' This file is meant to be used by process.py' | |||
|
10 | 10 | # the file COPYING, distributed as part of this software. |
|
11 | 11 | #----------------------------------------------------------------------------- |
|
12 | 12 | |
|
13 | from __future__ import print_function | |
|
14 | 13 | |
|
15 | 14 | # stdlib |
|
16 | 15 | import os, sys, threading |
@@ -16,7 +16,6 b' modified to be compatible with Python 2.7 and 3.2+.' | |||
|
16 | 16 | # the file COPYING, distributed as part of this software. |
|
17 | 17 | #----------------------------------------------------------------------------- |
|
18 | 18 | |
|
19 | from __future__ import absolute_import, division, print_function | |
|
20 | 19 | import itertools |
|
21 | 20 | import functools |
|
22 | 21 | import re |
@@ -4,7 +4,6 b'' | |||
|
4 | 4 | # Copyright (c) IPython Development Team. |
|
5 | 5 | # Distributed under the terms of the Modified BSD License. |
|
6 | 6 | |
|
7 | from __future__ import print_function, absolute_import | |
|
8 | 7 | |
|
9 | 8 | import sys |
|
10 | 9 |
@@ -4,7 +4,6 b'' | |||
|
4 | 4 | # Distributed under the terms of the BSD License. The full license is in |
|
5 | 5 | # the file COPYING, distributed as part of this software. |
|
6 | 6 | #***************************************************************************** |
|
7 | from __future__ import absolute_import | |
|
8 | 7 | |
|
9 | 8 | """ |
|
10 | 9 | Color managing related utilities |
@@ -2,7 +2,6 b'' | |||
|
2 | 2 | """ |
|
3 | 3 | Utilities for working with stack frames. |
|
4 | 4 | """ |
|
5 | from __future__ import print_function | |
|
6 | 5 | |
|
7 | 6 | #----------------------------------------------------------------------------- |
|
8 | 7 | # Copyright (C) 2008-2011 The IPython Development Team |
@@ -6,8 +6,6 b' IO related utilities.' | |||
|
6 | 6 | # Copyright (c) IPython Development Team. |
|
7 | 7 | # Distributed under the terms of the Modified BSD License. |
|
8 | 8 | |
|
9 | from __future__ import print_function | |
|
10 | from __future__ import absolute_import | |
|
11 | 9 | |
|
12 | 10 | |
|
13 | 11 | import atexit |
@@ -23,7 +23,6 b' path to module and not an open file object as well.' | |||
|
23 | 23 | #----------------------------------------------------------------------------- |
|
24 | 24 | # Imports |
|
25 | 25 | #----------------------------------------------------------------------------- |
|
26 | from __future__ import print_function | |
|
27 | 26 | |
|
28 | 27 | # Stdlib imports |
|
29 | 28 | import imp |
@@ -4,7 +4,6 b' as per PEP 263.' | |||
|
4 | 4 | |
|
5 | 5 | Much of the code is taken from the tokenize module in Python 3.2. |
|
6 | 6 | """ |
|
7 | from __future__ import absolute_import | |
|
8 | 7 | |
|
9 | 8 | import io |
|
10 | 9 | from io import TextIOWrapper, BytesIO |
@@ -6,7 +6,6 b' Utilities for working with external processes.' | |||
|
6 | 6 | # Copyright (c) IPython Development Team. |
|
7 | 7 | # Distributed under the terms of the Modified BSD License. |
|
8 | 8 | |
|
9 | from __future__ import print_function | |
|
10 | 9 | |
|
11 | 10 | import os |
|
12 | 11 | import sys |
@@ -2,7 +2,6 b'' | |||
|
2 | 2 | |
|
3 | 3 | This is copied from the stdlib and will be standard in Python 3.2 and onwards. |
|
4 | 4 | """ |
|
5 | from __future__ import print_function | |
|
6 | 5 | |
|
7 | 6 | import os as _os |
|
8 | 7 | import warnings as _warnings |
@@ -12,7 +12,6 b'' | |||
|
12 | 12 | # Imports |
|
13 | 13 | #----------------------------------------------------------------------------- |
|
14 | 14 | |
|
15 | from __future__ import print_function | |
|
16 | 15 | |
|
17 | 16 | import sys |
|
18 | 17 |
@@ -4,8 +4,6 b'' | |||
|
4 | 4 | # Copyright (c) IPython Development Team. |
|
5 | 5 | # Distributed under the terms of the Modified BSD License. |
|
6 | 6 | |
|
7 | from __future__ import print_function | |
|
8 | from __future__ import absolute_import | |
|
9 | 7 | |
|
10 | 8 | import io as stdlib_io |
|
11 | 9 | import os.path |
@@ -12,7 +12,6 b'' | |||
|
12 | 12 | # Imports |
|
13 | 13 | #----------------------------------------------------------------------------- |
|
14 | 14 | |
|
15 | from __future__ import with_statement | |
|
16 | 15 | |
|
17 | 16 | import os |
|
18 | 17 | import shutil |
@@ -93,8 +93,7 b' def test_arg_split_win32():' | |||
|
93 | 93 | class SubProcessTestCase(TestCase, tt.TempFileMixin): |
|
94 | 94 | def setUp(self): |
|
95 | 95 | """Make a valid python temp file.""" |
|
96 |
lines = [" |
|
|
97 | "import sys", | |
|
96 | lines = [ "import sys", | |
|
98 | 97 | "print('on stdout', end='', file=sys.stdout)", |
|
99 | 98 | "print('on stderr', end='', file=sys.stderr)", |
|
100 | 99 | "sys.stdout.flush()", |
@@ -1,6 +1,5 b'' | |||
|
1 | 1 | # encoding: utf-8 |
|
2 | 2 | """Tests for IPython.utils.text""" |
|
3 | from __future__ import print_function | |
|
4 | 3 | |
|
5 | 4 | #----------------------------------------------------------------------------- |
|
6 | 5 | # Copyright (C) 2011 The IPython Development Team |
@@ -7,7 +7,6 b' Inheritance diagram:' | |||
|
7 | 7 | .. inheritance-diagram:: IPython.utils.text |
|
8 | 8 | :parts: 3 |
|
9 | 9 | """ |
|
10 | from __future__ import absolute_import | |
|
11 | 10 | |
|
12 | 11 | import os |
|
13 | 12 | import re |
@@ -34,7 +34,6 b' that it produces COMMENT tokens for comments and gives type OP for all' | |||
|
34 | 34 | operators. Additionally, all token lists start with an ENCODING token |
|
35 | 35 | which tells you which encoding was used to decode the bytes stream. |
|
36 | 36 | """ |
|
37 | from __future__ import absolute_import | |
|
38 | 37 | |
|
39 | 38 | __author__ = 'Ka-Ping Yee <ping@lfw.org>' |
|
40 | 39 | __credits__ = ('GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, ' |
@@ -3,7 +3,6 b'' | |||
|
3 | 3 | # Copyright (c) IPython Development Team. |
|
4 | 4 | # Distributed under the terms of the Modified BSD License. |
|
5 | 5 | |
|
6 | from __future__ import absolute_import, print_function | |
|
7 | 6 | |
|
8 | 7 | from collections import namedtuple |
|
9 | 8 | from io import StringIO |
@@ -17,7 +17,6 b' NOTE: this is a modified version of a script originally shipped with the' | |||
|
17 | 17 | PyMVPA project, which we've adapted for NIPY use. PyMVPA is an MIT-licensed |
|
18 | 18 | project.""" |
|
19 | 19 | |
|
20 | from __future__ import print_function | |
|
21 | 20 | |
|
22 | 21 | # Stdlib imports |
|
23 | 22 | import ast |
@@ -8,7 +8,6 b' embedding which you can cut and paste in your code once you understand how' | |||
|
8 | 8 | things work. |
|
9 | 9 | |
|
10 | 10 | The code in this file is deliberately extra-verbose, meant for learning.""" |
|
11 | from __future__ import print_function | |
|
12 | 11 | |
|
13 | 12 | # The basics to get you going: |
|
14 | 13 |
@@ -8,7 +8,6 b' resuming execution later.' | |||
|
8 | 8 | |
|
9 | 9 | This is a unicode test, åäö |
|
10 | 10 | """ |
|
11 | from __future__ import print_function | |
|
12 | 11 | |
|
13 | 12 | print('Hello, welcome to an interactive IPython demo.') |
|
14 | 13 | print('Executing this block should require confirmation before proceeding,') |
@@ -5,7 +5,6 b' http://docs.python.org/2/distutils/builtdist.html#the-postinstallation-script' | |||
|
5 | 5 | |
|
6 | 6 | """ |
|
7 | 7 | |
|
8 | from __future__ import print_function | |
|
9 | 8 | |
|
10 | 9 | import os |
|
11 | 10 | import sys |
@@ -20,7 +20,6 b' requires utilities which are not available under Windows."""' | |||
|
20 | 20 | #----------------------------------------------------------------------------- |
|
21 | 21 | # Minimal Python version sanity check |
|
22 | 22 | #----------------------------------------------------------------------------- |
|
23 | from __future__ import print_function | |
|
24 | 23 | |
|
25 | 24 | import sys |
|
26 | 25 |
@@ -12,7 +12,6 b' This includes:' | |||
|
12 | 12 | # Copyright (c) IPython Development Team. |
|
13 | 13 | # Distributed under the terms of the Modified BSD License. |
|
14 | 14 | |
|
15 | from __future__ import print_function | |
|
16 | 15 | |
|
17 | 16 | import re |
|
18 | 17 | import os |
@@ -26,7 +26,6 b' of that repo.' | |||
|
26 | 26 | |
|
27 | 27 | """ |
|
28 | 28 | |
|
29 | from __future__ import print_function | |
|
30 | 29 | |
|
31 | 30 | import os |
|
32 | 31 | import re |
@@ -8,7 +8,6 b' Usage:' | |||
|
8 | 8 | It prints summaries and if chosen, line-by-line info of where \\t or \\r |
|
9 | 9 | characters can be found in our source tree. |
|
10 | 10 | """ |
|
11 | from __future__ import print_function | |
|
12 | 11 | |
|
13 | 12 | # Config |
|
14 | 13 | # If true, all lines that have tabs are printed, with line number |
@@ -9,7 +9,6 b'' | |||
|
9 | 9 | # |
|
10 | 10 | # The original mapping of latex symbols to unicode comes from the `latex_symbols.jl` files from Julia. |
|
11 | 11 | |
|
12 | from __future__ import print_function | |
|
13 | 12 | import os, sys |
|
14 | 13 | |
|
15 | 14 | if not sys.version_info[0] == 3: |
@@ -1,5 +1,4 b'' | |||
|
1 | 1 | """Functions for Github API requests.""" |
|
2 | from __future__ import print_function | |
|
3 | 2 | |
|
4 | 3 | try: |
|
5 | 4 | input = raw_input |
@@ -7,7 +7,6 b' Usage:' | |||
|
7 | 7 | Type `git mpr -h` for details. |
|
8 | 8 | """ |
|
9 | 9 | |
|
10 | from __future__ import print_function | |
|
11 | 10 | |
|
12 | 11 | import io, os |
|
13 | 12 | import argparse |
@@ -9,7 +9,6 b' To generate a report for IPython 2.0, run:' | |||
|
9 | 9 | # Imports |
|
10 | 10 | #----------------------------------------------------------------------------- |
|
11 | 11 | |
|
12 | from __future__ import print_function | |
|
13 | 12 | |
|
14 | 13 | import codecs |
|
15 | 14 | import sys |
@@ -7,7 +7,6 b' Python, and posts the results to Gist if any tests fail.' | |||
|
7 | 7 | Usage: |
|
8 | 8 | python test_pr.py 1657 |
|
9 | 9 | """ |
|
10 | from __future__ import print_function | |
|
11 | 10 | |
|
12 | 11 | import errno |
|
13 | 12 | from glob import glob |
@@ -1,5 +1,4 b'' | |||
|
1 | 1 | """This tests that future compiler flags are passed to the embedded IPython.""" |
|
2 | from __future__ import division | |
|
3 | 2 | from IPython import embed |
|
4 | 3 | embed(banner1='', header='check 1/2 == 0.5 in Python 2') |
|
5 | 4 | embed(banner1='', header='check 1/2 = 0 in Python 2', compile_flags=0) |
General Comments 0
You need to be logged in to leave comments.
Login now