aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/parsedump.py
diff options
context:
space:
mode:
Diffstat (limited to 'klippy/parsedump.py')
-rwxr-xr-xklippy/parsedump.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/klippy/parsedump.py b/klippy/parsedump.py
index 6d419183..93d8d14e 100755
--- a/klippy/parsedump.py
+++ b/klippy/parsedump.py
@@ -7,12 +7,14 @@
import os, sys, logging
import msgproto
+
def read_dictionary(filename):
- dfile = open(filename, 'rb')
+ dfile = open(filename, "rb")
dictionary = dfile.read()
dfile.close()
return dictionary
+
def main():
dict_filename, data_filename = sys.argv[1:]
@@ -21,7 +23,7 @@ def main():
mp = msgproto.MessageParser()
mp.process_identify(dictionary, decompress=False)
- f = open(data_filename, 'rb')
+ f = open(data_filename, "rb")
fd = f.fileno()
data = bytearray()
while 1:
@@ -38,8 +40,9 @@ def main():
data = data[-l:]
continue
msgs = mp.dump(data[:l])
- sys.stdout.write('\n'.join(msgs[1:]) + '\n')
+ sys.stdout.write("\n".join(msgs[1:]) + "\n")
data = data[l:]
-if __name__ == '__main__':
+
+if __name__ == "__main__":
main()