##// END OF EJS Templates
Fixed bugs in IPython.kernel....
Fixed bugs in IPython.kernel. * Removed :mod:`IPython.kernel.contexts` and :mod:`IPython.kernel.tests.test_contexts` and all code that used them. This was broken and needed to be removed. Also Enthought has a nice decorator that does this. * Fixed broken tests in :file:`test_multienginefc.py` and :file:`test_taskfc.py`. See https://bugs.launchpad.net/ipython/+bug/505358. * Changed ports number in :mod:`IPython.kernel.tests` to 10111 to avoid conflicts with users who are using the older 10105 ports. See https://bugs.launchpad.net/ipython/+bug/504515. * Fixed logic and bugs in :mod:`IPython.kernel.fcutils` and :mod:`IPython.kernel.clientconnector` related to how FURL files are validated and found. See https://bugs.launchpad.net/ipython/+bug/502790. * Fixed the unhandled :class:`DeadReferenceError`` exception that was happening in :mod:`IPython.kernel.multiengineclient' and :mod:`IPython.kernel.taskclient` when the controller died or restarted. Now we capture that error and raises a :class:`IPython.kernel.error.ConnectionError` that has a better error message. See https://bugs.launchpad.net/ipython/+bug/502796.

File last commit:

r2267:928c921b
r2517:8185e15c
Show More
ipy_p4.py
47 lines | 1.3 KiB | text/x-python | PythonLexer
# -*- coding: utf-8 -*-
"""
Add %p4 magic for pythonic p4 (Perforce) usage.
"""
from IPython.core import ipapi
ip = ipapi.get()
import os,sys,marshal
import ipy_stock_completers
def p4_f(self, parameter_s=''):
cmd = 'p4 -G ' + parameter_s
fobj = os.popen(cmd)
out = []
while 1:
try:
out.append(marshal.load(fobj))
except EOFError:
break
return out
def p4d(fname):
return os.popen('p4 where ' + fname).read().split()[0]
ip.push("p4d")
ip.define_magic('p4', p4_f)
p4_commands = """\
add admin annotate branch branches change changes changelist
changelists client clients counter counters delete depot depots
describe diff diff2 dirs edit filelog files fix fixes flush fstat
group groups have help info integrate integrated job jobs jobspec
label labels labelsync lock logger login logout monitor obliterate
opened passwd print protect rename reopen resolve resolved revert
review reviews set submit sync tag tickets triggers typemap unlock
user users verify workspace workspaces where"""
def p4_completer(self,event):
return ipy_stock_completers.vcs_completer(p4_commands, event)
ip.set_hook('complete_command', p4_completer, str_key = '%p4')
ip.set_hook('complete_command', p4_completer, str_key = 'p4')