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