コード例 #1
0
 def parse_line(self, line):
     value_strs = line.split('\t')   
     values_bin = [''.join(v.split(' ')) for v in value_strs] 
     try:
         values = [int(v, 2) for v in values_bin]
     except ValueError as e:
         if values_bin == ['']:
             raise dec.OutputFormatException("you have a non-integer in this list: {}. If this is logisim output, are you sure you have a circ file for this test?".format(values_bin))
         else :
             raise dec.OutputFormatException("you have a non-integer in this list: {}".format(values_bin))
     self.format.validate(values)
     return values
コード例 #2
0
 def parse_line(self, line):
     value_strs = line.split('\t')   
     values_bin = [''.join(v.split(' ')) for v in value_strs] 
     try:
         values = [int(v, 2) for v in values_bin]
     except ValueError as e:
         raise dec.OutputFormatException("non-integer in {}".format(values_bin))
     self.format.validate(values)
     return values