diff --git a/.travis.yml b/.travis.yml index a2c67ae..6044335 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,7 @@ before_install: install: - pip install twisted appnope +- pip install -U https://github.com/requests/requests/zipball/master #- git clone -b qtpy-pyside2 https://github.com/alby128/syncplay.git syncplay-qtpy-PySide2 #- cd syncplay-qtpy-PySide2 #- git checkout qtpy-pyside2 diff --git a/buildPy2app.py b/buildPy2app.py index f889c3d..74cb424 100644 --- a/buildPy2app.py +++ b/buildPy2app.py @@ -15,7 +15,7 @@ DATA_FILES = [ ] OPTIONS = { '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'}, 'qt_plugins': ['platforms/libqcocoa.dylib', 'platforms/libqminimal.dylib','platforms/libqoffscreen.dylib'], 'plist': { diff --git a/buildPy2exe.py b/buildPy2exe.py index bff96a4..881667c 100755 --- a/buildPy2exe.py +++ b/buildPy2exe.py @@ -721,8 +721,8 @@ info = dict( options={'py2exe': { 'dist_dir': OUT_DIR, 'packages': 'PySide2.QtUiTools', - 'includes': 'twisted, sys, encodings, datetime, os, time, math, PySide2, liburl, ast, unicodedata', - 'excludes': 'venv, _ssl, doctest, pdb, unittest, win32clipboard, win32file, win32pdh, win32security, win32trace, win32ui, winxpgui, win32pipe, win32process, Tkinter', + 'includes': 'twisted, sys, encodings, datetime, os, time, math, PySide2, liburl, ast, unicodedata, _ssl', + 'excludes': 'venv, doctest, pdb, unittest, win32clipboard, win32file, win32pdh, win32security, win32trace, win32ui, winxpgui, win32pipe, win32process, Tkinter', 'dll_excludes': 'msvcr71.dll, MSVCP90.dll, POWRPROF.dll', 'optimize': 2, 'compressed': 1 diff --git a/resources/third-party-notices.rtf b/resources/third-party-notices.rtf index 5ef095d..e67066e 100644 --- a/resources/third-party-notices.rtf +++ b/resources/third-party-notices.rtf @@ -208,4 +208,18 @@ furnished to do so, subject to the following conditions:\ The above copyright notice and this permission notice shall be included in\ all copies or substantial portions of the Software.\ \ -} \ No newline at end of file + +\b Requests\ +\ + +\b0 Copyright 2018 Kenneth Reitz\ +\ +Licensed under the Apache License, Version 2.0 (the \'93License\'94); you may not use this file\ +except in compliance with the License. You may obtain a copy of the License at\ +\ +http://www.apache.org/licenses/LICENSE-2.0\ +\ +Unless required by applicable law or agreed to in writing, software distributed under the \ +License is distributed on an \'93AS IS\'94 BASIS, WITHOUT WARRANTIES OR CONDI-\ +TIONS OF ANY KIND, either express or implied. See the License for the specific lang-\ +uage governing permissions and limitations under the License.} \ No newline at end of file diff --git a/syncplay/client.py b/syncplay/client.py index e8cb8b5..665da98 100644 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -11,7 +11,8 @@ from twisted.internet import reactor, task, defer, threads from functools import wraps from copy import deepcopy 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.constants import PRIVACY_SENDHASHED_MODE, PRIVACY_DONTSEND_MODE, \ PRIVACY_HIDDENFILENAME @@ -910,12 +911,15 @@ class SyncplayClient(object): def checkForUpdate(self, userInitiated): try: - import urllib, syncplay, sys, messages, json - params = urllib.urlencode({'version': syncplay.version, 'milestone': syncplay.milestone, 'release_number': syncplay.release_number, - 'language': messages.messages["CURRENT"], 'platform': sys.platform, 'userInitiated': userInitiated}) - - f = urllib.urlopen(constants.SYNCPLAY_UPDATE_URL.format(params)) - response = f.read() + import syncplay, sys, messages, urllib, json + params = urllib.urlencode({'version': syncplay.version, 'milestone': syncplay.milestone, 'release_number': syncplay.release_number, 'language': messages.messages["CURRENT"], 'platform': sys.platform, 'userInitiated': userInitiated}) + if isMacOS(): + import requests + response = requests.get(constants.SYNCPLAY_UPDATE_URL.format(params)) + response = response.text + else: + f = urllib.urlopen(constants.SYNCPLAY_UPDATE_URL.format(params)) + response = f.read() response = response.replace("
","").replace("
","").replace("","").replace("
","").replace("