Now exists cleanly on mpc close

This commit is contained in:
Uriziel 2012-09-22 14:47:05 +02:00
parent a3a9503467
commit bcef086b0e
2 changed files with 4 additions and 3 deletions

View File

@ -252,7 +252,7 @@ class SyncplayClientManager(object):
self.running = True self.running = True
reactor.run() reactor.run()
def stop(self): def stop(self, promptForAction = True):
if not self.running: if not self.running:
return return
self.running = False self.running = False
@ -263,7 +263,8 @@ class SyncplayClientManager(object):
if self.player: if self.player:
self.player.drop() self.player.drop()
reactor.callLater(0.1, reactor.stop) reactor.callLater(0.1, reactor.stop)
self.ui.promptFor("Press enter to exit") if(promptForAction):
self.ui.promptFor("Press enter to exit")
def checkIfFileMatchesOthers(self): def checkIfFileMatchesOthers(self):
notMatchingList = self.users.getUsersWithNotMatchingFilenames() notMatchingList = self.users.getUsersWithNotMatchingFilenames()

View File

@ -154,7 +154,7 @@ class MPCHCAPIPlayer(object):
self.askLock.release() self.askLock.release()
def mpc_error(self, err=""): def mpc_error(self, err=""):
self.__syncplayClient.stop() self.__syncplayClient.stop(False)
sys.exit() sys.exit()
def run_mpc(manager, mpc_path, file_path, args): def run_mpc(manager, mpc_path, file_path, args):