comparison Generic/fiebdc.py @ 20:f5ec50b625d1

Prevent subfield units remains empty
author Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
date Thu, 11 Sep 2014 19:03:07 +0200
parents bea86fd8dfc6
children f7e0cc58737f
comparison
equal deleted inserted replaced
19:bea86fd8dfc6 20:f5ec50b625d1
1140 if _height != u"": _height = float(_height) 1140 if _height != u"": _height = float(_height)
1141 except ValueError: 1141 except ValueError:
1142 print utils.mapping(_("The measure values are not float "\ 1142 print utils.mapping(_("The measure values are not float "\
1143 "numbers, code $1"), (_codes.encode("utf8"),)) 1143 "numbers, code $1"), (_codes.encode("utf8"),))
1144 return 1144 return
1145 # Prevent subfield units remains empty.
1146 if (_units == u"" and (_length != u"" or _width != u""
1147 or _height != u"")):
1148 _units = 1.0
1145 _line_list.append([_linetype, _comment, _units, 1149 _line_list.append([_linetype, _comment, _units,
1146 _length, _width, _height, _formula]) 1150 _length, _width, _height, _formula])
1147 _line_index = _line_index + 6 1151 _line_index = _line_index + 6
1148 self.__budget.setTree(_parent_code, _child_code.encode("utf8"), _path, "", "", 1152 self.__budget.setTree(_parent_code, _child_code.encode("utf8"), _path, "", "",
1149 _total, _line_list, _label.encode("utf8"), _record_type.encode("utf8")) 1153 _total, _line_list, _label.encode("utf8"), _record_type.encode("utf8"))