Merged master_local in qtpy-pyside2

This commit is contained in:
alby128 2018-01-08 15:48:47 +01:00
commit 09b2c1446d
11 changed files with 92 additions and 58 deletions

View File

@ -1,53 +1,59 @@
environment:
MINICONDA: "C:\\Miniconda"
clone_folder: c:\projects\syncplay
image:
- Visual Studio 2013
platform: x86
configuration: Release
init:
- set PATH=C:\Miniconda;C:\Miniconda\Scripts;%PATH%
- cmd: conda create -n syncplay -y
- cmd: activate syncplay
- cmd: conda install python pywin32 -y
- cmd: conda install -c conda-forge pyside2 -y
- cmd: pip install twisted py2exe_py2 zope.interface
- cmd: type nul > C:\Miniconda\envs\syncplay\lib\site-packages\zope\__init__.py
- cmd: pip freeze
- cmd: conda list
- set PATH=C:\Miniconda;C:\Miniconda\Scripts;C:\Program Files (x86)\NSIS;%PATH%
- conda create -n syncplay -y
- activate syncplay
- conda install python pywin32 -y
- conda install -c conda-forge pyside2 -y
- pip install twisted py2exe_py2 zope.interface
- type nul > C:\Miniconda\envs\syncplay\lib\site-packages\zope\__init__.py
- pip freeze
- conda list
install:
- cmd: cd c:\projects\syncplay
- cmd: python buildPy2exe.py
- cmd: del C:\projects\syncplay\syncplay_v1.5.0\lib\api-*
- cmd: del C:\projects\syncplay\syncplay_v1.5.0\lib\DNSAPI.dll
- cmd: del C:\projects\syncplay\syncplay_v1.5.0\lib\IPHLPAPI.dll
- cmd: del C:\projects\syncplay\syncplay_v1.5.0\lib\MPR.dll
- cmd: mkdir C:\projects\syncplay\syncplay_v1.5.0\platforms
- cmd: copy C:\Miniconda\envs\syncplay\library\plugins\platforms\qwindows.dll C:\projects\syncplay\syncplay_v1.5.0\platforms\
- cd %APPVEYOR_BUILD_FOLDER%
- for /F "tokens=2 delims='" %%a in ('findstr version syncplay\__init__.py') do @set ver=%%a
- python buildPy2exe.py
- del syncplay_v%ver%\lib\api-*
- del syncplay_v%ver%\lib\DNSAPI.dll
- del syncplay_v%ver%\lib\IPHLPAPI.dll
- del syncplay_v%ver%\lib\MPR.dll
- mkdir syncplay_v%ver%\platforms
#- copy C:\Miniconda\envs\syncplay\library\plugins\platforms\qwindows.dll C:\projects\syncplay\syncplay_v1.5.0\platforms\
# Not a project with an msbuild file, build done at install.
build: off
artifacts:
path: 'syncplay_v1.5.0'
- path: 'syncplay_v$(ver)'
type: zip
name: Syncplay_win_pyside2
name: Syncplay-$(ver)-win-pyside2
- path: Syncplay-$(ver)-Setup.exe
name: Syncplay-$(ver)-win-setup-pyside2
# Push artefact to S3 bucket and list all
before_deploy:
- cmd: python -c "from PySide2 import QtCore; print QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.PluginsPath)"
- dir
#- python -c "from PySide2 import QtCore; print QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.PluginsPath)"
# Deploy build to Amazon S3 bucket
# Deploy build to BinTray
deploy:
provider: S3
access_key_id: AKIAJS554GLAZJ5L6TUA
secret_access_key:
secure: ZPxgm95K1SIqcFlqwoMWmGpPfctamQhhAedoyCT4RDQM/+VbdFLfEfUtu3rZZeBm
bucket: syncplay
region: eu-central-1
set_public: true
provider: BinTray
username: alby128
api_key:
secure: lAocj5KA9Z9x4BefQBIgNlQJbeW4qPBfCgYVBHMyOP3NgyhnMLmvR57ZCqtCKBlQ
subject: alby128
repo: Syncplay
package: Syncplay
version: "test"
publish: true
override: true

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ venv
/build
/dist
/syncplay v*
/syncplay_v*
syncplay_setup.nsi
dist.7z
.*

View File

@ -39,16 +39,13 @@ before_deploy:
- mv resources/macos_vlc_install.command resources/.macos_vlc_install.command
- mv resources/lua/intf/syncplay.lua resources/lua/intf/.syncplay.lua
- mv resources/macOS_readme.pdf resources/.macOS_readme.pdf
- dmgbuild -s appdmg.py "Syncplay" dist_dmg/Syncplay-qtpy-pyside2.dmg
- export VER="$(cat syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}')"
- dmgbuild -s appdmg.py "Syncplay" dist_dmg/Syncplay_${VER}_macOS_pyside2.dmg
deploy:
provider: s3
access_key_id: AKIAJS554GLAZJ5L6TUA
secret_access_key:
secure: "iDuHZ6lgASU1O/9UKncgKfJZ96PpLzdKKvASDKCDPWBXXI5LyjGIIZJxbdjcE+WVoHYCCrN9Xn2XvhEjapqBzD2uKMH4QvN5mOG62FaPPOIPr+CCZxuEQuUQ8LUSIwQO3huu0K4eLn6q5b/ihmiWkTAssZFx1pccv15CJiwVPDwunULC2P55d/GxRohN2HcHDHGbHwlXasgvOx68xxbDEO4Ox7KRwcSIHnmx6vInQtzpqdnme8t1kmGG2vp6juyh39vCN0RzoJ5aH17qht/0nNvkbxnPcUg7jsDayOuWiwMgp4s+EYdyCh33IM3LQugxPqa3za5yjYQqC92SoaQg8FnsoU1sf7FHMCmb4mv8ZwgTD78+Ood/7lKHaOVGnxkoBtdrtXXf2tU/WyAGXTw4zc6eA+MIXC6FmNQFJaRUvGZPF+u+awHNJGAlmIhFOASBW4Ua6qahNzcasRE8e3cuzYuVzK4R24TRWqjYCadHd6SNh2FKVGYEKK1FcADUxn5GzldcovG3wsHRK6ONCS57s5xBlajVfEB4b78EqYkRgQQTAnCvNcUAbfsJOYywtSj/4keaGQeRydoY9qMl6MPpVXqn+r9bbglLBIOPzUr2EWXj/O6gq7bd9eSwCa1PvGplboDahkfWmVZKJ6rZpuvUfoQcKmuJiIpgowCczP9NNco="
bucket: syncplay
skip_cleanup: true
region: eu-central-1
local_dir: dist_dmg
on:
branch: qtpy-pyside2
on: master_local
provider: bintray
file: "bintray.json"
user: alby128
key:
secure: "N4XK9IxGEj+5aMskTEvUWwXSMXtHDFcjiLvnPRzVT3OOTSAA2AYjlH975MGiGEanap5gq5ftIo+M2TVNfiqflE9GSlFir+KfzabheoONZVegAq2sG6rDq9YElGJ8JefEb2O8vZykeyvow6TBxcsFdbV44RbGmf4obLALXKgK1cXG8MCKj8VOxVZpgaXFnNCxVlN1AlORx6MQ4ukaZMuO7fDnHjAgnkGlZOBq7/kMJfYGdZvLkKoe6qEoZHJQxVTcA3pkIwRQci5kx/AAxCuKcXYLpoHot5dytIumk0iwfzDqN4uUX5qOG8o2FrWy+7z/Yt7W97lA5c6hVltsoX5dqp0WB14EKgYq+wQwSNcI6tInjogDo4JnGSu1Tpmsy+Fc3Y5Z1cD29hWimxcC8h/wlm9C2hOjfEsdLOfkghevMjRdAW2RIIA8/KmR1Xi2EX78Q75wrPHvo4/4x0Cw0ZviN2wC9LY3GU8tmGjjC0P+WsF4M1Y9by2H2xLHuYPB7h7OnlD67d8pPQVq84Yl2jq9kT2PoYjlNwqWz1r/PsLBCGlXQtlTc7FQKXUAREFwBJY+b5mk2xMsiZZsNrtIfRQ2roDbHws+M0mAQPo1eqeDKLPH8fkDf/ZhWzE+swLadoGxuwKSux53ySAp7CQeObJYWJ3eHfO0cI21DZmd9uyjayA="

View File

@ -6,7 +6,7 @@
},
"version": {
"name": "1.5.0_test"
"name": "test"
},
"files":

View File

@ -5,7 +5,7 @@
) If you get the error "ImportError: No module named zope.interface" then add an empty __init__.py file to the PYTHONDIR/Lib/site-packages/zope directory
2) It is expected that you will have NSIS 3 NSIS from http://nsis.sourceforge.net installed to: C:\Program Files (x86)\NSIS\
2) It is expected that you will have NSIS 3 NSIS from http://nsis.sourceforge.net installed.
'''
@ -31,8 +31,21 @@ if missingStrings is not None and missingStrings is not "":
import warnings
warnings.warn("MISSING/UNUSED STRINGS DETECTED:\n{}".format(missingStrings))
p = "C:\\Program Files (x86)\\NSIS\\makensis.exe" #TODO: how to move that into proper place, huh
NSIS_COMPILE = p if os.path.isfile(p) else "makensis.exe"
def get_nsis_path():
bin_name = "makensis.exe"
from _winreg import HKEY_LOCAL_MACHINE as HKLM
from _winreg import KEY_READ, KEY_WOW64_32KEY, OpenKey, QueryValueEx
try:
nsisreg = OpenKey(HKLM, "Software\\NSIS", 0, KEY_READ | KEY_WOW64_32KEY)
if QueryValueEx(nsisreg, "VersionMajor")[0] >= 3:
return "{}\\{}".format(QueryValueEx(nsisreg, "")[0], bin_name)
else:
raise Exception("You must install NSIS 3 or later.")
except WindowsError:
return bin_name
NSIS_COMPILE = get_nsis_path()
OUT_DIR = "syncplay_v{}".format(syncplay.version)
SETUP_SCRIPT_PATH = "syncplay_setup.nsi"
NSIS_SCRIPT_TEMPLATE = r"""
@ -48,7 +61,7 @@ NSIS_SCRIPT_TEMPLATE = r"""
Unicode true
Name "Syncplay $version"
OutFile "Syncplay $version Setup.exe"
OutFile "Syncplay-$version-Setup.exe"
InstallDir $$PROGRAMFILES\Syncplay
RequestExecutionLevel admin
XPStyle on

View File

@ -1,4 +1,4 @@
version = '1.5.0'
version = '1.5.1'
milestone = 'Yoitsu'
release_number = '50'
release_number = '51'
projectURL = 'http://syncplay.pl/'

View File

@ -9,7 +9,7 @@ UI_TIME_FORMAT = "[%X] "
CONFIG_NAMES = [".syncplay", "syncplay.ini"] #Syncplay searches first to last
DEFAULT_CONFIG_NAME_WINDOWS = "syncplay.ini"
DEFAULT_CONFIG_NAME_LINUX = ".syncplay"
RECENT_CLIENT_THRESHOLD = "1.5.0" #This and higher considered 'recent' clients (no warnings)
RECENT_CLIENT_THRESHOLD = "1.5.1" #This and higher considered 'recent' clients (no warnings)
WARN_OLD_CLIENTS = True #Use MOTD to inform old clients to upgrade
LIST_RELATIVE_CONFIGS = True # Print list of relative configs loaded
SHOW_CONTACT_INFO = True # Displays dev contact details below list in GUI
@ -177,7 +177,7 @@ USERLIST_GUI_FILENAME_COLUMN = 3
MPLAYER_SLAVE_ARGS = ['-slave', '--hr-seek=always', '-nomsgcolor', '-msglevel', 'all=1:global=4:cplayer=4', '-af-add', 'scaletempo']
MPV_ARGS = ['--force-window', '--idle', '--hr-seek=always', '--keep-open']
MPV_SLAVE_ARGS = ['--msg-level=all=error,cplayer=info,term-msg=info', '--input-terminal=no', '--input-file=/dev/stdin']
MPV_SLAVE_ARGS_NEW = ['--term-playing-msg=<SyncplayUpdateFile>\nANS_filename=${filename}\nANS_length=${=length:${=duration:0}}\nANS_path=${path}\n</SyncplayUpdateFile>', '--terminal=yes']
MPV_SLAVE_ARGS_NEW = ['--term-playing-msg=<SyncplayUpdateFile>\nANS_filename=${filename}\nANS_length=${=duration:${=length:0}}\nANS_path=${path}\n</SyncplayUpdateFile>', '--terminal=yes']
MPV_NEW_VERSION = False
VLC_SLAVE_ARGS = ['--extraintf=luaintf', '--lua-intf=syncplay', '--no-quiet', '--no-input-fast-seek',
'--play-and-pause', '--start-time=0']

View File

@ -479,7 +479,7 @@ class MPCHCAPIPlayer(BasePlayer):
@staticmethod
def getIconPath(path):
if MPCHCAPIPlayer.getExpandedPath(path).lower().endswith(u'mpc-hc64.exe'.lower()):
if MPCHCAPIPlayer.getExpandedPath(path).lower().endswith(u'mpc-hc64.exe'.lower()) or MPCHCAPIPlayer.getExpandedPath(path).lower().endswith(u'mpc-hc64_nvo.exe'.lower()):
return constants.MPC64_ICONPATH
else:
return constants.MPC_ICONPATH
@ -493,7 +493,7 @@ class MPCHCAPIPlayer(BasePlayer):
@staticmethod
def getExpandedPath(path):
if os.path.isfile(path):
if path.lower().endswith(u'mpc-hc.exe'.lower()) or path.lower().endswith(u'mpc-hc64.exe'.lower()):
if path.lower().endswith(u'mpc-hc.exe'.lower()) or path.lower().endswith(u'mpc-hc64.exe'.lower()) or path.lower().endswith(u'mpc-hc64_nvo.exe'.lower()) or path.lower().endswith(u'mpc-hc_nvo.exe'.lower()):
return path
if os.path.isfile(path + u"mpc-hc.exe"):
path += u"mpc-hc.exe"
@ -501,9 +501,22 @@ class MPCHCAPIPlayer(BasePlayer):
if os.path.isfile(path + u"\\mpc-hc.exe"):
path += u"\\mpc-hc.exe"
return path
if os.path.isfile(path + u"mpc-hc_nvo.exe"):
path += u"mpc-hc_nvo.exe"
return path
if os.path.isfile(path + u"\\mpc-hc_nvo.exe"):
path += u"\\mpc-hc_nvo.exe"
return path
if os.path.isfile(path + u"mpc-hc64.exe"):
path += u"mpc-hc64.exe"
return path
if os.path.isfile(path + u"\\mpc-hc64.exe"):
path += u"\\mpc-hc64.exe"
return path
if os.path.isfile(path + u"mpc-hc64_nvo.exe"):
path += u"mpc-hc64_nvo.exe"
return path
if os.path.isfile(path + u"\\mpc-hc64_nvo.exe"):
path += u"\\mpc-hc64_nvo.exe"
return path

View File

@ -183,7 +183,10 @@ class MplayerPlayer(BasePlayer):
self._storePauseState(bool(value == 'yes'))
self._pausedAsk.set()
elif name == "length":
try:
self._duration = float(value)
except:
self._duration = 0
self._durationAsk.set()
elif name == "path":
self._filepath = value

View File

@ -124,7 +124,7 @@ class NewMpvPlayer(OldMpvPlayer):
if property_ in floatProperties:
propertyID = u"={}".format(property_)
elif property_ == 'length':
propertyID = u'=length:${=duration:0}'
propertyID = u'=duration:${=length:0}'
else:
propertyID = property_
self._listener.sendLine(u"print_text ""ANS_{}=${{{}}}""".format(property_, propertyID))

View File

@ -1575,6 +1575,7 @@ class MainWindow(QtWidgets.QMainWindow):
data = event.mimeData()
urls = data.urls()
if urls and urls[0].scheme() == 'file':
url = event.mimeData().urls()[0]
if isMacOS() and IsPySide:
dropfilepath = os.path.abspath(NSURL.URLWithString_(str(url.toString())).filePathURL().path())
else: