Пример #1
0
	def upload(self, _):
		
		#swap with empty value, to assure newly added commands will not interfere with sending ones
		tmp = {}
		tmp, self.requeusts_queue = self.requeusts_queue, tmp
		for user_id, actions in tmp.items():
			log.debug('request to send actions from user %d'%(user_id,))
			asyncLoader = AsyncLoader(self, self.conf)
			req = request.RequestMaker()
			for unit_id, action_id in actions:
				log.debug('store action %d %d'%(unit_id,action_id))
				req.store_action( unit_id, action_id)
			
			uname = self.db.get_login(user_id)
			log.debug('send actions %s for user %s'%(req, uname))
			asyncLoader.recvActionsReply( (uname,self.conf.users[uname]), req, self.conf.pathOut)
			asyncLoader.start()