#
from __future__ import print_function
+from __future__ import absolute_import
import sys
import os
import logging
import atexit
from cffi import FFI
import cffi
-from vpp_serializer import VPPType, VPPEnumType, VPPUnionType, BaseTypes
+from . vpp_serializer import VPPType, VPPEnumType, VPPUnionType, BaseTypes
+from . vpp_serializer import VPPMessage
if sys.version[0] == '2':
import Queue as queue
return self._func(**kwargs)
-class VPPMessage(VPPType):
- pass
-
class VPP():
"""VPP interface.
f.__name__ = str(msg.name)
f.__doc__ = ", ".join(["%s %s" %
- (msg.fieldtypes[j], k) for j, k in enumerate(msg.fields)])
+ (msg.fieldtypes[j], k)
+ for j, k in enumerate(msg.fields)])
return f
def _register_functions(self, async=False):
def validate_args(self, msg, kwargs):
d = set(kwargs.keys()) - set(msg.field_by_name.keys())
if d:
- raise ValueError('Invalid argument {} to {}'.format(list(d), msg.name))
+ raise ValueError('Invalid argument {} to {}'
+ .format(list(d), msg.name))
def _call_vpp(self, i, msg, multipart, **kwargs):
"""Given a message, send the message and await a reply.