sim: fix message debug formatting

This commit is contained in:
Sebastien Bourdeauducq 2012-03-08 15:27:35 +01:00
parent 98e96b3952
commit decbd069fa
1 changed files with 6 additions and 4 deletions

View File

@ -15,12 +15,14 @@ class Message:
setattr(self, parameter[1], value)
def __str__(self):
p = ""
p = []
for parameter in self.parameters:
p += parameter[1] + "=" + str(getattr(self, parameter[1]))
p.append(parameter[1] + "=" + str(getattr(self, parameter[1])))
if p:
p = " " + p
return "<" + self.__class__.__name__ + p + ">"
pf = " " + " ".join(p)
else:
pf = ""
return "<" + self.__class__.__name__ + pf + ">"
class MessageTick(Message):
code = 0