Show More
@@ -0,0 +1,47 b'' | |||||
|
1 | IPython debugger (IPdb) now supports the number of context lines for the | |||
|
2 | ``where`` (and ``w``) commands. The `context` keyword is also available in various APIs. | |||
|
3 | ||||
|
4 | .. code:: | |||
|
5 | ||||
|
6 | In [2]: def foo(): | |||
|
7 | ...: 1 | |||
|
8 | ...: 2 | |||
|
9 | ...: 3 | |||
|
10 | ...: 4 | |||
|
11 | ...: 5 | |||
|
12 | ...: raise ValueError('6 is not acceptable') | |||
|
13 | ...: 7 | |||
|
14 | ...: 8 | |||
|
15 | ...: 9 | |||
|
16 | ...: 10 | |||
|
17 | ...: | |||
|
18 | ||||
|
19 | In [3]: foo() | |||
|
20 | ---------------------------------------------------- | |||
|
21 | ValueError Traceback (most recent call last) | |||
|
22 | <ipython-input-3> in <module>() | |||
|
23 | ----> 1 foo() | |||
|
24 | ||||
|
25 | <ipython-input-2> in foo() | |||
|
26 | 5 4 | |||
|
27 | 6 5 | |||
|
28 | ----> 7 raise ValueError('6 is not acceptable') | |||
|
29 | 8 7 | |||
|
30 | 9 8 | |||
|
31 | ||||
|
32 | ValueError: 6 is not acceptable | |||
|
33 | ||||
|
34 | In [4]: debug | |||
|
35 | > <ipython-input-2>(7)foo() | |||
|
36 | 5 4 | |||
|
37 | 6 5 | |||
|
38 | ----> 7 raise ValueError('6 is not acceptable') | |||
|
39 | 8 7 | |||
|
40 | 9 8 | |||
|
41 | ||||
|
42 | ipdb> where 1 | |||
|
43 | <ipython-input-3>(1)<module>() | |||
|
44 | ----> 1 foo() | |||
|
45 | ||||
|
46 | > <ipython-input-2>(7)foo() | |||
|
47 | ----> 7 raise ValueError('6 is not acceptable') |
@@ -10,6 +10,7 b' This document describes in-flight development work.' | |||||
10 | conflicts for other Pull Requests). Instead, create a new file in the |
|
10 | conflicts for other Pull Requests). Instead, create a new file in the | |
11 | `docs/source/whatsnew/pr` folder |
|
11 | `docs/source/whatsnew/pr` folder | |
12 |
|
12 | |||
|
13 | ||||
13 | .. DO NOT EDIT THIS LINE BEFORE RELEASE. FEATURE INSERTION POINT. |
|
14 | .. DO NOT EDIT THIS LINE BEFORE RELEASE. FEATURE INSERTION POINT. | |
14 |
|
15 | |||
15 |
|
16 | |||
@@ -18,4 +19,3 b' Backwards incompatible changes' | |||||
18 |
|
19 | |||
19 |
|
20 | |||
20 | .. DO NOT EDIT THIS LINE BEFORE RELEASE. INCOMPAT INSERTION POINT. |
|
21 | .. DO NOT EDIT THIS LINE BEFORE RELEASE. INCOMPAT INSERTION POINT. | |
21 |
|
@@ -7,6 +7,7 b' whatsnew/development.rst (chronologically ordered), and deletes the snippets.' | |||||
7 |
|
7 | |||
8 | import io |
|
8 | import io | |
9 | import os |
|
9 | import os | |
|
10 | from glob import glob | |||
10 | from os.path import dirname, basename, abspath, join as pjoin |
|
11 | from os.path import dirname, basename, abspath, join as pjoin | |
11 | from subprocess import check_call, check_output |
|
12 | from subprocess import check_call, check_output | |
12 |
|
13 | |||
@@ -20,15 +21,15 b' INCOMPAT_MARK = ".. DO NOT EDIT THIS LINE BEFORE RELEASE. INCOMPAT INSERTION POI' | |||||
20 |
|
21 | |||
21 | # 1. Collect the whatsnew snippet files --------------------------------------- |
|
22 | # 1. Collect the whatsnew snippet files --------------------------------------- | |
22 |
|
23 | |||
23 | files = set(os.listdir(pr_dir)) |
|
24 | files = set() | |
|
25 | for f in glob(pjoin(pr_dir, '*.rst')): | |||
|
26 | files.add(f) | |||
24 | # Ignore explanatory and example files |
|
27 | # Ignore explanatory and example files | |
25 | files.difference_update({'README.md', |
|
28 | files.difference_update({pjoin(pr_dir, f) for f in {'README.md', | |
26 | 'incompat-switching-to-perl.rst', |
|
29 | 'incompat-switching-to-perl.rst', | |
27 | 'antigravity-feature.rst'} |
|
30 | 'antigravity-feature.rst'} | |
28 | ) |
|
31 | }) | |
29 |
|
32 | |||
30 | # Absolute paths |
|
|||
31 | files = {pjoin(pr_dir, f) for f in files} |
|
|||
32 |
|
33 | |||
33 | def getmtime(f): |
|
34 | def getmtime(f): | |
34 | return check_output(['git', 'log', '-1', '--format="%ai"', '--', f]) |
|
35 | return check_output(['git', 'log', '-1', '--format="%ai"', '--', f]) | |
@@ -38,7 +39,11 b' files = sorted(files, key=getmtime)' | |||||
38 | features, incompats = [], [] |
|
39 | features, incompats = [], [] | |
39 | for path in files: |
|
40 | for path in files: | |
40 | with io.open(path, encoding='utf-8') as f: |
|
41 | with io.open(path, encoding='utf-8') as f: | |
41 | content = f.read().rstrip() |
|
42 | try: | |
|
43 | content = f.read().rstrip() | |||
|
44 | except Exception as e: | |||
|
45 | raise Exception('Error reading "{}"'.format(f)) | |||
|
46 | ||||
42 | if basename(path).startswith('incompat-'): |
|
47 | if basename(path).startswith('incompat-'): | |
43 | incompats.append(content) |
|
48 | incompats.append(content) | |
44 | else: |
|
49 | else: | |
@@ -72,4 +77,4 b' for file in files:' | |||||
72 |
|
77 | |||
73 | check_call(['git', 'add', target]) |
|
78 | check_call(['git', 'add', target]) | |
74 |
|
79 | |||
75 | print("Merged what's new changes. Check the diff and commit the change.") No newline at end of file |
|
80 | print("Merged what's new changes. Check the diff and commit the change.") |
General Comments 0
You need to be logged in to leave comments.
Login now