Beispiel #1
0
	def bidder_start_from_master(self, master_ip, info):
		if self.bidder and self.bidder.running:
			self.bidder.close()
		bidder_params = setting.default_bidder_params(self.peername)
		bidder_params['bnumber'] = int(info)
		self.bidder  = Bidder(bidder_params, self)
		self.bidder.run()
Beispiel #2
0
	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()