##// END OF EJS Templates
remove code deprecated since at least IPython 5.0
Matthias Bussonnier -
Show More
@@ -55,6 +55,6 b' jobs:'
55 env:
55 env:
56 COLUMNS: 120
56 COLUMNS: 120
57 run: |
57 run: |
58 pytest --color=yes -ra -v --cov --cov-report=xml
58 pytest --color=yes -raXxs --cov --cov-report=xml
59 - name: Upload coverage to Codecov
59 - name: Upload coverage to Codecov
60 uses: codecov/codecov-action@v2
60 uses: codecov/codecov-action@v2
@@ -161,13 +161,6 b' def no_op(*a, **kw):'
161 class SpaceInInput(Exception): pass
161 class SpaceInInput(Exception): pass
162
162
163
163
164 def get_default_colors():
165 "DEPRECATED"
166 warn('get_default_color is deprecated since IPython 5.0, and returns `Neutral` on all platforms.',
167 DeprecationWarning, stacklevel=2)
168 return 'Neutral'
169
170
171 class SeparateUnicode(Unicode):
164 class SeparateUnicode(Unicode):
172 r"""A Unicode subclass to validate separate_in, separate_out, etc.
165 r"""A Unicode subclass to validate separate_in, separate_out, etc.
173
166
@@ -440,29 +433,6 b' class InteractiveShell(SingletonConfigurable):'
440 will be displayed as regular output instead."""
433 will be displayed as regular output instead."""
441 ).tag(config=True)
434 ).tag(config=True)
442
435
443 # deprecated prompt traits:
444
445 prompt_in1 = Unicode('In [\\#]: ',
446 help="Deprecated since IPython 4.0 and ignored since 5.0, set TerminalInteractiveShell.prompts object directly."
447 ).tag(config=True)
448 prompt_in2 = Unicode(' .\\D.: ',
449 help="Deprecated since IPython 4.0 and ignored since 5.0, set TerminalInteractiveShell.prompts object directly."
450 ).tag(config=True)
451 prompt_out = Unicode('Out[\\#]: ',
452 help="Deprecated since IPython 4.0 and ignored since 5.0, set TerminalInteractiveShell.prompts object directly."
453 ).tag(config=True)
454 prompts_pad_left = Bool(True,
455 help="Deprecated since IPython 4.0 and ignored since 5.0, set TerminalInteractiveShell.prompts object directly."
456 ).tag(config=True)
457
458 @observe('prompt_in1', 'prompt_in2', 'prompt_out', 'prompt_pad_left')
459 def _prompt_trait_changed(self, change):
460 name = change['name']
461 warn("InteractiveShell.{name} is deprecated since IPython 4.0"
462 " and ignored since 5.0, set TerminalInteractiveShell.prompts"
463 " object directly.".format(name=name))
464
465 # protect against weird cases where self.config may not exist:
466
436
467 show_rewritten_input = Bool(True,
437 show_rewritten_input = Bool(True,
468 help="Show rewritten input, e.g. for autocall."
438 help="Show rewritten input, e.g. for autocall."
@@ -2038,19 +2008,6 b' class InteractiveShell(SingletonConfigurable):'
2038 the %paste magic."""
2008 the %paste magic."""
2039 self.showsyntaxerror()
2009 self.showsyntaxerror()
2040
2010
2041 #-------------------------------------------------------------------------
2042 # Things related to readline
2043 #-------------------------------------------------------------------------
2044
2045 def init_readline(self):
2046 """DEPRECATED
2047
2048 Moved to terminal subclass, here only to simplify the init logic."""
2049 # Set a number of methods that depend on readline to be no-op
2050 warnings.warn('`init_readline` is no-op since IPython 5.0 and is Deprecated',
2051 DeprecationWarning, stacklevel=2)
2052 self.set_custom_completer = no_op
2053
2054 @skip_doctest
2011 @skip_doctest
2055 def set_next_input(self, s, replace=False):
2012 def set_next_input(self, s, replace=False):
2056 """ Sets the 'default' input string for the next command line.
2013 """ Sets the 'default' input string for the next command line.
@@ -3513,20 +3470,6 b' class InteractiveShell(SingletonConfigurable):'
3513 file_path.write_text(data)
3470 file_path.write_text(data)
3514 return filename
3471 return filename
3515
3472
3516 @undoc
3517 def write(self,data):
3518 """DEPRECATED: Write a string to the default output"""
3519 warn('InteractiveShell.write() is deprecated, use sys.stdout instead',
3520 DeprecationWarning, stacklevel=2)
3521 sys.stdout.write(data)
3522
3523 @undoc
3524 def write_err(self,data):
3525 """DEPRECATED: Write a string to the default error output"""
3526 warn('InteractiveShell.write_err() is deprecated, use sys.stderr instead',
3527 DeprecationWarning, stacklevel=2)
3528 sys.stderr.write(data)
3529
3530 def ask_yes_no(self, prompt, default=None, interrupt=None):
3473 def ask_yes_no(self, prompt, default=None, interrupt=None):
3531 if self.quiet:
3474 if self.quiet:
3532 return True
3475 return True
@@ -149,8 +149,8 b' class PasteTestCase(TestCase):'
149 def test_paste_echo(self):
149 def test_paste_echo(self):
150 "Also test self.paste echoing, by temporarily faking the writer"
150 "Also test self.paste echoing, by temporarily faking the writer"
151 w = StringIO()
151 w = StringIO()
152 writer = ip.write
152 old_write = sys.stdout.write
153 ip.write = w.write
153 sys.stdout.write = w.write
154 code = """
154 code = """
155 a = 100
155 a = 100
156 b = 200"""
156 b = 200"""
@@ -158,7 +158,7 b' class PasteTestCase(TestCase):'
158 self.paste(code,'')
158 self.paste(code,'')
159 out = w.getvalue()
159 out = w.getvalue()
160 finally:
160 finally:
161 ip.write = writer
161 sys.stdout.write = old_write
162 self.assertEqual(ip.user_ns["a"], 100)
162 self.assertEqual(ip.user_ns["a"], 100)
163 self.assertEqual(ip.user_ns["b"], 200)
163 self.assertEqual(ip.user_ns["b"], 200)
164 assert out == code + "\n## -- End pasted text --\n"
164 assert out == code + "\n## -- End pasted text --\n"
@@ -198,11 +198,10 b' class TerminalMagics(Magics):'
198
198
199 # By default, echo back to terminal unless quiet mode is requested
199 # By default, echo back to terminal unless quiet mode is requested
200 if 'q' not in opts:
200 if 'q' not in opts:
201 write = self.shell.write
201 sys.stdout.write(self.shell.pycolorize(block))
202 write(self.shell.pycolorize(block))
202 if not block.endswith("\n"):
203 if not block.endswith('\n'):
203 sys.stdout.write("\n")
204 write('\n')
204 sys.stdout.write("## -- End pasted text --\n")
205 write("## -- End pasted text --\n")
206
205
207 self.store_or_execute(block, name)
206 self.store_or_execute(block, name)
208
207
@@ -233,11 +233,6 b' def raw_print_err(*args, **kw):'
233 file=sys.__stderr__)
233 file=sys.__stderr__)
234 sys.__stderr__.flush()
234 sys.__stderr__.flush()
235
235
236 # used by IPykernel <- 4.9. Removed during IPython 7-dev period and re-added
237 # Keep for a version or two then should remove
238 rprint = raw_print
239 rprinte = raw_print_err
240
241 @undoc
236 @undoc
242 def unicode_std_stream(stream='stdout'):
237 def unicode_std_stream(stream='stdout'):
243 """DEPRECATED, moved to nbconvert.utils.io"""
238 """DEPRECATED, moved to nbconvert.utils.io"""
General Comments 0
You need to be logged in to leave comments. Login now