Ticket #7346: pyth.locale.patch
File pyth.locale.patch, 1.5 KB (added by , 15 years ago) |
---|
-
mythtv/bindings/python/MythTV/MythTV.py
14 14 import socket 15 15 import code 16 16 import re 17 import locale 17 18 from datetime import datetime, tzinfo, timedelta 18 19 from time import mktime 19 20 … … 21 22 from MythLog import * 22 23 23 24 log = MythLog(CRITICAL, '#%(levelname)s - %(message)s', 'MythTV') 25 locale.setlocale(locale.LC_ALL, '') 24 26 25 27 RECSTATUS = { 26 28 'TunerBusy': -8, … … 415 417 Returns a tuple of the 1, 5, and 15 minute load averages 416 418 """ 417 419 res = self.backendCommand('QUERY_LOAD').split(BACKEND_SEP) 418 return ( float(res[0]),float(res[1]),float(res[2]))420 return (locale.atof(res[0]),locale.atof(res[1]),locale.atof(res[2])) 419 421 420 422 def getUptime(self): 421 423 """ … … 909 911 self.seriesid = data[33] 910 912 self.programid = data[34] 911 913 self.lastmodified = data[35] 912 self.stars = float(data[36])914 self.stars = locale.atof(data[36]) 913 915 self.airdate = data[37] 914 916 self.hasairdate = int(data[38]) 915 917 self.playgroup = data[39] … … 963 965 string += BACKEND_SEP + self.seriesid 964 966 string += BACKEND_SEP + self.programid 965 967 string += BACKEND_SEP + self.lastmodified 966 string += BACKEND_SEP + str(self.stars)968 string += BACKEND_SEP + locale.format("%0.6f" %self.stars) 967 969 string += BACKEND_SEP + self.airdate 968 970 string += BACKEND_SEP + str(self.hasairdate) 969 971 string += BACKEND_SEP + self.playgroup