def loop(self, streaming = False): self.run() self.introduce() #auctioneer bidder self.bidder = None self.auctioneer = None if streaming: if sys.platform.startswith('linux'): import qtvlc_player.QtvlcPlayer as Player elif sys.platform.startswith('darwin'): import vlc_player.VlcPlayer as Player player = Player() player.open_api_run() else: try: while True: command = raw_input().lower() if not command or command == 'exit': break except KeyboardInterrupt: pass if self.bidder and self.bidder.running: self.bidder.close() if self.auctioneer and self.auctioneer.running: self.auctioneer.close() self.close()
def loop(self, streaming = False): self.run() self.introduce() self.bidder = Bidder(setting.default_bidder_params(self.peername), self) self.auctioneer = Auctioneer(setting.default_auctioneer_params(self.peername), self) self.bidder.run() self.auctioneer.run() if streaming: if sys.platform.startswith('linux'): from vlc_player import VlcPlayer as Player elif sys.platform.startswith('darwin'): from qtvlc_player import QtvlcPlayer as Player player = Player() player.open_api_run() else: try: while True: command = raw_input().lower() if not command or command == 'exit': break except KeyboardInterrupt: pass self.bidder.close() self.auctioneer.close() self.close()