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):
|
def showDebugMessage(self, message):
|
||||||
if constants.DEBUG_MODE and message.rstrip():
|
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):
|
def showMessage(self, message, noPlayer=False, noTimestamp=False, secondaryOSD=False):
|
||||||
if not noPlayer: self.showOSDMessage(message, duration=constants.OSD_DURATION, secondaryOSD=secondaryOSD)
|
if not noPlayer: self.showOSDMessage(message, duration=constants.OSD_DURATION, secondaryOSD=secondaryOSD)
|
||||||
|
|||||||
@ -94,7 +94,7 @@ class ConsoleUI(threading.Thread):
|
|||||||
if noTimestamp:
|
if noTimestamp:
|
||||||
print(message)
|
print(message)
|
||||||
else:
|
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):
|
def showDebugMessage(self, message):
|
||||||
print(message)
|
print(message)
|
||||||
|
|||||||
@ -349,7 +349,7 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
if noTimestamp:
|
if noTimestamp:
|
||||||
self.newMessage(u"{}<br />".format(message))
|
self.newMessage(u"{}<br />".format(message))
|
||||||
else:
|
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
|
@needsClient
|
||||||
def getFileSwitchState(self, filename):
|
def getFileSwitchState(self, filename):
|
||||||
@ -370,7 +370,7 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
@needsClient
|
@needsClient
|
||||||
def isItemUntrusted(self, filename):
|
def isItemUntrusted(self, filename):
|
||||||
return isURL(filename) and not self._syncplayClient.isURITrusted(filename)
|
return isURL(filename) and not self._syncplayClient.isURITrusted(filename)
|
||||||
|
|
||||||
@needsClient
|
@needsClient
|
||||||
def isFileAvailable(self, filename):
|
def isFileAvailable(self, filename):
|
||||||
if 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"&", u"&").replace(u'"', u""").replace(u"<", u"<").replace(u">", u">")
|
||||||
message = message.replace(u"\n", u"<br />")
|
message = message.replace(u"\n", u"<br />")
|
||||||
message = u"<span style=\"{}\">".format(constants.STYLE_ERRORNOTIFICATION) + message + u"</span>"
|
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
|
@needsClient
|
||||||
def joinRoom(self, room=None):
|
def joinRoom(self, room=None):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user