From: daid Date: Wed, 7 Aug 2013 07:06:29 +0000 (+0200) Subject: Screw the locale encoding issues, display dates as numbers and add our own day-of... X-Git-Tag: 13.10~105 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=32db9abd0366503aaace6cdd27b33cc74e87cfd8;p=cura.git Screw the locale encoding issues, display dates as numbers and add our own day-of-week always english list. I have had it with this issue, until python 3 comes along it is just too random. --- diff --git a/Cura/util/profile.py b/Cura/util/profile.py index 3d0b66b0..26ce4e32 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -698,11 +698,11 @@ def replaceTagMatch(m): pre = m.group(1) tag = m.group(2) if tag == 'time': - return pre + time.strftime('%H:%M:%S').encode('ascii', 'replace') + return pre + time.strftime('%H:%M:%S') if tag == 'date': - return pre + time.strftime('%d %b %Y').encode('ascii', 'replace') + return pre + time.strftime('%d-%m-%Y') if tag == 'day': - return pre + time.strftime('%a').encode('ascii', 'replace') + return pre + ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'][int(time.strftime('%w'))] if tag == 'print_time': return pre + '#P_TIME#' if tag == 'filament_amount':