def send(self, name, packet, *args): if self._symmetrical: namedArgs = dict() names = list(packet['args']) for i in range(len(args)): namedArgs[names[i]] = args[i] symmetrical(self._proto_name, name, namedArgs) args = list(map(lambda x: namedArgs[x], namedArgs)) formats = list(map(lambda x: packet['args'][x], list(packet['args']))) encode(self._stream, packet['id'], list(zip(args, formats)))
def send(self, name, packet, *args): formats = list(map(lambda x: packet['args'][x], list(packet['args']))) encode(self._stream, packet['id'], list(zip(args, formats)))
#!/usr/bin/env python3 from atp import encode import sys if len(sys.argv) < 2: print('Usage: [id] [value@type] [value@type] …', file=sys.stderr) exit() encode(sys.stdout.buffer, sys.argv[1], list(map(lambda x: x.split('@'), sys.argv[2:])))
#!/usr/bin/env python3 from atp import encode import sys if len(sys.argv) < 2: print("Usage: [id] [value@type] [value@type] …", file=sys.stderr) exit() encode(sys.stdout.buffer, sys.argv[1], list(map(lambda x: x.split("@"), sys.argv[2:])))