Show More
@@ -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,3 +1,10 b'' | |||
|
1 | 2007-02-22 Ville Vainio <vivainio@gmail.com> | |
|
2 | ||
|
3 | * IPython/Extensions/ipy_p4.py: Extension for improved | |
|
4 | p4 (perforce version control system) experience. | |
|
5 | Adds %p4 magic with p4 command completion and | |
|
6 | automatic -G argument (marshall output as python dict) | |
|
7 | ||
|
1 | 8 | 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu> |
|
2 | 9 | |
|
3 | 10 | * IPython/demo.py (Demo.re_stop): make dashes optional in demo |
General Comments 0
You need to be logged in to leave comments.
Login now