Commit 86c8f6fe authored by Dimitris Lampridis's avatar Dimitris Lampridis

[sw] [pywrap] fix decorator

parent 5bf262e1
......@@ -34,18 +34,16 @@ class wrtd_tstamp(Structure):
yield 'frac' , self.frac
@decorator.decorator
def encode_arguments(func):
def encode_arguments(func, *args, **kwargs):
"""Used to convert arguments from strings to bytes"""
def wrapper(self, *args, **kwargs):
encoded = []
for arg in args:
if(type(arg) == str):
encoded.append(arg.encode('utf-8'))
else:
encoded.append(arg)
args = tuple(encoded)
return func(self, *args, **kwargs)
return wrapper
encoded = []
for arg in args:
if(type(arg) == str):
encoded.append(arg.encode('utf-8'))
else:
encoded.append(arg)
args = tuple(encoded)
return func(*args, **kwargs)
class PyWrtd():
"""Top-level Python wrapper class for WRTD library.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment