##// END OF EJS Templates
New extensions ipy_p4 for %p4 magic (perforce)
vivainio -
Show More

The requested changes are too big and content was truncated. Show full diff

@@ -0,0 +1,34 b''
1 # -*- coding: utf-8 -*-
2 """
3 Add %p4 magic for pythonic p4 (Perforce) usage.
4 """
5
6 import IPython.ipapi
7 ip = IPython.ipapi.get()
8
9 import os,sys,marshal
10
11 import ipy_stock_completers
12
13 def p4_f(self, parameter_s=''):
14 cmd = 'p4 -G ' + parameter_s
15 return marshal.load(os.popen(cmd))
16
17 ip.expose_magic('p4', p4_f)
18
19 p4_commands = """\
20 add admin annotate branch branches change changes changelist
21 changelists client clients counter counters delete depot depots
22 describe diff diff2 dirs edit filelog files fix fixes flush fstat
23 group groups have help info integrate integrated job jobs jobspec
24 label labels labelsync lock logger login logout monitor obliterate
25 opened passwd print protect rename reopen resolve resolved revert
26 review reviews set submit sync tag tickets triggers typemap unlock
27 user users verify workspace workspaces where"""
28
29 def p4_completer(self,event):
30 return ipy_stock_completers.vcs_completer(p4_commands, event)
31
32 ip.set_hook('complete_command', p4_completer, str_key = '%p4')
33
34
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
General Comments 0
You need to be logged in to leave comments. Login now