Commit a6eda524 authored by Sven Gestegård Robertz's avatar Sven Gestegård Robertz
Browse files

fixed python encoding example for multiple labcomm versions

parent 50540219
......@@ -5,7 +5,8 @@ import sys
import simple
if __name__ == '__main__':
encoder = labcomm.Encoder(labcomm.StreamWriter(open(sys.argv[1], 'w')))
version = sys.argv[2] if len(sys.argv) == 3 else "LabComm2013"
encoder = labcomm.Encoder(labcomm.StreamWriter(open(sys.argv[1], 'w')), version)
encoder.add_decl(simple.theTwoInts.signature)
encoder.add_decl(simple.IntString.signature)
foo = simple.theTwoInts()
......
......@@ -25,6 +25,10 @@ echo
java -cp .:../../lib/java:gen06 Encoder06 encoded_data06
./example_decoder06 encoded_data06
PYTHONPATH=../../lib/python:gen ./example_encoder.py encoded_data06 LabComm2006
java -cp .:../../lib/java:gen06 Decoder06 encoded_data06
./example_encoder06 encoded_data06
java -cp .:../../lib/java:gen06 Decoder06 encoded_data06
......
......@@ -556,7 +556,7 @@ class Encoder(Codec):
def __init__(self, writer, version="LabComm2013"):
super(Encoder, self).__init__()
self.writer = writer
self.versoin = version
self.version = version
self.writer.start(self, self.version)
def pack(self, format, *args):
......
Supports Markdown
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