Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Guess ipython server information. Requires psutil module to work. It's cross platform but I didn't test in windows. #2

Closed
wants to merge 1 commit into from

2 participants

@philipn

Guess ipython server information. Requires psutil module to work. It's cross platform but I didn't test in windows.

The right way to do this would be to make ipython keep a pid file around somewhere.

@philipn philipn Guess ipython server information. Requires psutil module to work. It'…
…s cross platform but I didn't test in windows.

The right way to do this would be to make ipython keep a pid file around somewhere.
e9fed98
@ivanov
Owner

I forwarded the security-related aspect of this to IPython here: ipython/ipython#688

My guess is that the 'functionality' you exploit here will be removed, so I'll wait to merge this until after we hear back from how the issue will be addressed.

@philipn
@ivanov
Owner

as predicted, once, ipython/ipython#847 is merged, we will get (thanks to ivanov/vim-ipython#13) a more secure and easier way to connect to ipython via .json files

@ivanov ivanov closed this pull request from a commit
@ivanov :IPy without args acts as --existing (closes #2)
For this to work you have to be running IPython from git, until 0.12
comes out. An error message will be reported for IPython 0.11, since it
did not support --existing.

Those who wish to gain this functionality in IPython 0.11 should take a
look at the unmerged pull request #2:
#2

There, Philip Neustrom exploits the fact that on 0.11, IPython's full
connection string could be inferred from it's process listing via ps.
That approach does not work, nor is it necessary, with the connection
file mechanisms now in IPython.
8a8a38a
@ivanov ivanov closed this in 8a8a38a
@DropD DropD referenced this pull request from a commit in DropD/.vim
@DropD DropD Squashed commit of the following:
commit 55fd90c
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Wed Dec 11 23:34:04 2013 -0800

    minimal change for non-python kernels to operate

commit 50023db
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Wed Dec 11 23:31:43 2013 -0800

    minor todo, once I learn how to throw vim errors

commit 82cae40
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Sun Nov 24 12:02:57 2013 -0800

    added another TODO

commit 26c32c0
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Fri Nov 15 11:35:53 2013 -0800

    fix interrupt logic for IPython >=1.0, closes #76

commit f732033
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Wed Nov 6 22:10:19 2013 -0800

    edited TODO.md

commit 3e1a9db
Merge: 25c1383 0e004d3
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Wed Nov 6 21:36:32 2013 -0800

    Merge pull request #58 from pag/master

    Making the status buffer friendlier and configurable

commit 25c1383
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Wed Nov 6 20:57:17 2013 -0800

    added my old TODO list, closes #66

commit 929ab1a
Merge: c33ec6c df24b84
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Wed Nov 6 20:47:50 2013 -0800

    Merge pull request #55 from pydave/vim-mappings

    Clean up mappings: LocalLeader, Plug, and noremap

    closes #35

commit c33ec6c
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Wed Nov 6 20:34:26 2013 -0800

    open vim-ipython window on send, closes #36

commit 9de01a8
Merge: 465cd23 97b2e69
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Wed Nov 6 20:21:16 2013 -0800

    clean merge

commit 465cd23
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Wed Nov 6 20:20:44 2013 -0800

    fix for old object_info, closes #69 and #65

    for IPython < 0.13, object_info took only one argument, instead of two

commit 97b2e69
Merge: 7eb7c24 ff8f88f
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Tue Oct 29 11:32:48 2013 -0700

    Merge branch 'master' of gh:ivanov/vim-ipython

commit 7eb7c24
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Mon Oct 28 10:36:09 2013 -0700

    use normal!

    following Steve Losh's "Writing Vim Plugins" advice

    normal! ensures that the original vim mappings are used, and ignores any
    remapping of normal commands that a user might make locally

commit 81ce20c
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Mon Oct 28 10:34:30 2013 -0700

    updated to Quick Start

commit ff8f88f
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Thu Aug 29 15:29:55 2013 -0700

    instructions for common usage error, closes #63

commit b6990d3
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Thu Aug 29 14:35:51 2013 -0700

    instructions so folks add themselves to README

commit ff95771
Merge: 7e948b1 774e341
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Thu Aug 29 14:26:56 2013 -0700

    Merge pull request #72 from marcel-wolf/master

    invoke IPython's run magic as %run instead of run

commit 774e341
Author: Marcel Wolf <marcel.wolf@mssm.edu>
Date:   Wed Aug 28 16:30:32 2013 -0400

    invoke IPython's run magic as %run instead of run

    If the source file defines or imports a symbol named 'run', that symbol
    takes precedence over IPython's run, leading to a syntax error being
    thrown when invoking run_this_file()

    Using %run removes the ambiguity.

commit 7e948b1
Merge: e33fdf3 9f135ae
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Tue Aug 20 17:03:29 2013 -0700

    merging README changes

    Conflicts:
    	README.rst

commit e33fdf3
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Tue Aug 20 17:01:13 2013 -0700

    updated readme with a FAQ answer

commit 9f135ae
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Wed Jun 19 13:56:38 2013 -0700

    added known issues link

commit 0e004d3
Author: Paul Giannaros <paul@giannaros.org>
Date:   Thu Jun 13 00:19:30 2013 +0100

    doc cursor position typo

commit cc247e6
Author: Paul Giannaros <paul@giannaros.org>
Date:   Thu Jun 13 00:15:26 2013 +0100

    make dedent_run_th{ese,is}_line actually work (? support, noet support)

commit d7f6ff2
Author: Paul Giannaros <paul@giannaros.org>
Date:   Tue Jun 11 23:21:44 2013 +0100

    do not explicitly enable ballooneval, otherwise it cannot be disabled

commit 2fd5010
Merge: 8e80ef7 49a22e1
Author: Paul Giannaros <paul@giannaros.org>
Date:   Wed Jun 5 23:22:22 2013 +0100

    merge

commit 49a22e1
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Wed May 29 12:09:23 2013 -0700

    moved my blog around

commit c885817
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Thu May 2 16:31:15 2013 -0700

    leave insert mode on ??

commit 64addda
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Thu May 2 13:08:56 2013 -0700

    go to bottom of shell buffer on update

    This will happen either because we executed an ipython command, or
    because we just manually updated the vim-ipython buffer via something
    like <leader>s

commit 6087a16
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Thu May 2 11:43:40 2013 -0700

    Update to newest IPython internals, closes #61

    Thanks to Skipper @jseabold for reporting and giving me the pointers to
    @minrk's updated gists, see #61 for reference

commit 5f13959
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Sat Apr 20 12:58:14 2013 -0700

    adding some more issues

commit cc21ee3
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Mon Apr 15 18:14:22 2013 -0700

    cleanup up interrupt implementation, added docs

commit a3f5c87
Merge: 160a042 7759d94
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Apr 15 17:39:24 2013 -0700

    Merge pull request #56 from pydave/add-terminate

    Add IPythonTerminate to close ipython

commit 160a042
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Mon Apr 15 16:29:37 2013 -0700

    support for `foo??` to get code introspection

    Again, like `foo?` - this only works on single lines for now.
    But I did add the syntax highlighting for python code on ??

commit ee56141
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Mon Apr 15 16:07:14 2013 -0700

    get docs by sending `foo?`, just like ipython

    currently only supported for sending single lines which end with a
    question mark.

commit 094b738
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Thu Apr 11 16:50:20 2013 -0700

    added a todo I just thought of

commit 8e80ef7
Author: Paul Giannaros <paul@giannaros.org>
Date:   Sat Apr 6 23:12:46 2013 +0100

    Make status prompt configurable

commit 515ed45
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Mon Mar 25 18:52:13 2013 -0700

    added vipy, which started as a vim-ipython fork

commit ea29827
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Mon Mar 25 17:22:50 2013 -0700

    new contributions acknowledgements

commit 185f0ca
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Mon Mar 25 17:20:05 2013 -0700

    use <cword> to grab identifier closes #50

    thanks for both the bug report and fix by @memeplex

commit 6a0b1e1
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Mon Mar 25 16:06:04 2013 -0700

    sub_channel was renamed to iopub_channel in 1.0dev

commit 8980c55
Merge: c481c20 43b804f
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Mar 25 15:33:33 2013 -0700

    Merge pull request #51 from minrk/utils.kernel

    find_connection_file moved in IPython master

commit c481c20
Author: Paul Ivanov <pi@berkeley.edu>
Date:   Mon Mar 25 15:31:06 2013 -0700

    note: partial quotes breaking syntax highlighting

commit df24b84
Author: pydave <pydave@gmail.com>
Date:   Sun Feb 24 11:48:47 2013 -0800

    Comment out unimplemented debugging maps

    Hide these from users since they are currently unimplemented.

commit ae7f140
Author: pydave <pydave@gmail.com>
Date:   Sun Feb 24 10:37:07 2013 -0800

    Only map within the python buffer

    Adds <buffer> to all plugin maps.

    Only apply the maps in the current buffer to prevent them from carrying
    over into nonpython buffers (where the commands wouldn't make sense).

commit 976ffee
Author: pydave <pydave@gmail.com>
Date:   Sat Feb 23 12:03:09 2013 -0800

    Use <Plug> for filetype maps

    Use <Plug> for plugin maps to make it easier for users to define their
    own maps.

    <Plug> names are wrapped in braces to ensure that RunLine and RunLines
    aren't considered overlapping by vim. (Otherwise, vim will pause after
    RunLine to make sure you don't want RunLines.) See also:
        http://stackoverflow.com/questions/13688022/what-is-the-reason-to-parenthesize-plug-map-names

    Plug names have common prefixes (Plot, RunLine) to make completion
    easier and grouping clearer.

    Note: You cannot use noremap for Plug (it won't map to anything).

commit 5236182
Author: pydave <pydave@gmail.com>
Date:   Sun Feb 24 10:40:53 2013 -0800

    Use noremap and mode-specific maps in shell buffer

    Using noremap will ensure maps still work for users who remap core vim
    keys (like :).

    Some maps only make sense in normal mode, so only map them there.

commit 9317b87
Author: pydave <pydave@gmail.com>
Date:   Sat Feb 23 12:03:09 2013 -0800

    Use noremap for main mappings

    Use noremap where possible to prevent breakage when users remap certain
    keys. (Some people swap : and ; which would break all calls to :python)

commit e2ada91
Author: pydave <pydave@gmail.com>
Date:   Sat Feb 23 12:03:09 2013 -0800

    Use <LocalLeader>

    Use <LocalLeader> for filetype-specific maps so user-defined local
    leaders work. Recommended by :help maplocalleader

commit 7759d94
Author: pydave <pydave@gmail.com>
Date:   Sun Feb 24 12:10:47 2013 -0800

    Add IPythonTerminate to close ipython

    There's no apparent interface to close ipython aside from sending it a
    terminate message, so make a command to send a terminate message.

    Extracts most of interrupt_kernel_hack to send_kernel_interrupt which
    takes a single argument: the signal.

commit 159383a
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Tue Feb 26 06:26:40 2013 -0800

    added another alter-NATIVE

commit 43b804f
Author: MinRK <benjaminrk@gmail.com>
Date:   Mon Jan 28 15:07:50 2013 -0800

    find_connection_file is moving

    in 0.14, kernel functions are consolidated into IPython.kernel

commit 0af81df
Merge: 97ad85e 4ee3bcc
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Dec 17 13:12:56 2012 -0800

    Merge pull request #43 from dieterv77/FixDedent

    Only dedent and undo if there is an indent

commit 4ee3bcc
Author: Dieter Vandenbussche <dvandenbussche@axioma.com>
Date:   Mon Dec 17 09:40:14 2012 -0500

    Only dedent and undo if there is an indent, otherwise
    the undo will make unexpected changes to the file

commit 97ad85e
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Fri Sep 28 12:11:36 2012 -0700

    updated usage of :IPython command

commit 0f045c2
Merge: 5a64a2a f35be67
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Sep 3 13:52:13 2012 -0700

    Merge branch 'master' of github.com:ivanov/vim-ipython

    Conflicts:
    	README.rst

commit 5a64a2a
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Sep 3 13:49:51 2012 -0700

    added note about JDH memorial fund

commit 8eab02d
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Thu Aug 16 12:51:02 2012 -0700

    some more alternatives

commit f35be67
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Thu Jul 12 00:32:07 2012 -0700

    added another set of alternatives

commit 1bf8afc
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Wed Jun 13 16:51:49 2012 -0700

    updated docs, some cleanup

commit 83f8a1f
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Wed Jun 13 15:54:43 2012 -0700

    updated comments for ipy_completefunc

commit fa7ece2
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Wed Jun 13 15:40:15 2012 -0700

    new option for activating completefunc, closes #32

commit 72dc1aa
Author: Jakub Nawalaniec <pielgrzym@prymityw.pl>
Date:   Thu Jun 7 11:26:29 2012 +0200

    An option to enable completion for local buffer only

commit 24a9d8e
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Wed Jun 6 18:53:53 2012 -0700

    more robust ctrl-c support

commit 315ab83
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Jun 4 16:44:44 2012 -0700

    don't throw errors when in an unnamed buffer

    Previously, if you did something like :new and waited for the idle timer
    to kick in, you'd get an error, because the window name was None. This
    little change accounts for that situation

commit 5e4cb3d
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Jun 4 16:43:44 2012 -0700

    don't force doc window to be a preview window

    That way we can have multiple such windows open, and vim-ipython does
    not get closed when we're checking up some documentation

commit 359e249
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Sat May 12 16:37:09 2012 -0700

    don't guess quotes on doc lookup, closes #30

    thanks to @jtratner for the detailed bug report that helped to track
    this down.

commit fffb57f
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Sat May 12 16:00:28 2012 -0700

    only active balloons after connecting

commit 6c13329
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Tue May 1 19:36:13 2012 -0700

    updated "competitors"

commit 163cfdb
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Tue Apr 3 18:28:15 2012 -0700

    document update_sunchannel_msgs function

commit 8b0eb05
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Tue Apr 3 17:00:46 2012 -0700

    only update "shell" if it is open, closes #29

    thanks @jorgesca for the report

commit 05e022a
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Sat Mar 31 23:04:17 2012 -0700

    added another "send to screen" candidate

    got this one from looking at Matthew Brett's vim files

commit 31d4494
Merge: c32490e c5ebed9
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Tue Mar 27 15:26:57 2012 -0700

    Ctrl-C now works to interrupt local kernel

    Conflicts:
    	ftplugin/python/ipy.vim

commit c32490e
Merge: 8f6a7fc 5eb512b
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Tue Mar 27 15:22:29 2012 -0700

    Merge pull request #28 from mrterry/local_interrupt

    can interrupt local kernels (posix only)

commit c5ebed9
Merge: 5eb512b 26bb419
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Tue Mar 27 15:18:45 2012 -0700

    ctrl-c for vim-ipython implemented on POSIX

    Conflicts:
    	ftplugin/python/ipy.vim

commit 8f6a7fc
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Fri Mar 23 18:46:48 2012 -0700

    adding some related project references

    vim-ipython won't be all things for all people, and there's a number of
    comparable solutions that have their strengths (e.g. being
    IPython-agnostic and work for any REPL)

commit faf27e5
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Mar 12 22:30:19 2012 -0700

    'shell' shift-enter, ctrl-enter work like notebook

    In other words, when you're on a line in the vim-ipython buffer and you
    press ctrl-enter, that line gets executed and gets placed back so you
    can keep editing it, whereas shift-enter just executes that line

commit 1ea2742
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Mar 12 18:08:52 2012 -0700

    remove double update of subchannel monitoring

commit b59590f
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Mar 12 15:59:45 2012 -0700

    move km is None check into update_subchannel_msgs

commit 5eb512b
Author: Matt Terry <terry10@llnl.gov>
Date:   Mon Mar 12 14:46:16 2012 -0700

    can interrupt local kernels (posix only)

commit 33afe19
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Fri Mar 2 14:46:33 2012 -0800

    only call update if we have a valid km

commit ee75fdd
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Wed Feb 29 23:15:45 2012 -0800

    fix for cherry-pick from #24

commit 799d143
Author: Dan Stahlke <dstahlke@gmail.com>
Date:   Sun Jan 29 13:31:23 2012 -0500

    set syntax for doc window

commit 63d6b72
Merge: 17cdd38 064ceae
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Wed Feb 29 23:01:11 2012 -0800

    Merge pull request #26 from nonameentername/master

    Fix completion for import statements

    Prior to this patch, trying to complete on "import numpy." did not return
    any results. With this patch, that is now fixed.

commit 17cdd38
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Wed Feb 29 19:04:20 2012 -0800

    automatic updating of vim-ipython buffer when idle

commit 064ceae
Author: werner mendizabal <werner.mendizabal@gmail.com>
Date:   Wed Feb 29 13:00:50 2012 -0600

    fix omnicomplete for import statements

commit 1a5ca84
Merge: 7b9528c 6f2473f
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Thu Feb 2 15:30:51 2012 -0800

    Merge pull request #25 from mrterry/master

    Activate completion *after* ipython connection

commit 6f2473f
Author: Matt Terry <terry10@llnl.gov>
Date:   Thu Feb 2 10:39:52 2012 -0800

    activate completion after connected to a kernel

commit 7b9528c
Merge: 443e26b 4236607
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Sun Jan 29 18:27:30 2012 -0800

    Merge pull request #23 from koepsell/master

    Exit gracefully in case python is not available.

commit 4236607
Author: Kilian Koepsell <kilian@koepsell.de>
Date:   Sun Jan 29 00:47:04 2012 -0800

    Exit gracefully in case python is not available.

    This small patch lets the script exit quietly when python support is not
    available rather then throwing multiple errors. This makes it easier to
    share the vim configuration between different vim installations (eg.
    macvim and the builtin /usr/bin/vim without python support on Mac OSX).

commit 443e26b
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Jan 23 11:26:45 2012 -0800

    doc update

commit 154f573
Merge: 3b62ca3 c6f198e
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Jan 23 10:54:47 2012 -0800

    Merge pull request #19 from ogrisel/patch-1

    typo in README.rst test for python path

commit c6f198e
Author: Olivier Grisel <olivier.grisel@ensta.org>
Date:   Mon Jan 23 15:31:48 2012 +0100

    typo in README.rst test for python path

commit 3b62ca3
Merge: aa17a88 fc7c3eb
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Wed Dec 7 11:07:44 2011 -0800

    Merge branch 'master' of github.com:ivanov/vim-ipython

commit aa17a88
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Wed Dec 7 11:04:51 2011 -0800

    new run_command function (with examples usage)

    The example is commented out by default, but I actually them:
    F12 clear the current figure via  "plt.clf()"
    F11 closes all figures via "plt.close('all')"

commit d9384fa
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Tue Dec 6 19:16:31 2011 -0800

    append empty line to end of vim-ipython shell

    This makes it easier and quicker to start interacting with IPython
    through the vim-ipython buffer in vim, because you can just start typing
    right away without having to make a new line

commit fc7c3eb
Merge: 7c8e00e dc4bc20
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Tue Nov 22 01:47:16 2011 -0800

    Merge pull request #17 from enzbang/patch-1

    The function set_this_line does not exist. Avoid errors when typing C-P

commit dc4bc20
Author: Olivier Ramonat <olivier@ramonat.fr>
Date:   Sat Nov 19 14:45:57 2011 +0100

    The function set_this_line does not exist. Avoid errors when typing C-P

commit 7c8e00e
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Tue Nov 15 09:27:24 2011 -0800

    intelligent dedenting, thx @unpingco (closes #15)

    before this patch <M-s> in visual mode would just remove the indentation
    from all of the selected lines. With this, it removes the indentation
    level of the first line in the selection, so that further indentation is
    preserved, but this block does not produce indentation errors when sent
    to IPython.

commit 33edf32
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Nov 14 21:05:59 2011 -0800

    don't pepper dedent undo messages

commit 8a8a38a
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Nov 14 20:50:47 2011 -0800

    :IPy without args acts as --existing (closes #2)

    For this to work you have to be running IPython from git, until 0.12
    comes out. An error message will be reported for IPython 0.11, since it
    did not support --existing.

    Those who wish to gain this functionality in IPython 0.11 should take a
    look at the unmerged pull request #2:
    ivanov/vim-ipython#2

    There, Philip Neustrom exploits the fact that on 0.11, IPython's full
    connection string could be inferred from it's process listing via ps.
    That approach does not work, nor is it necessary, with the connection
    file mechanisms now in IPython.

commit 393ea4a
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Nov 14 20:37:57 2011 -0800

    more straight-foward vim-ipython buffer setup

commit c57d9ae
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Thu Nov 10 18:58:20 2011 -0800

    make vim-ipython buffer always modifiable

    this fixes a bug which prevented from modifying the 'vim-ipython' buffer
    if it was first invoked from a buffer that was readonly - such as the
    vim help buffers.

commit 9655d4b
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Thu Nov 10 18:48:31 2011 -0800

    remember vim-ipython shell size (closes #16)

    also update the preview height on every update,
    to remember the height even after closing the
    'vim-ipython' shell

commit f8b8f2a
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Thu Oct 27 16:14:06 2011 -0700

    In prompt should have execution count

commit 26bb419
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Thu Oct 27 16:11:59 2011 -0700

    send ctrl-c to the kernel (not working yet)

commit 57ee60e
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Fri Oct 21 16:50:58 2011 -0700

    doc update (0.12 example string)

commit 9017393
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Fri Oct 21 16:33:51 2011 -0700

    fix for vim with -multi_byte (no 'encoding')

commit 2ae497d
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Fri Oct 21 16:19:04 2011 -0700

    parse profile in the conection string (closes #14)

commit 4c320ca
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Oct 17 13:28:23 2011 -0700

    make new connection spec whitespace insensitive

commit 0174020
Merge: eac94f6 052f56f
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Thu Oct 13 14:55:34 2011 -0700

    Merge pull request #13 from minrk/files

    support connection_file-based IPython connection

commit 052f56f
Author: MinRK <benjaminrk@gmail.com>
Date:   Mon Oct 10 23:28:57 2011 -0700

    support connection_file-based IPython connection

commit eac94f6
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Wed Sep 28 10:25:34 2011 -0700

    document new g:ipy_perform_mappings feature

commit 4ed8eaa
Author: zeekay <zeekayy@gmail.com>
Date:   Wed Sep 28 10:16:41 2011 -0700

    Allow custom mappings

commit b404d47
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Fri Sep 9 19:27:18 2011 -0700

    added note about ipython kernel

commit bf31f39
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Thu Sep 1 18:50:19 2011 -0700

    make messaging work with IPython trunk

commit 3d9f962
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Thu Aug 25 01:07:43 2011 -0700

    comment about closed issue #7

commit c7d7ce1
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Wed Aug 24 21:49:48 2011 -0700

    minor corner case

commit 26b8ad2
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Sat Aug 20 19:05:20 2011 -0700

    make resending In[] work when doctest_mode is on

commit 6fd6f5e
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Sat Aug 20 19:05:01 2011 -0700

    visual feedback on vim-ipython shell update

commit e6ee9ee
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Sat Aug 20 19:03:50 2011 -0700

    stay in vim-ipython shell if executing from it

commit 2ec9130
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Fri Aug 19 10:50:46 2011 -0700

    bug report acknowledgments

commit b6fb810
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Fri Aug 19 10:35:39 2011 -0700

    skip messages without msg_type. (closes #6)

commit 418b485
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Wed Aug 17 03:00:55 2011 -0700

    arrow keys in terminal vim doc buffer. closes #5

    leaving default as is.

commit 2957da0
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Tue Aug 16 10:03:23 2011 -0700

    Allow spaces and quotes in filenames. (closes #4)

commit 6af8474
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Aug 15 18:59:06 2011 -0700

    fix unicode in completions. closes #3

    also unified the vim encoding fixes a bit.

commit c956ba9
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Tue Aug 9 22:51:20 2011 -0700

    minor doc update

commit f2964a6
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Tue Aug 9 22:24:16 2011 -0700

    lazy import speeds up vim startup by ~600ms

    We only need the IPython imports when we want to initiate a connection,
    whereas before this change, we were importing from IPython any time we
    opened a .py file, which isn't necessarily the right thing to do.

commit ed3a31c
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Tue Aug 9 17:45:44 2011 -0700

    added note about import errors some people see

commit b66b480
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Tue Aug 9 14:47:41 2011 -0700

    balloon_eval fix for console-only vim.  (fixes #1)

    thanks @nakamuray and @tcheneau for tracking this down

commit de90af4
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Tue Aug 9 14:21:33 2011 -0700

    don't use time.sleep to wait for messages

    catch and report message timeouts (where appropriate)

commit fdd2e0a
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Fri Aug 5 10:15:16 2011 -0700

    catch errors when not connected

commit d065b91
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Tue Aug 2 12:47:29 2011 -0700

    silently switch buffers to preserve messages

commit f5c138f
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Aug 1 17:09:23 2011 -0700

    now echoing In and Out prompt contents

    optionally immediately after sending a line, for quicker feedback

commit b3d0a26
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Mon Aug 1 17:05:04 2011 -0700

    make interactive <C-S> work again

commit 01e0adf
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Fri Jul 29 13:27:37 2011 -0700

    now works with no changes to IPython trunk!

    patch up vim's stout and stderr for IPython

commit f06c02b
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Thu Jul 28 22:58:20 2011 -0700

    added IPython pull request mention

commit d11ad74
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Thu Jul 28 22:20:28 2011 -0700

    minor rest formatting

commit 349fd51
Author: Paul Ivanov <pivanov314@gmail.com>
Date:   Thu Jul 28 22:14:58 2011 -0700

    initial version
5aff833
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 8, 2011
  1. @philipn

    Guess ipython server information. Requires psutil module to work. It'…

    philipn authored
    …s cross platform but I didn't test in windows.
    
    The right way to do this would be to make ipython keep a pid file around somewhere.
This page is out of date. Refresh to see the latest.
Showing with 36 additions and 1 deletion.
  1. +36 −1 ftplugin/python/ipy.vim
View
37 ftplugin/python/ipy.vim
@@ -45,11 +45,46 @@ from IPython.config.loader import KeyValueConfigLoader
from IPython.zmq.kernelapp import kernel_aliases
+def guess_km():
+ global km
+
+ def _guess_args(cmdline):
+ shell, iopub, stdin, hb = None, None, None, None
+ for item in cmdline:
+ if item.startswith('--shell'):
+ shell = item[len('--shell')+1:]
+ elif item.startswith('--iopub'):
+ iopub = item[len('--iopub')+1:]
+ elif item.startswith('--stdin'):
+ stdin = item[len('--stdin')+1:]
+ elif item.startswith('--hb'):
+ hb = item[len('--hb')+1:]
+ return (shell, iopub, stdin, hb)
+
+ try:
+ import psutil
+
+ for p in psutil.process_iter():
+ if p.name == 'python':
+ (shell, iopub, stdin, hb) = _guess_args(p.cmdline)
+ if shell and iopub and stdin and hb:
+ km = BlockingKernelManager(
+ shell_address=(ip, shell),
+ sub_address=(ip, iopub),
+ stdin_address=(ip, stdin),
+ hb_address=(ip, hb)
+ )
+ except:
+ pass
+
+ return None
+
+
ip = '127.0.0.1'
try:
km
except NameError:
- km = None
+ km = guess_km()
def km_from_string(s):
"""create kernel manager from IPKernelApp string
Something went wrong with that request. Please try again.