##// END OF EJS Templates
Merge pull request #1471 from minrk/connection...
Merge pull request #1471 from minrk/connection simplify IPython.parallel connections and enable Controller Resume Rolls back two-stage connection info, putting more information into the connection files. This makes it easier to use hand-crafted ssh tunnels, as all ports are read from the file, rather than from the reply to registration/connection requests. It is no longer possible to connect to the Controller without a connection file. Adding the serialization method to the connection file also makes it harder for custom serialization to result in a mismatch in configuration between the various objects.

File last commit:

r4574:a8c54759
r7962:bff463b5 merge
Show More
ipy_gnuglobal.py
35 lines | 867 B | text/x-python | PythonLexer
"""
Add %global magic for GNU Global usage.
http://www.gnu.org/software/global/
"""
from IPython.core import ipapi
ip = ipapi.get()
import os
# alter to your liking
global_bin = 'd:/opt/global/bin/global'
def global_f(self,cmdline):
simple = 0
if '-' not in cmdline:
cmdline = '-rx ' + cmdline
simple = 1
lines = [l.rstrip() for l in os.popen( global_bin + ' ' + cmdline ).readlines()]
if simple:
parts = [l.split(None,3) for l in lines]
lines = ['%s [%s]\n%s' % (p[2].rjust(70),p[1],p[3].rstrip()) for p in parts]
print "\n".join(lines)
ip.define_magic('global', global_f)
def global_completer(self,event):
compl = [l.rstrip() for l in os.popen(global_bin + ' -c ' + event.symbol).readlines()]
return compl
ip.set_hook('complete_command', global_completer, str_key = '%global')