Show More
@@ -32,6 +32,8 b' from IPython.utils.py3compat import input' | |||||
32 |
|
32 | |||
33 | from IPython.core.release import __version__ as version |
|
33 | from IPython.core.release import __version__ as version | |
34 |
|
34 | |||
|
35 | from typing import Optional | |||
|
36 | ||||
35 | #----------------------------------------------------------------------------- |
|
37 | #----------------------------------------------------------------------------- | |
36 | # Code |
|
38 | # Code | |
37 | #----------------------------------------------------------------------------- |
|
39 | #----------------------------------------------------------------------------- | |
@@ -95,8 +97,15 b' class CrashHandler(object):' | |||||
95 | message_template = _default_message_template |
|
97 | message_template = _default_message_template | |
96 | section_sep = '\n\n'+'*'*75+'\n\n' |
|
98 | section_sep = '\n\n'+'*'*75+'\n\n' | |
97 |
|
99 | |||
98 | def __init__(self, app, contact_name=None, contact_email=None, |
|
100 | def __init__( | |
99 | bug_tracker=None, show_crash_traceback=True, call_pdb=False): |
|
101 | self, | |
|
102 | app, | |||
|
103 | contact_name: Optional[str] = None, | |||
|
104 | contact_email: Optional[str] = None, | |||
|
105 | bug_tracker: Optional[str] = None, | |||
|
106 | show_crash_traceback: bool = True, | |||
|
107 | call_pdb: bool = False, | |||
|
108 | ): | |||
100 | """Create a new crash handler |
|
109 | """Create a new crash handler | |
101 |
|
110 | |||
102 | Parameters |
|
111 | Parameters | |
@@ -113,10 +122,15 b' class CrashHandler(object):' | |||||
113 | show_crash_traceback : bool |
|
122 | show_crash_traceback : bool | |
114 | If false, don't print the crash traceback on stderr, only generate |
|
123 | If false, don't print the crash traceback on stderr, only generate | |
115 | the on-disk report |
|
124 | the on-disk report | |
116 | Non-argument instance attributes |
|
125 | call_pdb | |
|
126 | Whether to call pdb on crash | |||
|
127 | ||||
|
128 | Attributes | |||
|
129 | ---------- | |||
117 | These instances contain some non-argument attributes which allow for |
|
130 | These instances contain some non-argument attributes which allow for | |
118 | further customization of the crash handler's behavior. Please see the |
|
131 | further customization of the crash handler's behavior. Please see the | |
119 | source for further details. |
|
132 | source for further details. | |
|
133 | ||||
120 | """ |
|
134 | """ | |
121 | self.crash_report_fname = "Crash_report_%s.txt" % app.name |
|
135 | self.crash_report_fname = "Crash_report_%s.txt" % app.name | |
122 | self.app = app |
|
136 | self.app = app |
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file |
@@ -115,13 +115,10 b' def record_magic(dct, magic_kind, magic_name, func):' | |||||
115 | ---------- |
|
115 | ---------- | |
116 | dct : dict |
|
116 | dct : dict | |
117 | A dictionary with 'line' and 'cell' subdicts. |
|
117 | A dictionary with 'line' and 'cell' subdicts. | |
118 |
|
||||
119 | magic_kind : str |
|
118 | magic_kind : str | |
120 | Kind of magic to be stored. |
|
119 | Kind of magic to be stored. | |
121 |
|
||||
122 | magic_name : str |
|
120 | magic_name : str | |
123 | Key to store the magic as. |
|
121 | Key to store the magic as. | |
124 |
|
||||
125 | func : function |
|
122 | func : function | |
126 | Callable object to store. |
|
123 | Callable object to store. | |
127 | """ |
|
124 | """ | |
@@ -387,7 +384,7 b' class MagicsManager(Configurable):' | |||||
387 |
|
384 | |||
388 | Parameters |
|
385 | Parameters | |
389 | ---------- |
|
386 | ---------- | |
390 | magic_objects : one or more classes or instances |
|
387 | *magic_objects : one or more classes or instances | |
391 | """ |
|
388 | """ | |
392 | # Start by validating them to ensure they have all had their magic |
|
389 | # Start by validating them to ensure they have all had their magic | |
393 | # methods registered at the instance level |
|
390 | # methods registered at the instance level | |
@@ -423,10 +420,8 b' class MagicsManager(Configurable):' | |||||
423 | ---------- |
|
420 | ---------- | |
424 | func : callable |
|
421 | func : callable | |
425 | Function to be registered as a magic. |
|
422 | Function to be registered as a magic. | |
426 |
|
||||
427 | magic_kind : str |
|
423 | magic_kind : str | |
428 | Kind of magic, one of 'line', 'cell' or 'line_cell' |
|
424 | Kind of magic, one of 'line', 'cell' or 'line_cell' | |
429 |
|
||||
430 | magic_name : optional str |
|
425 | magic_name : optional str | |
431 | If given, the name the magic will have in the IPython namespace. By |
|
426 | If given, the name the magic will have in the IPython namespace. By | |
432 | default, the name of the function itself is used. |
|
427 | default, the name of the function itself is used. | |
@@ -451,10 +446,8 b' class MagicsManager(Configurable):' | |||||
451 | ---------- |
|
446 | ---------- | |
452 | alias_name : str |
|
447 | alias_name : str | |
453 | The name of the magic to be registered. |
|
448 | The name of the magic to be registered. | |
454 |
|
||||
455 | magic_name : str |
|
449 | magic_name : str | |
456 | The name of an existing magic. |
|
450 | The name of an existing magic. | |
457 |
|
||||
458 | magic_kind : str |
|
451 | magic_kind : str | |
459 | Kind of magic, one of 'line' or 'cell' |
|
452 | Kind of magic, one of 'line' or 'cell' | |
460 | """ |
|
453 | """ | |
@@ -580,21 +573,16 b' class Magics(Configurable):' | |||||
580 |
|
573 | |||
581 | Parameters |
|
574 | Parameters | |
582 | ---------- |
|
575 | ---------- | |
583 |
|
||||
584 | arg_str : str |
|
576 | arg_str : str | |
585 | The arguments to parse. |
|
577 | The arguments to parse. | |
586 |
|
||||
587 | opt_str : str |
|
578 | opt_str : str | |
588 | The options specification. |
|
579 | The options specification. | |
589 |
|
||||
590 | mode : str, default 'string' |
|
580 | mode : str, default 'string' | |
591 | If given as 'list', the argument string is returned as a list (split |
|
581 | If given as 'list', the argument string is returned as a list (split | |
592 | on whitespace) instead of a string. |
|
582 | on whitespace) instead of a string. | |
593 |
|
||||
594 | list_all : bool, default False |
|
583 | list_all : bool, default False | |
595 | Put all option values in lists. Normally only options |
|
584 | Put all option values in lists. Normally only options | |
596 | appearing more than once are put in a list. |
|
585 | appearing more than once are put in a list. | |
597 |
|
||||
598 | posix : bool, default True |
|
586 | posix : bool, default True | |
599 | Whether to split the input line in POSIX mode or not, as per the |
|
587 | Whether to split the input line in POSIX mode or not, as per the | |
600 | conventions outlined in the :mod:`shlex` module from the standard |
|
588 | conventions outlined in the :mod:`shlex` module from the standard |
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file |
@@ -18,7 +18,6 b' def page(strng, start=0, screen_lines=0, pager_cmd=None):' | |||||
18 | ---------- |
|
18 | ---------- | |
19 | strng : str or mime-dict |
|
19 | strng : str or mime-dict | |
20 | Text to page, or a mime-type keyed dict of already formatted data. |
|
20 | Text to page, or a mime-type keyed dict of already formatted data. | |
21 |
|
||||
22 | start : int |
|
21 | start : int | |
23 | Starting line at which to place the display. |
|
22 | Starting line at which to place the display. | |
24 | """ |
|
23 | """ |
@@ -241,7 +241,7 b' def select_figure_formats(shell, formats, **kwargs):' | |||||
241 | """Select figure formats for the inline backend. |
|
241 | """Select figure formats for the inline backend. | |
242 |
|
242 | |||
243 | Parameters |
|
243 | Parameters | |
244 | ========== |
|
244 | ---------- | |
245 | shell : InteractiveShell |
|
245 | shell : InteractiveShell | |
246 | The main IPython instance. |
|
246 | The main IPython instance. | |
247 | formats : str or set |
|
247 | formats : str or set | |
@@ -408,7 +408,6 b' def configure_inline_support(shell, backend):' | |||||
408 | Parameters |
|
408 | Parameters | |
409 | ---------- |
|
409 | ---------- | |
410 | shell : InteractiveShell instance |
|
410 | shell : InteractiveShell instance | |
411 |
|
||||
412 | backend : matplotlib backend |
|
411 | backend : matplotlib backend | |
413 | """ |
|
412 | """ | |
414 | warnings.warn( |
|
413 | warnings.warn( |
@@ -556,7 +556,7 b' class ListTB(TBTools):' | |||||
556 | Parameters |
|
556 | Parameters | |
557 | ---------- |
|
557 | ---------- | |
558 | etype : exception type |
|
558 | etype : exception type | |
559 |
|
|
559 | value : exception value | |
560 | """ |
|
560 | """ | |
561 | return ListTB.structured_traceback(self, etype, value) |
|
561 | return ListTB.structured_traceback(self, etype, value) | |
562 |
|
562 |
General Comments 0
You need to be logged in to leave comments.
Login now