server/hook.py
branchstable
changeset 6767 0a18f25c16a7
parent 6765 b922e3a817e9
child 6784 562dd184cbc7
equal deleted inserted replaced
6766:1b091b3a0d1e 6767:0a18f25c16a7
   353     """
   353     """
   354     def __init__(self, *expected, **more):
   354     def __init__(self, *expected, **more):
   355         self.expected = expected
   355         self.expected = expected
   356         self.frometypes = more.pop('frometypes', None)
   356         self.frometypes = more.pop('frometypes', None)
   357         self.toetypes = more.pop('toetypes', None)
   357         self.toetypes = more.pop('toetypes', None)
       
   358         assert not more, "unexpected kwargs in match_rtype: %s" % more
   358 
   359 
   359     @lltrace
   360     @lltrace
   360     def __call__(self, cls, req, *args, **kwargs):
   361     def __call__(self, cls, req, *args, **kwargs):
   361         if kwargs.get('rtype') not in self.expected:
   362         if kwargs.get('rtype') not in self.expected:
   362             return 0
   363             return 0