Skip to content

Commit e56f364

Browse files
committed
Offsetpage_widget: force display of unlocalized float values, remove unused format template
1 parent 15d86ae commit e56f364

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/python/gladevcp/offsetpage_widget.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,13 @@ def reload_offsets(self):
200200
else:
201201
tmpl = self.imperial_text_template
202202

203-
degree_tmpl = "%11.2f"
204-
205203
# fill each row of the liststore from the offsets arrays
206204
for row, i in enumerate([tool, g28, g30, g92]):
207205
for column in range(0, 11):
208206
if column > 8:
209207
self.store[row][column + 1] = " " # Blank R column
210208
else:
211-
self.store[row][column + 1] = locale.format_string(tmpl, i[column])
209+
self.store[row][column + 1] = tmpl % i[column]
212210
# set the current system's label's color - to make it stand out a bit
213211
if self.store[row][0] == self.current_system:
214212
if isinstance(self.foreground_color, str):
@@ -226,7 +224,7 @@ def reload_offsets(self):
226224

227225
for row, i in enumerate([g54, g55, g56, g57, g58, g59, g59_1, g59_2, g59_3]):
228226
for column in range(0, 10):
229-
self.store[row+4][column + 1] = locale.format_string(tmpl, i[column])
227+
self.store[row+4][column + 1] = tmpl % i[column]
230228
# set the current system's label's color - to make it stand out a bit
231229
if self.store[row+4][0] == self.current_system:
232230
if isinstance(self.foreground_color, str):
@@ -387,7 +385,7 @@ def system_to_p(system):
387385

388386
# set the text in the table
389387
try:
390-
self.store[row][col] = locale.format_string("%10.4f", locale.atof(new_text))
388+
self.store[row][col] = "%10.4f" % locale.atof(new_text)
391389
except Exception as error:
392390
print('new_text: ', new_text, error)
393391
print(_("offsetpage widget error: unrecognized float input"))

0 commit comments

Comments
 (0)