Show More
@@ -40,6 +40,11 b" default_output_sep2 = ''" | |||||
40 | # Base path for most payload sources. |
|
40 | # Base path for most payload sources. | |
41 | zmq_shell_source = 'IPython.zmq.zmqshell.ZMQInteractiveShell' |
|
41 | zmq_shell_source = 'IPython.zmq.zmqshell.ZMQInteractiveShell' | |
42 |
|
42 | |||
|
43 | if sys.platform.startswith('win'): | |||
|
44 | default_editor = 'notepad' | |||
|
45 | else: | |||
|
46 | default_editor = '' | |||
|
47 | ||||
43 | #----------------------------------------------------------------------------- |
|
48 | #----------------------------------------------------------------------------- | |
44 | # IPythonWidget class |
|
49 | # IPythonWidget class | |
45 | #----------------------------------------------------------------------------- |
|
50 | #----------------------------------------------------------------------------- | |
@@ -54,7 +59,7 b' class IPythonWidget(FrontendWidget):' | |||||
54 | custom_edit = Bool(False) |
|
59 | custom_edit = Bool(False) | |
55 | custom_edit_requested = QtCore.Signal(object, object) |
|
60 | custom_edit_requested = QtCore.Signal(object, object) | |
56 |
|
61 | |||
57 |
editor = Unicode( |
|
62 | editor = Unicode(default_editor, config=True, | |
58 | help=""" |
|
63 | help=""" | |
59 | A command for invoking a system text editor. If the string contains a |
|
64 | A command for invoking a system text editor. If the string contains a | |
60 | {filename} format specifier, it will be used. Otherwise, the filename will |
|
65 | {filename} format specifier, it will be used. Otherwise, the filename will | |
@@ -406,8 +411,10 b' class IPythonWidget(FrontendWidget):' | |||||
406 | """ |
|
411 | """ | |
407 | if self.custom_edit: |
|
412 | if self.custom_edit: | |
408 | self.custom_edit_requested.emit(filename, line) |
|
413 | self.custom_edit_requested.emit(filename, line) | |
409 |
elif self.editor |
|
414 | elif not self.editor: | |
410 |
self._append_plain_text('No default editor available.\n' |
|
415 | self._append_plain_text('No default editor available.\n' | |
|
416 | 'Specify a GUI text editor in the `IPythonWidget.editor` configurable\n' | |||
|
417 | 'to enable the %edit magic') | |||
411 | else: |
|
418 | else: | |
412 | try: |
|
419 | try: | |
413 | filename = '"%s"' % filename |
|
420 | filename = '"%s"' % filename |
General Comments 0
You need to be logged in to leave comments.
Login now