Open an editor in PyDev
(filename, line=0, wait=True)
| 54 | |
| 55 | def create_editor_hook(pydev_host, pydev_client_port): |
| 56 | def call_editor(filename, line=0, wait=True): |
| 57 | """Open an editor in PyDev""" |
| 58 | if line is None: |
| 59 | line = 0 |
| 60 | |
| 61 | # Make sure to send an absolution path because unlike most editor hooks |
| 62 | # we don't launch a process. This is more like what happens in the zmqshell |
| 63 | filename = os.path.abspath(filename) |
| 64 | |
| 65 | # import sys |
| 66 | # sys.__stderr__.write('Calling editor at: %s:%s\n' % (pydev_host, pydev_client_port)) |
| 67 | |
| 68 | # Tell PyDev to open the editor |
| 69 | server = xmlrpclib.Server("http://%s:%s" % (pydev_host, pydev_client_port)) |
| 70 | server.IPythonEditor(filename, str(line)) |
| 71 | |
| 72 | if wait: |
| 73 | input("Press Enter when done editing:") |
| 74 | |
| 75 | return call_editor |
| 76 |
nothing calls this directly
no test coverage detected