Commits

fab31 committed b003f44

cleaned up the Special tag class (fix #20)

Comments (0)

Files changed (1)

zicbee_lib/parser.py

 class Special(Tag):
     """ Special (no python meaning) node """
 
+    preserve_suffix = True
+
     def __eq__(self, other):
         return self.name == getattr(other, 'name', None) if other else False
 
     def __repr__(self):
+        if self.preserve_suffix:
+            name = self.name
+        else:
+            name = self.name[:-1]
+
         if self.value:
-            return "%s %s"%(self.name, self.value)
+            return "%s %s"%(name, self.value)
         else:
-            return self.name[:-1]
+            return name
 
     def python(self, cnt):
         return '' # Not applicable