##// END OF EJS Templates
Work on QtConsole Menu...
Work on QtConsole Menu * add new_frontend_factory, slave_frontend_factory callable arguments to MainWindow constructor, decoupling MainWindow and the IPythonApp a bit * create *all* menu items in MainWindow.init_menubar, rather than some in the IPythonApp * split init_menu_bar into methods for each menu, to ease organization * attach all menu bar actions to the MainWindow as well, so that they are still accessible when Menu Bar is invisible * add View menu for Fullscreen and Fonts * organized menu items to match standard patterns * Fewer platform-dependent menu items

File last commit:

r2267:928c921b
r5135:5e65a460
Show More
ipy_p4.py
47 lines | 1.3 KiB | text/x-python | PythonLexer
vivainio
New extensions ipy_p4 for %p4 magic (perforce)
r524 # -*- coding: utf-8 -*-
"""
Add %p4 magic for pythonic p4 (Perforce) usage.
"""
Brian Granger
ipapi.py => core/ipapi.py and imports updated.
r2027 from IPython.core import ipapi
ip = ipapi.get()
vivainio
New extensions ipy_p4 for %p4 magic (perforce)
r524
import os,sys,marshal
import ipy_stock_completers
def p4_f(self, parameter_s=''):
cmd = 'p4 -G ' + parameter_s
vivainio
unmarshal p4 -G output to list
r526 fobj = os.popen(cmd)
out = []
while 1:
try:
out.append(marshal.load(fobj))
except EOFError:
break
return out
vivainio
New extensions ipy_p4 for %p4 magic (perforce)
r524
vivainio
a bit longer prompt for sh profile, p4d func in ipy_p4
r630 def p4d(fname):
return os.popen('p4 where ' + fname).read().split()[0]
Brian Granger
Continuing a massive refactor of everything.
r2205 ip.push("p4d")
vivainio
a bit longer prompt for sh profile, p4d func in ipy_p4
r630
Brian Granger
Continuing a massive refactor of everything.
r2205 ip.define_magic('p4', p4_f)
vivainio
New extensions ipy_p4 for %p4 magic (perforce)
r524
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')
vivainio
unmarshal p4 -G output to list
r526 ip.set_hook('complete_command', p4_completer, str_key = 'p4')
vivainio
New extensions ipy_p4 for %p4 magic (perforce)
r524