Ejemplo n.º 1
0
	def send_all(self,exclude,params):
		l=db.GqlQuery("SELECT * FROM BridgeHubInfo WHERE flag = :1 AND disabled = :2",0,False);
		ret=[]
		for e in l:
			if not m2ggg_core.check_hash(exclude,e.name):
				params["id"]=e.name;
				data=convert_params_to_xml(make_params_sec(params,e.key1,e.key2));
				rpc = urlfetch.create_rpc()
				self.rpcs.append(rpc);
				urlfetch.make_fetch_call(rpc, url=e.url,
                        payload=data.encode("UTF-8"),
                        method=urlfetch.POST,
                        headers={'Content-Type': 'text/xml'})
		return
Ejemplo n.º 2
0
def bridge_send_to_all(exclude,params):
	l=db.GqlQuery("SELECT * FROM BridgeHubInfo WHERE flag = :1 AND disabled = :2",0,False);
	ret=[]
	for e in l:
		if not m2ggg_core.check_hash(exclude,e.name):
			p=None
			try:
				params["id"]=e.name;
				data=convert_params_to_xml(make_params_sec(params,e.key1,e.key2));
				p=urlfetch.fetch(url=e.url,
                	        payload=data.encode("UTF-8"),
        	                method=urlfetch.POST,
	                        headers={'Content-Type': 'text/xml'})
			except:
				pass
			ret.append(p);
	return ret