##// END OF EJS Templates
typo and reformat
Matthias Bussonnier -
Show More
@@ -28,7 +28,7 b' import sys'
28 # Don't forget to also update setup.py when this changes!
28 # Don't forget to also update setup.py when this changes!
29 if sys.version_info < (3, 8):
29 if sys.version_info < (3, 8):
30 raise ImportError(
30 raise ImportError(
31 """
31 """
32 IPython 8+ supports Python 3.8 and above, following NEP 29.
32 IPython 8+ supports Python 3.8 and above, following NEP 29.
33 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
33 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
34 Python 3.3 and 3.4 were supported up to IPython 6.x.
34 Python 3.3 and 3.4 were supported up to IPython 6.x.
@@ -40,7 +40,8 b' See IPython `README.rst` file for more information:'
40
40
41 https://github.com/ipython/ipython/blob/master/README.rst
41 https://github.com/ipython/ipython/blob/master/README.rst
42
42
43 """)
43 """
44 )
44
45
45 #-----------------------------------------------------------------------------
46 #-----------------------------------------------------------------------------
46 # Setup the top level names
47 # Setup the top level names
@@ -40,7 +40,7 b' class IPyAutocall(object):'
40 self._ip = ip
40 self._ip = ip
41
41
42 def set_ip(self, ip):
42 def set_ip(self, ip):
43 """ Will be used to set _ip point to current ipython instance b/f call
43 """Will be used to set _ip point to current ipython instance b/f call
44
44
45 Override this method if you don't want this to happen.
45 Override this method if you don't want this to happen.
46
46
@@ -589,7 +589,7 b' class Completer(Configurable):'
589
589
590 This will enable completion on elements of lists, results of function calls, etc.,
590 This will enable completion on elements of lists, results of function calls, etc.,
591 but can be unsafe because the code is actually evaluated on TAB.
591 but can be unsafe because the code is actually evaluated on TAB.
592 """
592 """,
593 ).tag(config=True)
593 ).tag(config=True)
594
594
595 use_jedi = Bool(default_value=JEDI_INSTALLED,
595 use_jedi = Bool(default_value=JEDI_INSTALLED,
@@ -166,7 +166,7 b' class HistoryAccessor(HistoryAccessorBase):'
166 in which case there will be no stored history, no SQLite connection,
166 in which case there will be no stored history, no SQLite connection,
167 and no background saving thread. This may be necessary in some
167 and no background saving thread. This may be necessary in some
168 threaded environments where IPython is embedded.
168 threaded environments where IPython is embedded.
169 """
169 """,
170 ).tag(config=True)
170 ).tag(config=True)
171
171
172 connection_options = Dict(
172 connection_options = Dict(
@@ -213,14 +213,17 b' class ExecutionInfo(object):'
213 raw_cell = (
213 raw_cell = (
214 (self.raw_cell[:50] + "..") if len(self.raw_cell) > 50 else self.raw_cell
214 (self.raw_cell[:50] + "..") if len(self.raw_cell) > 50 else self.raw_cell
215 )
215 )
216 return '<%s object at %x, raw_cell="%s" store_history=%s silent=%s shell_futures=%s cell_id=%s>' % (
216 return (
217 name,
217 '<%s object at %x, raw_cell="%s" store_history=%s silent=%s shell_futures=%s cell_id=%s>'
218 id(self),
218 % (
219 raw_cell,
219 name,
220 self.store_history,
220 id(self),
221 self.silent,
221 raw_cell,
222 self.shell_futures,
222 self.store_history,
223 self.cell_id,
223 self.silent,
224 self.shell_futures,
225 self.cell_id,
226 )
224 )
227 )
225
228
226
229
@@ -511,7 +511,7 b' class ExecutionMagics(Magics):'
511 """Run the named file inside IPython as a program.
511 """Run the named file inside IPython as a program.
512
512
513 Usage::
513 Usage::
514
514
515 %run [-n -i -e -G]
515 %run [-n -i -e -G]
516 [( -t [-N<N>] | -d [-b<N>] | -p [profile options] )]
516 [( -t [-N<N>] | -d [-b<N>] | -p [profile options] )]
517 ( -m mod | filename ) [args]
517 ( -m mod | filename ) [args]
@@ -552,7 +552,7 b' class ExecutionMagics(Magics):'
552 *two* back slashes (e.g. ``\\\\*``) to suppress expansions.
552 *two* back slashes (e.g. ``\\\\*``) to suppress expansions.
553 To completely disable these expansions, you can use -G flag.
553 To completely disable these expansions, you can use -G flag.
554
554
555 On Windows systems, the use of single quotes `'` when specifying
555 On Windows systems, the use of single quotes `'` when specifying
556 a file is not supported. Use double quotes `"`.
556 a file is not supported. Use double quotes `"`.
557
557
558 Options:
558 Options:
@@ -58,8 +58,8 b' def script_args(f):'
58 '--no-raise-error', action="store_false", dest='raise_error',
58 '--no-raise-error', action="store_false", dest='raise_error',
59 help="""Whether you should raise an error message in addition to
59 help="""Whether you should raise an error message in addition to
60 a stream on stderr if you get a nonzero exit code.
60 a stream on stderr if you get a nonzero exit code.
61 """
61 """,
62 )
62 ),
63 ]
63 ]
64 for arg in args:
64 for arg in args:
65 f = arg(f)
65 f = arg(f)
@@ -87,7 +87,8 b' g()'
87
87
88 #####
88 #####
89
89
90 MULTILINE_SYSTEM_ASSIGN_AFTER_DEDENT = ("""\
90 MULTILINE_SYSTEM_ASSIGN_AFTER_DEDENT = (
91 """\
91 def test():
92 def test():
92 for i in range(1):
93 for i in range(1):
93 print(i)
94 print(i)
@@ -547,7 +547,7 b' class TestSafeExecfileNonAsciiPath(unittest.TestCase):'
547 self.TESTDIR = join(self.BASETESTDIR, u"åäö")
547 self.TESTDIR = join(self.BASETESTDIR, u"åäö")
548 os.mkdir(self.TESTDIR)
548 os.mkdir(self.TESTDIR)
549 with open(
549 with open(
550 join(self.TESTDIR, u"åäötestscript.py"), "w", encoding="utf-8"
550 join(self.TESTDIR, "åäötestscript.py"), "w", encoding="utf-8"
551 ) as sfile:
551 ) as sfile:
552 sfile.write("pass\n")
552 sfile.write("pass\n")
553 self.oldpath = os.getcwd()
553 self.oldpath = os.getcwd()
@@ -236,7 +236,8 b' def test_run_cell():'
236 if 4:
236 if 4:
237 print "bar"
237 print "bar"
238
238
239 """)
239 """
240 )
240 # Simply verifies that this kind of input is run
241 # Simply verifies that this kind of input is run
241 ip.run_cell(complex)
242 ip.run_cell(complex)
242
243
@@ -448,7 +448,9 b' def test_multiline_time():'
448 ip = get_ipython()
448 ip = get_ipython()
449 ip.user_ns.pop('run', None)
449 ip.user_ns.pop('run', None)
450
450
451 ip.run_cell(dedent("""\
451 ip.run_cell(
452 dedent(
453 """\
452 %%time
454 %%time
453 a = "ho"
455 a = "ho"
454 b = "hey"
456 b = "hey"
@@ -122,7 +122,8 b' class PasteTestCase(TestCase):'
122 ip.user_ns.pop("x")
122 ip.user_ns.pop("x")
123
123
124 def test_paste_py_multi(self):
124 def test_paste_py_multi(self):
125 self.paste("""
125 self.paste(
126 """
126 >>> x = [1,2,3]
127 >>> x = [1,2,3]
127 >>> y = []
128 >>> y = []
128 >>> for i in x:
129 >>> for i in x:
@@ -145,7 +146,8 b' class PasteTestCase(TestCase):'
145
146
146 def test_paste_email(self):
147 def test_paste_email(self):
147 "Test pasting of email-quoted contents"
148 "Test pasting of email-quoted contents"
148 self.paste("""\
149 self.paste(
150 """\
149 >> def foo(x):
151 >> def foo(x):
150 >> return x + 1
152 >> return x + 1
151 >> xx = foo(1.1)"""
153 >> xx = foo(1.1)"""
@@ -154,7 +156,8 b' class PasteTestCase(TestCase):'
154
156
155 def test_paste_email2(self):
157 def test_paste_email2(self):
156 "Email again; some programs add a space also at each quoting level"
158 "Email again; some programs add a space also at each quoting level"
157 self.paste("""\
159 self.paste(
160 """\
158 > > def foo(x):
161 > > def foo(x):
159 > > return x + 1
162 > > return x + 1
160 > > yy = foo(2.1) """
163 > > yy = foo(2.1) """
@@ -163,7 +166,8 b' class PasteTestCase(TestCase):'
163
166
164 def test_paste_email_py(self):
167 def test_paste_email_py(self):
165 "Email quoting of interactive input"
168 "Email quoting of interactive input"
166 self.paste("""\
169 self.paste(
170 """\
167 >> >>> def f(x):
171 >> >>> def f(x):
168 >> ... return x+1
172 >> ... return x+1
169 >> ...
173 >> ...
@@ -108,7 +108,7 b' def test_list_profiles_in():'
108 for name in ("profile_foo", "profile_hello", "not_a_profile"):
108 for name in ("profile_foo", "profile_hello", "not_a_profile"):
109 Path(td / name).mkdir(parents=True)
109 Path(td / name).mkdir(parents=True)
110 if dec.unicode_paths:
110 if dec.unicode_paths:
111 Path(td / u"profile_ünicode").mkdir(parents=True)
111 Path(td / "profile_ünicode").mkdir(parents=True)
112
112
113 with open(td / "profile_file", "w", encoding="utf-8") as f:
113 with open(td / "profile_file", "w", encoding="utf-8") as f:
114 f.write("I am not a profile directory")
114 f.write("I am not a profile directory")
@@ -66,7 +66,9 b' class ImportDenier(importlib.abc.MetaPathFinder):'
66 """
66 """
67 Importing %s disabled by IPython, which has
67 Importing %s disabled by IPython, which has
68 already imported an Incompatible QT Binding: %s
68 already imported an Incompatible QT Binding: %s
69 """ % (fullname, loaded_api()))
69 """
70 % (fullname, loaded_api())
71 )
70
72
71
73
72 ID = ImportDenier()
74 ID = ImportDenier()
@@ -103,9 +103,9 b' class Audio(DisplayObject):'
103 See Also
103 See Also
104 --------
104 --------
105 ipywidgets.Audio
105 ipywidgets.Audio
106
106
107 AUdio widget with more more flexibility and options.
107 Audio widget with more more flexibility and options.
108
108
109 """
109 """
110 _read_flags = 'rb'
110 _read_flags = 'rb'
111
111
@@ -510,12 +510,10 b' class FileLinks(FileLink):'
510
510
511 self.recursive = recursive
511 self.recursive = recursive
512
512
513 def _get_display_formatter(self,
513 def _get_display_formatter(
514 dirname_output_format,
514 self, dirname_output_format, fname_output_format, fp_format, fp_cleaner=None
515 fname_output_format,
515 ):
516 fp_format,
516 """generate built-in formatter function
517 fp_cleaner=None):
518 """ generate built-in formatter function
519
517
520 this is used to define both the notebook and terminal built-in
518 this is used to define both the notebook and terminal built-in
521 formatters as they only differ by some wrapper text for each entry
519 formatters as they only differ by some wrapper text for each entry
@@ -31,7 +31,7 b' def no_op(*args, **kwargs):'
31
31
32
32
33 @onlyif_cmds_exist("latex", "dvipng")
33 @onlyif_cmds_exist("latex", "dvipng")
34 @pytest.mark.parametrize("s, wrap", [(u"$$x^2$$", False), (u"x^2", True)])
34 @pytest.mark.parametrize("s, wrap", [("$$x^2$$", False), ("x^2", True)])
35 def test_latex_to_png_dvipng_runs(s, wrap):
35 def test_latex_to_png_dvipng_runs(s, wrap):
36 """
36 """
37 Test that latex_to_png_dvipng just runs without error.
37 Test that latex_to_png_dvipng just runs without error.
@@ -273,7 +273,7 b' def test_unicode_repr():'
273 p = pretty.pretty(c)
273 p = pretty.pretty(c)
274 assert p == u
274 assert p == u
275 p = pretty.pretty([c])
275 p = pretty.pretty([c])
276 assert p == u"[%s]" % u
276 assert p == "[%s]" % u
277
277
278
278
279 def test_basic_class():
279 def test_basic_class():
@@ -38,7 +38,7 b' def ipfunc():'
38 ....: print(i, end=' ')
38 ....: print(i, end=' ')
39 ....: print(i+1, end=' ')
39 ....: print(i+1, end=' ')
40 ....:
40 ....:
41 0 1 1 2 2 3
41 0 1 1 2 2 3
42
42
43
43
44 It's OK to use '_' for the last result, but do NOT try to use IPython's
44 It's OK to use '_' for the last result, but do NOT try to use IPython's
@@ -50,7 +50,7 b' def ipfunc():'
50
50
51 In [8]: print(repr(_))
51 In [8]: print(repr(_))
52 'hi'
52 'hi'
53
53
54 In [7]: 3+4
54 In [7]: 3+4
55 Out[7]: 7
55 Out[7]: 7
56
56
@@ -782,7 +782,7 b' def _init_checker_class() -> Type["IPDoctestOutputChecker"]:'
782 precision = 0 if fraction is None else len(fraction)
782 precision = 0 if fraction is None else len(fraction)
783 if exponent is not None:
783 if exponent is not None:
784 precision -= int(exponent)
784 precision -= int(exponent)
785 if float(w.group()) == approx(float(g.group()), abs=10 ** -precision):
785 if float(w.group()) == approx(float(g.group()), abs=10**-precision):
786 # They're close enough. Replace the text we actually
786 # They're close enough. Replace the text we actually
787 # got with the text we want, so that it will match when we
787 # got with the text we want, so that it will match when we
788 # check the string literally.
788 # check the string literally.
@@ -470,11 +470,11 b' def strip_ansi(source):'
470
470
471 class EvalFormatter(Formatter):
471 class EvalFormatter(Formatter):
472 """A String Formatter that allows evaluation of simple expressions.
472 """A String Formatter that allows evaluation of simple expressions.
473
473
474 Note that this version interprets a `:` as specifying a format string (as per
474 Note that this version interprets a `:` as specifying a format string (as per
475 standard string formatting), so if slicing is required, you must explicitly
475 standard string formatting), so if slicing is required, you must explicitly
476 create a slice.
476 create a slice.
477
477
478 This is to be used in templating cases, such as the parallel batch
478 This is to be used in templating cases, such as the parallel batch
479 script templates, where simple arithmetic on arguments is useful.
479 script templates, where simple arithmetic on arguments is useful.
480
480
@@ -690,8 +690,8 b' def compute_item_matrix(items, row_first=False, empty=None, *args, **kwargs) :'
690 return ([[_get_or_default(items, c * nrow + r, default=empty) for c in range(ncol)] for r in range(nrow)], info)
690 return ([[_get_or_default(items, c * nrow + r, default=empty) for c in range(ncol)] for r in range(nrow)], info)
691
691
692
692
693 def columnize(items, row_first=False, separator=' ', displaywidth=80, spread=False):
693 def columnize(items, row_first=False, separator=" ", displaywidth=80, spread=False):
694 """ Transform a list of strings into a single string with columns.
694 """Transform a list of strings into a single string with columns.
695
695
696 Parameters
696 Parameters
697 ----------
697 ----------
General Comments 0
You need to be logged in to leave comments. Login now