misc: papi - add __repr__ to FuncWrapper 48/20248/5
authorPaul Vinciguerra <pvinci@vinciconsulting.com>
Thu, 20 Jun 2019 02:19:02 +0000 (22:19 -0400)
committerNeale Ranns <nranns@cisco.com>
Thu, 20 Jun 2019 07:29:06 +0000 (07:29 +0000)
Eases troubleshooting.

Changes:
   <FuncWrapper object at 0x7fa7402de790>
to
  <FuncWrapper(func=<want_ip6_ra_events(u16 _vl_msg_id, u32 client_index, u32 context, u8 enable_disable, u32 pid)>)>

Type: refactor
Change-Id: I3a893090e024a63a0b3b0de51cb3bb2d2a1678c5
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
src/vpp-api/python/vpp_papi/vpp_papi.py

index 5d35b02..5207bbf 100644 (file)
@@ -104,6 +104,9 @@ class FuncWrapper(object):
     def __call__(self, **kwargs):
         return self._func(**kwargs)
 
+    def __repr__(self):
+        return '<FuncWrapper(func=<%s(%s)>)>' % (self.__name__, self.__doc__)
+
 
 class VPPApiError(Exception):
     pass