Show More
@@ -32,7 +32,7 b" ip.set_hook('editor', calljed)" | |||||
32 | You can then enable the functionality by doing 'import myiphooks' |
|
32 | You can then enable the functionality by doing 'import myiphooks' | |
33 | somewhere in your configuration files or ipython command line. |
|
33 | somewhere in your configuration files or ipython command line. | |
34 |
|
34 | |||
35 |
$Id: hooks.py 12 |
|
35 | $Id: hooks.py 1274 2006-04-26 14:01:37Z vivainio $""" | |
36 |
|
36 | |||
37 | #***************************************************************************** |
|
37 | #***************************************************************************** | |
38 | # Copyright (C) 2005 Fernando Perez. <fperez@colorado.edu> |
|
38 | # Copyright (C) 2005 Fernando Perez. <fperez@colorado.edu> | |
@@ -130,8 +130,10 b' class CommandChainDispatcher:' | |||||
130 | try: |
|
130 | try: | |
131 | ret = cmd(*args, **kw) |
|
131 | ret = cmd(*args, **kw) | |
132 | return ret |
|
132 | return ret | |
133 | except ipapi.TryNext: |
|
133 | except ipapi.TryNext, exc: | |
134 |
|
|
134 | if exc.args or exc.kwargs: | |
|
135 | args = exc.args | |||
|
136 | kw = exc.kwargs | |||
135 |
|
137 | |||
136 | def __str__(self): |
|
138 | def __str__(self): | |
137 | return str(self.chain) |
|
139 | return str(self.chain) |
@@ -66,9 +66,15 b' class TryNext(Exception):' | |||||
66 |
|
66 | |||
67 | Raise this in your hook function to indicate that the next |
|
67 | Raise this in your hook function to indicate that the next | |
68 | hook handler should be used to handle the operation. |
|
68 | hook handler should be used to handle the operation. | |
|
69 | If you pass arguments to the constructor those arguments will be | |||
|
70 | used by the next hook instead of the original ones. | |||
69 | """ |
|
71 | """ | |
70 |
|
72 | |||
71 |
|
73 | def __init__(self, *args, **kwargs): | ||
|
74 | self.args = args | |||
|
75 | self.kwargs = kwargs | |||
|
76 | ||||
|
77 | ||||
72 | # contains the most recently instantiated IPApi |
|
78 | # contains the most recently instantiated IPApi | |
73 | _recent = None |
|
79 | _recent = None | |
74 |
|
80 |
General Comments 0
You need to be logged in to leave comments.
Login now