Fix UTF-8 time issue (#131)
This commit is contained in:
parent
31ecb7494e
commit
c7e7114d37
@ -1341,7 +1341,7 @@ class UiManager(object):
|
||||
|
||||
def showDebugMessage(self, message):
|
||||
if constants.DEBUG_MODE and message.rstrip():
|
||||
sys.stderr.write("{}{}\n".format(time.strftime(constants.UI_TIME_FORMAT, time.localtime()),message.rstrip()))
|
||||
sys.stderr.write("{}{}\n".format(time.strftime(constants.UI_TIME_FORMAT, time.localtime()).decode('utf-8'),message.rstrip()))
|
||||
|
||||
def showMessage(self, message, noPlayer=False, noTimestamp=False, secondaryOSD=False):
|
||||
if not noPlayer: self.showOSDMessage(message, duration=constants.OSD_DURATION, secondaryOSD=secondaryOSD)
|
||||
|
||||
@ -94,7 +94,7 @@ class ConsoleUI(threading.Thread):
|
||||
if noTimestamp:
|
||||
print(message)
|
||||
else:
|
||||
print(time.strftime(constants.UI_TIME_FORMAT, time.localtime()) + message)
|
||||
print(time.strftime(constants.UI_TIME_FORMAT, time.localtime()).decode('utf-8') + message)
|
||||
|
||||
def showDebugMessage(self, message):
|
||||
print(message)
|
||||
|
||||
@ -349,7 +349,7 @@ class MainWindow(QtGui.QMainWindow):
|
||||
if noTimestamp:
|
||||
self.newMessage(u"{}<br />".format(message))
|
||||
else:
|
||||
self.newMessage(time.strftime(constants.UI_TIME_FORMAT, time.localtime()) + message + u"<br />")
|
||||
self.newMessage(time.strftime(constants.UI_TIME_FORMAT, time.localtime()).decode('utf-8') + message + u"<br />")
|
||||
|
||||
@needsClient
|
||||
def getFileSwitchState(self, filename):
|
||||
@ -370,7 +370,7 @@ class MainWindow(QtGui.QMainWindow):
|
||||
@needsClient
|
||||
def isItemUntrusted(self, filename):
|
||||
return isURL(filename) and not self._syncplayClient.isURITrusted(filename)
|
||||
|
||||
|
||||
@needsClient
|
||||
def isFileAvailable(self, filename):
|
||||
if filename:
|
||||
@ -681,7 +681,7 @@ class MainWindow(QtGui.QMainWindow):
|
||||
message = message.replace(u"&", u"&").replace(u'"', u""").replace(u"<", u"<").replace(u">", u">")
|
||||
message = message.replace(u"\n", u"<br />")
|
||||
message = u"<span style=\"{}\">".format(constants.STYLE_ERRORNOTIFICATION) + message + u"</span>"
|
||||
self.newMessage(time.strftime(constants.UI_TIME_FORMAT, time.localtime()) + message + u"<br />")
|
||||
self.newMessage(time.strftime(constants.UI_TIME_FORMAT, time.localtime()).decode('utf-8') + message + u"<br />")
|
||||
|
||||
@needsClient
|
||||
def joinRoom(self, room=None):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user