From 1aa50a8422b0eebe0cf8c025abbc520db1d1f5d8 Mon Sep 17 00:00:00 2001 From: Daniel Ahn Date: Sat, 21 Jul 2018 10:41:00 -0700 Subject: [PATCH] Address comments --- syncplay/client.py | 2 +- syncplay/players/vlc.py | 4 ++-- syncplay/ui/__init__.py | 3 +-- syncplay/ui/gui.py | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/syncplay/client.py b/syncplay/client.py index 9d38f3a..3d14659 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -1440,7 +1440,7 @@ class UiManager(object): def showDebugMessage(self, message): 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()), message.rstrip())) def showChatMessage(self, username, userMessage): messageString = "<{}> {}".format(username, userMessage) diff --git a/syncplay/players/vlc.py b/syncplay/players/vlc.py index 17155ad..c3cef67 100755 --- a/syncplay/players/vlc.py +++ b/syncplay/players/vlc.py @@ -226,11 +226,11 @@ class VlcPlayer(BasePlayer): self._paused = bool(value != 'playing') if (value != "no-input" and not self._filechanged) else self._client.getGlobalPaused() diff = time.time() - self._lastVLCPositionUpdate if self._lastVLCPositionUpdate else 0 if ( - not self._paused and + self._paused == False self._position == self._previousPreviousPosition and self._previousPosition == self._position and self._duration > constants.PLAYLIST_LOAD_NEXT_FILE_MINIMUM_LENGTH and - (self._duration - self._position) < constants.VLC_EOF_DURATION_THRandD and + (self._duration - self._position) < constants.VLC_EOF_DURATION_THRESHOLD and diff > constants.VLC_LATENCY_ERROR_THRESHOLD ): self._client.ui.showDebugMessage("Treating 'playing' response as 'paused' due to VLC EOF bug") diff --git a/syncplay/ui/__init__.py b/syncplay/ui/__init__.py index 750240c..c61a305 100755 --- a/syncplay/ui/__init__.py +++ b/syncplay/ui/__init__.py @@ -5,7 +5,6 @@ if "QT_PREFERRED_BINDING" not in os.environ: ["PySide2", "PySide", "PyQt5", "PyQt4"] ) - try: from syncplay.ui.gui import MainWindow as GraphicalUI except ImportError: @@ -14,7 +13,7 @@ from syncplay.ui.consoleUI import ConsoleUI def getUi(graphical=True): - if graphical: # TODO: Add graphical ui + if graphical: ui = GraphicalUI() else: ui = ConsoleUI() diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py index c674559..3bfecc5 100755 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -8,6 +8,7 @@ import urllib.parse import urllib.request from datetime import datetime from functools import wraps +from platform import python_version from twisted.internet import task @@ -20,7 +21,6 @@ from syncplay.utils import formatTime, sameFilename, sameFilesize, sameFiledurat from syncplay.vendor import Qt from syncplay.vendor.Qt import QtWidgets, QtGui, __binding__, __binding_version__, __qt_version__, IsPySide, IsPySide2 from syncplay.vendor.Qt.QtCore import Qt, QSettings, QSize, QPoint, QUrl, QLine, QDateTime -from platform import python_version if IsPySide2: from PySide2.QtCore import QStandardPaths if isMacOS() and IsPySide: @@ -129,7 +129,6 @@ class AboutDialog(QtWidgets.QDialog): "

" + getMessage("about-dialog-release").format(versionExtString, release_number) + "
Python " + python_version() + " - " + __binding__ + " " + __binding_version__ + " - Qt " + __qt_version__ + "

") - # versionLabel = QtWidgets.QLabel("

Version 1.5.4 release 62
Python 3.4.5 - PySide 1.2.4 - Qt 4.8.7

") licenseLabel = QtWidgets.QLabel( "

Copyright © 2012–2018 Syncplay

" + getMessage("about-dialog-license-text") + "

")