mirror of https://github.com/Syncplay/syncplay
Appropriate message when starting mplayer with no file
This commit is contained in:
parent
4b8469ddaa
commit
7392c48158
|
@ -12,8 +12,13 @@ class MplayerPlayer(BasePlayer):
|
||||||
self._duration = None
|
self._duration = None
|
||||||
self._filename = None
|
self._filename = None
|
||||||
self._filepath = None
|
self._filepath = None
|
||||||
|
try:
|
||||||
self._listener = self.__Listener(self, playerPath, filePath)
|
self._listener = self.__Listener(self, playerPath, filePath)
|
||||||
|
except ValueError:
|
||||||
|
self._client.ui.showMessage("Syncplay using mplayer requires you to provide file when starting")
|
||||||
|
self._client.ui.showMessage("Usage example: syncplay [options] [url|path/]filename")
|
||||||
|
self._client.stop(True)
|
||||||
|
return
|
||||||
self._listener.setDaemon(True)
|
self._listener.setDaemon(True)
|
||||||
self._listener.start()
|
self._listener.start()
|
||||||
|
|
||||||
|
@ -135,6 +140,8 @@ class MplayerPlayer(BasePlayer):
|
||||||
class __Listener(threading.Thread):
|
class __Listener(threading.Thread):
|
||||||
def __init__(self, playerController, playerPath, filePath):
|
def __init__(self, playerController, playerPath, filePath):
|
||||||
self.__playerController = playerController
|
self.__playerController = playerController
|
||||||
|
if(not filePath):
|
||||||
|
raise ValueError
|
||||||
self.__process = subprocess.Popen([playerPath, filePath, '-slave', '-msglevel', 'all=1:global=4'], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
|
self.__process = subprocess.Popen([playerPath, filePath, '-slave', '-msglevel', 'all=1:global=4'], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
threading.Thread.__init__(self, name="MPlayer Listener")
|
threading.Thread.__init__(self, name="MPlayer Listener")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue