Show More
@@ -174,7 +174,7 b' def _makefpartparamsizes(nbparams):' | |||
|
174 | 174 | |
|
175 | 175 | parthandlermapping = {} |
|
176 | 176 | |
|
177 | def parthandler(parttype): | |
|
177 | def parthandler(parttype, params=()): | |
|
178 | 178 | """decorator that register a function as a bundle2 part handler |
|
179 | 179 | |
|
180 | 180 | eg:: |
@@ -188,6 +188,7 b' def parthandler(parttype):' | |||
|
188 | 188 | lparttype = parttype.lower() # enforce lower case matching. |
|
189 | 189 | assert lparttype not in parthandlermapping |
|
190 | 190 | parthandlermapping[lparttype] = func |
|
191 | func.params = frozenset(params) | |
|
191 | 192 | return func |
|
192 | 193 | return _decorator |
|
193 | 194 | |
@@ -839,7 +840,7 b' def handlereplycaps(op, inpart):' | |||
|
839 | 840 | |
|
840 | 841 | raise error.BundleValueError(**kwargs) |
|
841 | 842 | |
|
842 | @parthandler('b2x:error:pushraced') | |
|
843 | @parthandler('b2x:error:pushraced', ('message',)) | |
|
843 | 844 | def handlereplycaps(op, inpart): |
|
844 | 845 | """Used to transmit push race error over the wire""" |
|
845 | 846 | raise error.ResponseError(_('push failed:'), inpart.params['message']) |
General Comments 0
You need to be logged in to leave comments.
Login now