objdictgen/nodemanager.py
changeset 188 00245bc2e6fe
parent 182 988f2b302aa6
child 205 dac0f9b4e3f8
equal deleted inserted replaced
187:d3930d3f1323 188:00245bc2e6fe
    45 #-------------------------------------------------------------------------------
    45 #-------------------------------------------------------------------------------
    46 
    46 
    47 """
    47 """
    48 Format the text given with the index and subindex defined
    48 Format the text given with the index and subindex defined
    49 """
    49 """
    50 
       
    51 def StringFormat(text, idx, sub):
    50 def StringFormat(text, idx, sub):
    52     result = name_model.match(text)
    51     result = name_model.match(text)
    53     if result:
    52     if result:
    54         format = result.groups()
    53         format = result.groups()
    55         return format[0]%eval(format[1])
    54         return format[0]%eval(format[1])
   792                     value = value == "True"
   791                     value = value == "True"
   793                     self.CurrentNode.SetEntry(index, subIndex, value)
   792                     self.CurrentNode.SetEntry(index, subIndex, value)
   794                 elif editor == "time":
   793                 elif editor == "time":
   795                     self.CurrentNode.SetEntry(index, subIndex, value)
   794                     self.CurrentNode.SetEntry(index, subIndex, value)
   796                 elif editor == "number":
   795                 elif editor == "number":
   797                     self.CurrentNode.SetEntry(index, subIndex, value)
   796                     try:
       
   797                         self.CurrentNode.SetEntry(index, subIndex, int(value))
       
   798                     except:
       
   799                         pass
   798                 elif editor == "domain":
   800                 elif editor == "domain":
   799                     try:
   801                     try:
   800                         if len(value) % 2 != 0:
   802                         if len(value) % 2 != 0:
   801                             value = "0" + value
   803                             value = "0" + value
   802                         value = value.decode('hex_codec')
   804                         value = value.decode('hex_codec')