Skip to content

Commit

Permalink
Merge pull request LinuxCNC#2776 from dwrobel/Fix-module-locale-has-n…
Browse files Browse the repository at this point in the history
…o-attribute-format

Fix module 'locale' has no attribute 'format'
  • Loading branch information
c-morley authored Dec 12, 2023
2 parents 6456382 + 8d9dec5 commit 78e2ce1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/python/qtvcp/widgets/origin_offsetview.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,18 +267,18 @@ def reload_offsets(self):
else:
tmpl = self.imperial_text_template

degree_tmpl = "%{}.2f".format(len(locale.format(tmpl, 0)))
degree_tmpl = "%{}.2f".format(len(locale.format_string(tmpl, 0)))

# fill each row of the liststore from the offsets arrays
for row, i in enumerate([ap, rot, g92, tool, g54, g55, g56, g57, g58, g59, g59_1, g59_2, g59_3]):
for column in range(0, 9):
if row == 1:
if column == 2:
self.tabledata[row][column] = locale.format(degree_tmpl, rot)
self.tabledata[row][column] = locale.format_string(degree_tmpl, rot)
else:
self.tabledata[row][column] = " "
else:
self.tabledata[row][column] = locale.format(tmpl, i[column])
self.tabledata[row][column] = locale.format_string(tmpl, i[column])
self.tablemodel.layoutChanged.emit()

# We read the var file directly
Expand Down

0 comments on commit 78e2ce1

Please sign in to comment.