From d34df5ba18fcce3c6e55d2dc16cce2adc09d8717 Mon Sep 17 00:00:00 2001 From: Philipp Rauch Date: Wed, 15 Jan 2014 18:00:28 +0100 Subject: [PATCH] bugfix --- CANLibrary/Sym2Lib.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CANLibrary/Sym2Lib.py b/CANLibrary/Sym2Lib.py index 0a78098..0662430 100644 --- a/CANLibrary/Sym2Lib.py +++ b/CANLibrary/Sym2Lib.py @@ -26,7 +26,8 @@ def readSym(symfile): continue if name == "": continue - tmp["CycleTime"] = 0 + if not tmp.has_key("CycleTime"): + tmp["CycleTime"] = 0 message[name] = tmp tmp = {} name = "" @@ -52,7 +53,7 @@ def readSym(symfile): elif line.find("ID") == 0: msg_id = line.split("=")[1].strip().rstrip("h") - tmp["ID"] = int(msg_id, 16) + tmp["ID"] = int(msg_id, 16) # convert hex to int elif line.find("DLC") == 0: tmp["DLC"] = int(line.split("=")[1].strip()) @@ -117,7 +118,7 @@ def Sym2Code(symfile, adapter = "pcan"): def Add2Adapter(pcan, symfile): ''' - @attention: not tested + ''' mes = readSym(symfile) print ""