Fix issue #184
This commit is contained in:
parent
f385019fa4
commit
a58aa6de54
@ -32,6 +32,7 @@ before_install:
|
|||||||
|
|
||||||
install:
|
install:
|
||||||
- pip3 install twisted appnope
|
- pip3 install twisted appnope
|
||||||
|
- pip3 install -U https://github.com/requests/requests/zipball/master
|
||||||
|
|
||||||
|
|
||||||
before_deploy:
|
before_deploy:
|
||||||
|
|||||||
@ -15,7 +15,7 @@ DATA_FILES = [
|
|||||||
]
|
]
|
||||||
OPTIONS = {
|
OPTIONS = {
|
||||||
'iconfile':'resources/icon.icns',
|
'iconfile':'resources/icon.icns',
|
||||||
'includes': {'PySide2.QtCore', 'PySide2.QtUiTools', 'PySide2.QtGui','PySide2.QtWidgets'},
|
'includes': {'PySide2.QtCore', 'PySide2.QtUiTools', 'PySide2.QtGui','PySide2.QtWidgets', 'certifi'},
|
||||||
'excludes': {'PySide', 'PySide.QtCore', 'PySide.QtUiTools', 'PySide.QtGui'},
|
'excludes': {'PySide', 'PySide.QtCore', 'PySide.QtUiTools', 'PySide.QtGui'},
|
||||||
'qt_plugins': ['platforms/libqcocoa.dylib', 'platforms/libqminimal.dylib','platforms/libqoffscreen.dylib'],
|
'qt_plugins': ['platforms/libqcocoa.dylib', 'platforms/libqminimal.dylib','platforms/libqoffscreen.dylib'],
|
||||||
'plist': {
|
'plist': {
|
||||||
|
|||||||
@ -721,8 +721,8 @@ info = dict(
|
|||||||
options={'py2exe': {
|
options={'py2exe': {
|
||||||
'dist_dir': OUT_DIR,
|
'dist_dir': OUT_DIR,
|
||||||
'packages': 'PySide2.QtUiTools',
|
'packages': 'PySide2.QtUiTools',
|
||||||
'includes': 'twisted, sys, encodings, datetime, os, time, math, PySide2, liburl, ast, unicodedata',
|
'includes': 'twisted, sys, encodings, datetime, os, time, math, PySide2, liburl, ast, unicodedata, _ssl',
|
||||||
'excludes': 'venv, _ssl, doctest, pdb, unittest, win32clipboard, win32file, win32pdh, win32security, win32trace, win32ui, winxpgui, win32pipe, win32process, Tkinter',
|
'excludes': 'venv, doctest, pdb, unittest, win32clipboard, win32file, win32pdh, win32security, win32trace, win32ui, winxpgui, win32pipe, win32process, Tkinter',
|
||||||
'dll_excludes': 'msvcr71.dll, MSVCP90.dll, POWRPROF.dll',
|
'dll_excludes': 'msvcr71.dll, MSVCP90.dll, POWRPROF.dll',
|
||||||
'optimize': 2,
|
'optimize': 2,
|
||||||
'compressed': 1
|
'compressed': 1
|
||||||
|
|||||||
@ -11,7 +11,8 @@ from twisted.internet import reactor, task, defer, threads
|
|||||||
from functools import wraps
|
from functools import wraps
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from syncplay.protocols import SyncClientProtocol
|
from syncplay.protocols import SyncClientProtocol
|
||||||
from syncplay import utils, constants
|
from syncplay import utils, constants, version
|
||||||
|
from syncplay.utils import isMacOS
|
||||||
from syncplay.messages import getMissingStrings, getMessage
|
from syncplay.messages import getMissingStrings, getMessage
|
||||||
from syncplay.constants import PRIVACY_SENDHASHED_MODE, PRIVACY_DONTSEND_MODE, \
|
from syncplay.constants import PRIVACY_SENDHASHED_MODE, PRIVACY_DONTSEND_MODE, \
|
||||||
PRIVACY_HIDDENFILENAME
|
PRIVACY_HIDDENFILENAME
|
||||||
@ -908,12 +909,15 @@ class SyncplayClient(object):
|
|||||||
def checkForUpdate(self, userInitiated):
|
def checkForUpdate(self, userInitiated):
|
||||||
try:
|
try:
|
||||||
import urllib.request, urllib.parse, urllib.error, syncplay, sys, json
|
import urllib.request, urllib.parse, urllib.error, syncplay, sys, json
|
||||||
params = urllib.parse.urlencode({'version': syncplay.version, 'milestone': syncplay.milestone, 'release_number': syncplay.release_number,
|
params = urllib.parse.urlencode({'version': syncplay.version, 'milestone': syncplay.milestone, 'release_number': syncplay.release_number, 'language': syncplay.messages.messages["CURRENT"], 'platform': sys.platform, 'userInitiated': userInitiated})
|
||||||
'language': syncplay.messages.messages["CURRENT"], 'platform': sys.platform, 'userInitiated': userInitiated})
|
if isMacOS():
|
||||||
|
import requests
|
||||||
f = urllib.request.urlopen(constants.SYNCPLAY_UPDATE_URL.format(params))
|
response = requests.get(constants.SYNCPLAY_UPDATE_URL.format(params))
|
||||||
response = f.read()
|
response = response.text
|
||||||
response = response.decode('utf-8')
|
else:
|
||||||
|
f = urllib.request.urlopen(constants.SYNCPLAY_UPDATE_URL.format(params))
|
||||||
|
response = f.read()
|
||||||
|
response = response.decode('utf-8')
|
||||||
response = response.replace("<p>","").replace("</p>","").replace("<br />","").replace("“","\"").replace("”","\"") # Fix Wordpress
|
response = response.replace("<p>","").replace("</p>","").replace("<br />","").replace("“","\"").replace("”","\"") # Fix Wordpress
|
||||||
response = json.loads(response)
|
response = json.loads(response)
|
||||||
publicServers = None
|
publicServers = None
|
||||||
|
|||||||
@ -20,6 +20,7 @@ class GuiConfiguration:
|
|||||||
self.config = config
|
self.config = config
|
||||||
self._availablePlayerPaths = []
|
self._availablePlayerPaths = []
|
||||||
self.error = error
|
self.error = error
|
||||||
|
constants.DEBUG_MODE = config['debug']
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if QCoreApplication.instance() is None:
|
if QCoreApplication.instance() is None:
|
||||||
@ -342,7 +343,7 @@ class ConfigDialog(QtWidgets.QDialog):
|
|||||||
try:
|
try:
|
||||||
servers = utils.getListOfPublicServers()
|
servers = utils.getListOfPublicServers()
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
self.showErrorMessage(str(e))
|
self.showErrorMessage(e.args[0])
|
||||||
return
|
return
|
||||||
currentServer = self.hostCombobox.currentText()
|
currentServer = self.hostCombobox.currentText()
|
||||||
self.hostCombobox.clear()
|
self.hostCombobox.clear()
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import ast
|
|||||||
import unicodedata
|
import unicodedata
|
||||||
import platform
|
import platform
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import traceback
|
||||||
|
|
||||||
folderSearchEnabled = True
|
folderSearchEnabled = True
|
||||||
|
|
||||||
@ -375,12 +376,16 @@ def open_system_file_browser(path):
|
|||||||
|
|
||||||
def getListOfPublicServers():
|
def getListOfPublicServers():
|
||||||
try:
|
try:
|
||||||
import urllib.request, urllib.parse, urllib.error, syncplay, sys, json
|
import urllib.request, urllib.parse, urllib.error, syncplay, sys
|
||||||
params = urllib.parse.urlencode({'version': syncplay.version, 'milestone': syncplay.milestone, 'release_number': syncplay.release_number,
|
params = urllib.parse.urlencode({'version': syncplay.version, 'milestone': syncplay.milestone, 'release_number': syncplay.release_number, 'language': syncplay.messages.messages["CURRENT"]})
|
||||||
'language': syncplay.messages.messages["CURRENT"]})
|
if isMacOS():
|
||||||
f = urllib.request.urlopen(constants.SYNCPLAY_PUBLIC_SERVER_LIST_URL.format(params))
|
import requests
|
||||||
response = f.read()
|
response = requests.get(constants.SYNCPLAY_PUBLIC_SERVER_LIST_URL.format(params))
|
||||||
response = response.decode('utf-8')
|
response = response.text
|
||||||
|
else:
|
||||||
|
f = urllib.request.urlopen(constants.SYNCPLAY_PUBLIC_SERVER_LIST_URL.format(params))
|
||||||
|
response = f.read()
|
||||||
|
response = response.decode('utf-8')
|
||||||
response = response.replace("<p>","").replace("</p>","").replace("<br />","").replace("“","'").replace("”","'").replace(":’","'").replace("’","'").replace("′","'").replace("\n","").replace("\r","") # Fix Wordpress
|
response = response.replace("<p>","").replace("</p>","").replace("<br />","").replace("“","'").replace("”","'").replace(":’","'").replace("’","'").replace("′","'").replace("\n","").replace("\r","") # Fix Wordpress
|
||||||
response = ast.literal_eval(response)
|
response = ast.literal_eval(response)
|
||||||
|
|
||||||
@ -389,7 +394,11 @@ def getListOfPublicServers():
|
|||||||
else:
|
else:
|
||||||
raise IOError
|
raise IOError
|
||||||
except:
|
except:
|
||||||
raise IOError(getMessage("failed-to-load-server-list-error"))
|
if constants.DEBUG_MODE == True:
|
||||||
|
traceback.print_exc()
|
||||||
|
raise
|
||||||
|
else:
|
||||||
|
raise IOError(getMessage("failed-to-load-server-list-error"))
|
||||||
|
|
||||||
class RoomPasswordProvider(object):
|
class RoomPasswordProvider(object):
|
||||||
CONTROLLED_ROOM_REGEX = re.compile("^\+(.*):(\w{12})$")
|
CONTROLLED_ROOM_REGEX = re.compile("^\+(.*):(\w{12})$")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user