Expand UTF-8

This commit is contained in:
Etoh 2023-01-04 19:04:29 +00:00
parent 0c8c865def
commit 34ed781699
23 changed files with 48 additions and 17 deletions

View File

@ -1,4 +1,4 @@
# coding:utf8
import ast import ast
import collections import collections
import hashlib import hashlib

View File

@ -1,4 +1,4 @@
# coding:utf8
from syncplay import ui from syncplay import ui
from syncplay.messages import getMessage from syncplay.messages import getMessage
from syncplay.ui.ConfigurationGetter import ConfigurationGetter from syncplay.ui.ConfigurationGetter import ConfigurationGetter

View File

@ -1,3 +1,4 @@
# coding:utf8
import sys import sys
from syncplay.clientManager import SyncplayClientManager from syncplay.clientManager import SyncplayClientManager

View File

@ -1,3 +1,4 @@
# coding:utf8
import sys import sys
from twisted.internet import reactor from twisted.internet import reactor

View File

@ -73,6 +73,21 @@ def getMissingStrings():
return missingStrings return missingStrings
def listMessages(languages):
languageNames = []
for language in languages:
languageNames.append(messages[language]["LANGUAGE"])
comparison = "Listing Syncplay messages in the following languages: {}.\n".format(", ".join(languageNames))
for message in messages["en"]:
comparison = comparison + "[{}]\n".format(message)
for language in languages:
languageName = messages[language]["LANGUAGE"]
messageText = messages[language][message] if message in messages[language] else "<UNTRANSLATED>"
comparison = comparison + "{}: {}\n".format(languageName, messageText)
comparison = comparison + "\n"
return comparison
# print(listMessages(["en","fi"]))
def getInitialLanguage(): def getInitialLanguage():
try: try:

View File

@ -1,3 +1,4 @@
# coding:utf8
from syncplay import constants from syncplay import constants

View File

@ -1,3 +1,4 @@
# coding:utf8
import os import os
from syncplay import constants from syncplay import constants
from syncplay.utils import findResourcePath from syncplay.utils import findResourcePath

View File

@ -1,3 +1,4 @@
# coding:utf8
import os.path import os.path
import subprocess import subprocess
import time import time

View File

@ -1,4 +1,4 @@
# coding:utf8
import os.path import os.path
import re import re
import time import time

View File

@ -1,4 +1,4 @@
# coding:utf8
import os.path import os.path
from syncplay import constants from syncplay import constants

View File

@ -1,3 +1,4 @@
# coding:utf8
import os import os
from syncplay import constants from syncplay import constants
from syncplay.players.mpv import MpvPlayer from syncplay.players.mpv import MpvPlayer

View File

@ -1,3 +1,4 @@
# coding:utf8
import syncplay.players import syncplay.players

View File

@ -1,4 +1,4 @@
# coding:utf8
import os import os
import random import random
import re import re

View File

@ -99,12 +99,21 @@ class SyncClientProtocol(JSONCommandProtocol):
try: try:
if "Invalid DNS-ID" in str(reason.value): if "Invalid DNS-ID" in str(reason.value):
self._client._serverSupportsTLS = False self._client._serverSupportsTLS = False
elif "tlsv1 alert protocol version" in str(reason.value): elif "atlsv1 alert protocol version" in str(reason.value):
self._client._clientSupportsTLS = False self._client._clientSupportsTLS = False
elif "certificate verify failed" in str(reason.value): elif "acertificate verify failed" in str(reason.value):
self.dropWithError(getMessage("startTLS-server-certificate-invalid")) self.dropWithError(getMessage("startTLS-server-certificate-invalid"))
elif "mismatched_id=DNS_ID" in str(reason.value): elif "amismatched_id=DNS_ID" in str(reason.value):
self.dropWithError(getMessage("startTLS-server-certificate-invalid-DNS-ID")) self.dropWithError(getMessage("startTLS-server-certificate-invalid-DNS-ID"))
elif reason:
try:
self._client.ui.showErrorMessage(str(type(reason)))
self._client.ui.showErrorMessage(str(reason))
if reason.stack:
self._client.ui.showErrorMessage(str(reason.stack))
self._client.ui.showErrorMessage(str(reason.value))
except:
pass
except: except:
pass pass
self._client.destroyProtocol() self._client.destroyProtocol()

View File

@ -1,3 +1,4 @@
# coding:utf8
import argparse import argparse
import codecs import codecs
import hashlib import hashlib

View File

@ -1,4 +1,4 @@
# coding:utf8
import argparse import argparse
import ast import ast
import codecs import codecs

View File

@ -1,4 +1,4 @@
# coding:utf8
import os import os
import sys import sys
import threading import threading

View File

@ -1,4 +1,4 @@
# coding:utf8
import re import re
import sys import sys
import threading import threading

View File

@ -1,4 +1,4 @@
# coding:utf8
import os import os
import re import re
import sys import sys

View File

@ -1,4 +1,4 @@
# coding:utf8
import ast import ast
import datetime import datetime
import hashlib import hashlib

View File

@ -1,3 +1,4 @@
# coding:utf8
import threading import threading
import socket import socket
import json import json
@ -85,8 +86,6 @@ class WindowsSocket(threading.Thread):
try: try:
self.socket.send_bytes(json.dumps(data).encode('utf-8') + b'\n') self.socket.send_bytes(json.dumps(data).encode('utf-8') + b'\n')
except OSError as ex: except OSError as ex:
if len(ex.args) == 1 and ex.args[0] == "handle is closed":
raise BrokenPipeError("handle is closed")
raise ex raise ex
def run(self): def run(self):

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# coding:utf8
import sys import sys
# libpath # libpath

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
#coding:utf8 # coding:utf8
import sys import sys