From 63c0573ab237898547dc7a637c391cd969df20a4 Mon Sep 17 00:00:00 2001 From: Daniel Ahn Date: Sat, 21 Jul 2018 03:20:34 -0700 Subject: [PATCH] Reverted most code back to == False. Future code should consider using `is False` if possible. --- syncplay/messages.py | 2 +- syncplay/players/mplayer.py | 4 ++-- syncplay/players/mpv.py | 2 +- syncplay/players/vlc.py | 3 ++- syncplay/ui/ConfigurationGetter.py | 1 + syncplay/ui/GuiConfiguration.py | 4 ++-- syncplay/ui/gui.py | 2 +- 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/syncplay/messages.py b/syncplay/messages.py index ca9701a..4142cbb 100755 --- a/syncplay/messages.py +++ b/syncplay/messages.py @@ -57,7 +57,7 @@ def isValidLanguage(language): def getMessage(type_, locale=None): - if not constants.SHOW_TOOLTIPS: + if constants.SHOW_TOOLTIPS == False: if "-tooltip" in type_: return "" diff --git a/syncplay/players/mplayer.py b/syncplay/players/mplayer.py index b533ae7..c46c74a 100755 --- a/syncplay/players/mplayer.py +++ b/syncplay/players/mplayer.py @@ -395,12 +395,12 @@ class MplayerPlayer(BasePlayer): def setReadyToSend(self, newReadyState): oldState = self.readyToSend self.readyToSend = newReadyState - self.lastNotReadyTime = time.time() if not newReadyState else None + self.lastNotReadyTime = time.time() if newReadyState == False else None if self.readyToSend: self.__playerController._client.ui.showDebugMessage(" Ready to send: True") else: self.__playerController._client.ui.showDebugMessage(" Ready to send: False") - if self.readyToSend and not oldState: + if self.readyToSend and oldState == False: self.processSendQueue() def checkForReadinessOverride(self): diff --git a/syncplay/players/mpv.py b/syncplay/players/mpv.py index d4ec6c5..3ade92c 100755 --- a/syncplay/players/mpv.py +++ b/syncplay/players/mpv.py @@ -150,7 +150,7 @@ class NewMpvPlayer(OldMpvPlayer): pauseValue = "yes" if value else "no" self._setProperty("pause", pauseValue) self._paused = value - if not value: + if value == False: self.lastMPVPositionUpdate = time.time() def _getProperty(self, property_): diff --git a/syncplay/players/vlc.py b/syncplay/players/vlc.py index 59b5f39..17155ad 100755 --- a/syncplay/players/vlc.py +++ b/syncplay/players/vlc.py @@ -238,7 +238,7 @@ class VlcPlayer(BasePlayer): self._pausedAsk.set() elif name == "position": newPosition = float(value.replace(",", ".")) if (value != "no-input" and not self._filechanged) else self._client.getGlobalPosition() - if newPosition == self._previousPosition and newPosition != self._duration and not self._paused: + if newPosition == self._previousPosition and newPosition != self._duration and self._paused is False: self._client.ui.showDebugMessage( "Not considering position {} duplicate as new time because of VLC time precision bug".format( newPosition)) @@ -341,6 +341,7 @@ class VlcPlayer(BasePlayer): call.append(filePath) else: call.append(self.__playerController.getMRL(filePath)) + def _usevlcintf(vlcIntfPath, vlcIntfUserPath): vlcSyncplayInterfacePath = vlcIntfPath + "syncplay.lua" if not os.path.isfile(vlcSyncplayInterfacePath): diff --git a/syncplay/ui/ConfigurationGetter.py b/syncplay/ui/ConfigurationGetter.py index 03897ee..b505976 100755 --- a/syncplay/ui/ConfigurationGetter.py +++ b/syncplay/ui/ConfigurationGetter.py @@ -239,6 +239,7 @@ class ConfigurationGetter(object): return True except: return False + for key in self._boolean: if self._config[key] == "True": self._config[key] = True diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index 38816d3..cabc02b 100755 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -98,7 +98,7 @@ class ConfigDialog(QtWidgets.QDialog): def moreToggled(self): self.setSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) - if not self.moreToggling: + if self.moreToggling is False: self.moreToggling = True if self.showmoreCheckbox.isChecked(): @@ -1314,7 +1314,7 @@ class ConfigDialog(QtWidgets.QDialog): self.addBottomLayout() self.updatePasswordVisibilty() - if not self.getMoreState(): + if self.getMoreState() is False: self.tabListFrame.hide() self.resetButton.hide() self.playerargsTextbox.hide() diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py index ea2261c..c674559 100755 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -80,7 +80,7 @@ class UserlistItemDelegate(QtWidgets.QStyledItemDelegate): midY - 8, tickIconQPixmap.scaled(16, 16, Qt.KeepAspectRatio)) - elif not userReady and not crossIconQPixmap.isNull(): + elif userReady == False and not crossIconQPixmap.isNull(): itemQPainter.drawPixmap( (optionQStyleOptionViewItem.rect.x()-10), midY - 8,