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

added LabComm2013 as default version for python encoder and decoder

parent 13d97334
...@@ -4,7 +4,8 @@ import labcomm ...@@ -4,7 +4,8 @@ import labcomm
import sys import sys
if __name__ == "__main__": if __name__ == "__main__":
d = labcomm.Decoder(labcomm.StreamReader(open(sys.argv[1])), sys.argv[2]) version = sys.argv[2] if len(sys.argv) == 3 else "LabComm2013"
d = labcomm.Decoder(labcomm.StreamReader(open(sys.argv[1])), version)
while True: while True:
try: try:
......
...@@ -21,4 +21,4 @@ javac -cp ../../lib/java:. *.java ...@@ -21,4 +21,4 @@ javac -cp ../../lib/java:. *.java
# Run through all executables (c->java->Python) # Run through all executables (c->java->Python)
./example_encoder one two ./example_encoder one two
java -cp ../../lib/java:. example_decoder_encoder example.encoded example.javaencoded java -cp ../../lib/java:. example_decoder_encoder example.encoded example.javaencoded
PYTHONPATH=../../lib/python ./example_decoder.py example.javaencoded LabComm2013 PYTHONPATH=../../lib/python ./example_decoder.py example.javaencoded
...@@ -553,7 +553,7 @@ class Codec(object): ...@@ -553,7 +553,7 @@ class Codec(object):
class Encoder(Codec): class Encoder(Codec):
def __init__(self, writer, version): def __init__(self, writer, version="LabComm2013"):
super(Encoder, self).__init__() super(Encoder, self).__init__()
self.writer = writer self.writer = writer
self.versoin = version self.versoin = version
...@@ -634,7 +634,7 @@ class Encoder(Codec): ...@@ -634,7 +634,7 @@ class Encoder(Codec):
# self.pack("!i%ds" % len(s), len(s), s) # self.pack("!i%ds" % len(s), len(s), s)
class Decoder(Codec): class Decoder(Codec):
def __init__(self, reader, version): def __init__(self, reader, version="LabComm2013"):
super(Decoder, self).__init__() super(Decoder, self).__init__()
self.reader = reader self.reader = reader
self.version = version self.version = version
......
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