Ejemplo n.º 1
0
	def unmarshall(self,d,idx_=0):
		idx = idx_
		try:
			r,idx = self.error.unmarshall(d,idx)
			if not r: return False,idx
			self.value,idx = tce.unserial_string(d,idx)
			self.delta,idx = tce.unserial_string(d,idx)
		except:
			traceback.print_exc()
			return False,idx
		return True,idx
Ejemplo n.º 2
0
	def unmarshall(self,d,idx_=0):
		idx = idx_
		try:
			self.realm,idx = tce.unserial_string(d,idx)
			self.seq,idx = tce.unserial_string(d,idx)
			self.sender,idx = tce.unserial_string(d,idx)
			self.stime,idx = tce.unserial_string(d,idx)
		except:
			traceback.print_exc()
			return False,idx
		return True,idx
Ejemplo n.º 3
0
	def unmarshall(self,d,idx_=0):
		idx = idx_
		try:
			r,idx = self.error.unmarshall(d,idx)
			if not r: return False,idx
			self.value,idx = tce.unserial_string(d,idx)
			self.delta,idx = tce.unserial_string(d,idx)
		except:
			traceback.print_exc()
			return False,idx
		return True,idx
Ejemplo n.º 4
0
	def unmarshall(self,d,idx_=0):
		idx = idx_
		try:
			self.type_,idx = tce.unserial_string(d,idx)
			self.title,idx = tce.unserial_string(d,idx)
			self.content,idx = tce.unserial_string(d,idx)
			self.p1,idx = tce.unserial_string(d,idx)
			self.p2,idx = tce.unserial_string(d,idx)
		except:
			traceback.print_exc()
			return False,idx
		return True,idx
Ejemplo n.º 5
0
	def unmarshall(self,d,idx_=0):
		idx = idx_
		try:
			self.seq,idx = tce.unserial_string(d,idx)
			self.sender_id,idx = tce.unserial_string(d,idx)
			self.send_time,idx = tce.unserial_string(d,idx)
			self.title,idx = tce.unserial_string(d,idx)
			self.content,idx = tce.unserial_string(d,idx)
		except:
			traceback.print_exc()
			return False,idx
		return True,idx
Ejemplo n.º 6
0
	def unmarshall(self,d,idx_=0):
		idx = idx_
		try:
			self.user_id,idx = tce.unserial_string(d,idx)
			self.user_name,idx = tce.unserial_string(d,idx)
			self.login_time,idx = tce.unserial_long(d,idx)
			self.expire_time,idx = tce.unserial_long(d,idx)
			self.platform_type,idx = tce.unserial_int(d,idx)
			self.device_id,idx = tce.unserial_string(d,idx)
		except:
			traceback.print_exc()
			return False,idx
		return True,idx
Ejemplo n.º 7
0
	def unmarshall(self,d,idx_=0):
		idx = idx_
		try:
			self.user_id,idx = tce.unserial_string(d,idx)
			self.user_name,idx = tce.unserial_string(d,idx)
			self.login_time,idx = tce.unserial_long(d,idx)
			self.expire_time,idx = tce.unserial_long(d,idx)
			self.platform_type,idx = tce.unserial_int(d,idx)
			self.device_id,idx = tce.unserial_string(d,idx)
		except:
			traceback.print_exc()
			return False,idx
		return True,idx
Ejemplo n.º 8
0
	def unmarshall(self,d,idx_=0):
		idx = idx_
		try:
			r,idx = self.meta.unmarshall(d,idx)
			if not r: return False,idx
			self.title,idx = tce.unserial_string(d,idx)
			self.content,idx = tce.unserial_string(d,idx)
			self.props = {}
			container = Properties_t(self.props)
			r,idx = container.unmarshall(d,idx)
			if not r: return False,idx
		except:
			traceback.print_exc()
			return False,idx
		return True,idx
Ejemplo n.º 9
0
	def unmarshall(self,d,idx_=0):
		idx = idx_
		try:
			_size,= struct.unpack('!I',d[idx:idx+4])
			p = 0
			idx += 4
			while p < _size:
				x,idx = tce.unserial_string(d,idx)
				y,idx = tce.unserial_string(d,idx)
				self.ds[x] = y
				p+=1
		except:
			traceback.print_exc()
			return False,idx
		return True,idx
Ejemplo n.º 10
0
Archivo: test.py Proyecto: adoggie/TCE
	def datetime(self,timeout=None,extra={}):
		# function index: 0
		
		m_1 = tce.RpcMessageCall(self)
		m_1.ifidx = 11
		m_1.opidx = 10
		m_1.extra.setStrDict(extra)
		m_1.prx = self
		m_1.conn = m_1.prx.conn
		m_1.call_id = tce.RpcCommunicator.instance().currentServer().getId()
		r_4 = self.conn.sendMessage(m_1)
		if not r_4:
			raise tce.RpcException(tce.RpcConsts.RPCERROR_SENDFAILED)
		if not timeout: timeout = tce.RpcCommunicator.instance().getRpcCallTimeout()
		m_5 = None
		try:
			m_5 = m_1.mtx.get(timeout=timeout)
		except:
			raise tce.RpcException(tce.RpcConsts.RPCERROR_TIMEOUT)
		if m_5.errcode != tce.RpcConsts.RPCERROR_SUCC:
			raise tce.RpcException(m_5.errcode)
		m_1 = m_5
		idx_6 = 0
		d_9 = m_1.paramstream
		p_7 = None
		r_8 = False
		try:
			p_7 = None
			p_7,idx_6 = tce.unserial_string(d_9,idx_6)
		except:
			traceback.print_exc()
			raise tce.RpcException(tce.RpcConsts.RPCERROR_UNSERIALIZE_FAILED)
		return p_7
Ejemplo n.º 11
0
    def datetime(self, timeout=None, extra={}):
        # function index: 0

        m_1 = tce.RpcMessageCall(self)
        m_1.ifidx = 11
        m_1.opidx = 10
        m_1.extra.setStrDict(extra)
        m_1.prx = self
        m_1.conn = m_1.prx.conn
        m_1.call_id = tce.RpcCommunicator.instance().currentServer().getId()
        r_4 = self.conn.sendMessage(m_1)
        if not r_4:
            raise tce.RpcException(tce.RpcConsts.RPCERROR_SENDFAILED)
        if not timeout:
            timeout = tce.RpcCommunicator.instance().getRpcCallTimeout()
        m_5 = None
        try:
            m_5 = m_1.mtx.get(timeout=timeout)
        except:
            raise tce.RpcException(tce.RpcConsts.RPCERROR_TIMEOUT)
        if m_5.errcode != tce.RpcConsts.RPCERROR_SUCC:
            raise tce.RpcException(m_5.errcode)
        m_1 = m_5
        idx_6 = 0
        d_9 = m_1.paramstream
        p_7 = None
        r_8 = False
        try:
            p_7 = None
            p_7, idx_6 = tce.unserial_string(d_9, idx_6)
        except:
            traceback.print_exc()
            raise tce.RpcException(tce.RpcConsts.RPCERROR_UNSERIALIZE_FAILED)
        return p_7
Ejemplo n.º 12
0
	def unmarshall(self,d,idx_=0):
		idx = idx_
		try:
			self.act_type,idx = tce.unserial_int(d,idx)
			self.url,idx = tce.unserial_string(d,idx)
			self.conform_on_url,idx = tce.unserial_int(d,idx)
			self.activity,idx = tce.unserial_string(d,idx)
			self.intent,idx = tce.unserial_string(d,idx)
			self.intent_flag,idx = tce.unserial_int(d,idx)
			self.pending_flag,idx = tce.unserial_int(d,idx)
			self.package_name,idx = tce.unserial_string(d,idx)
			self.package_download_url,idx = tce.unserial_string(d,idx)
			self.confirm_on_package,idx = tce.unserial_int(d,idx)
		except:
			traceback.print_exc()
			return False,idx
		return True,idx
Ejemplo n.º 13
0
	def unmarshall(self,d,idx_=0):
		idx = idx_
		try:
			self.succ,idx = tce.unserial_bool(d,idx)
			self.code,idx = tce.unserial_int(d,idx)
			self.msg,idx = tce.unserial_string(d,idx)
		except:
			traceback.print_exc()
			return False,idx
		return True,idx
Ejemplo n.º 14
0
	def unmarshall(self,d,idx_=0):
		idx = idx_
		try:
			self.succ,idx = tce.unserial_bool(d,idx)
			self.code,idx = tce.unserial_int(d,idx)
			self.msg,idx = tce.unserial_string(d,idx)
		except:
			traceback.print_exc()
			return False,idx
		return True,idx
Ejemplo n.º 15
0
	def onError(self,ctx):
		tce.log_debug("callin (onError)")
		d = ctx.msg.paramstream 
		idx = 0
		_p_errcode,idx = tce.unserial_string(d,idx)
		_p_errmsg,idx = tce.unserial_string(d,idx)
		cr = None
		self.inst.onError(_p_errcode,_p_errmsg,ctx)
		if ctx.msg.calltype & tce.RpcMessage.ONEWAY: return True
		d = '' 
		m = tce.RpcMessageReturn(self.inst)
		m.sequence = ctx.msg.sequence
		m.callmsg = ctx.msg
		m.ifidx = ctx.msg.ifidx
		m.call_id = ctx.msg.call_id
		m.conn = ctx.msg.conn
		m.extra = ctx.msg.extra
		if d: m.paramstream += d
		ctx.conn.sendMessage(m)
		return True
Ejemplo n.º 16
0
	def onError(self,ctx):
		tce.log_debug("callin (onError)")
		d = ctx.msg.paramstream 
		idx = 0
		_p_errcode,idx = tce.unserial_string(d,idx)
		_p_errmsg,idx = tce.unserial_string(d,idx)
		cr = None
		self.inst.onError(_p_errcode,_p_errmsg,ctx)
		if ctx.msg.calltype & tce.RpcMessage.ONEWAY: return True
		d = '' 
		m = tce.RpcMessageReturn(self.inst)
		m.sequence = ctx.msg.sequence
		m.callmsg = ctx.msg
		m.ifidx = ctx.msg.ifidx
		m.call_id = ctx.msg.call_id
		m.conn = ctx.msg.conn
		m.extra = ctx.msg.extra
		if d: m.paramstream += d
		ctx.conn.sendMessage(m)
		return True
Ejemplo n.º 17
0
	def onUserOffline(self,ctx):
		tce.log_debug("callin (onUserOffline)")
		d = ctx.msg.paramstream 
		idx = 0
		_p_userid,idx = tce.unserial_string(d,idx)
		_p_gws_id,idx = tce.unserial_string(d,idx)
		_p_device,idx = tce.unserial_int(d,idx)
		cr = None
		self.inst.onUserOffline(_p_userid,_p_gws_id,_p_device,ctx)
		if ctx.msg.calltype & tce.RpcMessage.ONEWAY: return True
		d = '' 
		m = tce.RpcMessageReturn(self.inst)
		m.sequence = ctx.msg.sequence
		m.callmsg = ctx.msg
		m.ifidx = ctx.msg.ifidx
		m.call_id = ctx.msg.call_id
		m.conn = ctx.msg.conn
		m.extra = ctx.msg.extra
		if d: m.paramstream += d
		ctx.conn.sendMessage(m)
		return True
Ejemplo n.º 18
0
	def onUserOffline(self,ctx):
		tce.log_debug("callin (onUserOffline)")
		d = ctx.msg.paramstream 
		idx = 0
		_p_user_id,idx = tce.unserial_string(d,idx)
		_p_gws_id,idx = tce.unserial_string(d,idx)
		_p_device,idx = tce.unserial_int(d,idx)
		cr = None
		self.inst.onUserOffline(_p_user_id,_p_gws_id,_p_device,ctx)
		if ctx.msg.calltype & tce.RpcMessage.ONEWAY: return True
		d = '' 
		m = tce.RpcMessageReturn(self.inst)
		m.sequence = ctx.msg.sequence
		m.callmsg = ctx.msg
		m.ifidx = ctx.msg.ifidx
		m.call_id = ctx.msg.call_id
		m.conn = ctx.msg.conn
		m.extra = ctx.msg.extra
		if d: m.paramstream += d
		ctx.conn.sendMessage(m)
		return True
Ejemplo n.º 19
0
	def unmarshall(self,d,idx_=0):
		idx = idx_
		try:
			size_,= struct.unpack('!I',d[idx:idx+4])
			idx += 4
			p = 0
			while p < size_:
				v,idx = tce.unserial_string(d,idx)
				self.ds.append(v)
				p+=1
		except:
			traceback.print_exc()
			return False,idx
		return True,idx
Ejemplo n.º 20
0
	def unmarshall(self,d,idx_=0):
		idx = idx_
		try:
			size_,= struct.unpack('!I',d[idx:idx+4])
			idx += 4
			p = 0
			while p < size_:
				v,idx = tce.unserial_string(d,idx)
				self.ds.append(v)
				p+=1
		except:
			traceback.print_exc()
			return False,idx
		return True,idx
Ejemplo n.º 21
0
Archivo: test.py Proyecto: adoggie/TCE
	def heartbeat(self,ctx):
		tce.log_debug("callin (heartbeat)")
		d = ctx.msg.paramstream 
		idx = 0
		_p_hello,idx = tce.unserial_string(d,idx)
		cr = None
		self.inst.heartbeat(_p_hello,ctx)
		if ctx.msg.calltype & tce.RpcMessage.ONEWAY: return True
		d = '' 
		m = tce.RpcMessageReturn(self.inst)
		m.sequence = ctx.msg.sequence
		m.callmsg = ctx.msg
		m.ifidx = ctx.msg.ifidx
		m.call_id = ctx.msg.call_id
		m.conn = ctx.msg.conn
		m.extra = ctx.msg.extra
		if d: m.paramstream += d
		ctx.conn.sendMessage(m)
		return True
Ejemplo n.º 22
0
 def heartbeat(self, ctx):
     tce.log_debug("callin (heartbeat)")
     d = ctx.msg.paramstream
     idx = 0
     _p_hello, idx = tce.unserial_string(d, idx)
     cr = None
     self.inst.heartbeat(_p_hello, ctx)
     if ctx.msg.calltype & tce.RpcMessage.ONEWAY: return True
     d = ''
     m = tce.RpcMessageReturn(self.inst)
     m.sequence = ctx.msg.sequence
     m.callmsg = ctx.msg
     m.ifidx = ctx.msg.ifidx
     m.call_id = ctx.msg.call_id
     m.conn = ctx.msg.conn
     m.extra = ctx.msg.extra
     if d: m.paramstream += d
     ctx.conn.sendMessage(m)
     return True
Ejemplo n.º 23
0
Archivo: test.py Proyecto: adoggie/TCE
	def echo(self,ctx):
		tce.log_debug("callin (echo)")
		d = ctx.msg.paramstream 
		idx = 0
		_p_text,idx = tce.unserial_string(d,idx)
		cr = None
		cr = self.inst.echo(_p_text,ctx)
		if not cr : return True
		d = '' 
		m = tce.RpcMessageReturn(self.inst)
		m.sequence = ctx.msg.sequence
		m.callmsg = ctx.msg
		m.ifidx = ctx.msg.ifidx
		m.call_id = ctx.msg.call_id
		m.conn = ctx.msg.conn
		m.extra = ctx.msg.extra
		d = tce.serial_string(cr,d)
		if d: m.paramstream += d
		ctx.conn.sendMessage(m)
		return True
Ejemplo n.º 24
0
 def echo(self, ctx):
     tce.log_debug("callin (echo)")
     d = ctx.msg.paramstream
     idx = 0
     _p_text, idx = tce.unserial_string(d, idx)
     cr = None
     cr = self.inst.echo(_p_text, ctx)
     if not cr: return True
     d = ''
     m = tce.RpcMessageReturn(self.inst)
     m.sequence = ctx.msg.sequence
     m.callmsg = ctx.msg
     m.ifidx = ctx.msg.ifidx
     m.call_id = ctx.msg.call_id
     m.conn = ctx.msg.conn
     m.extra = ctx.msg.extra
     d = tce.serial_string(cr, d)
     if d: m.paramstream += d
     ctx.conn.sendMessage(m)
     return True
Ejemplo n.º 25
0
Archivo: test.py Proyecto: adoggie/TCE
			raise tce.RpcException(tce.RpcConsts.RPCERROR_SENDFAILED)
	
	@staticmethod
	def datetime_asyncparser(m,m2):
		# function index: idx_6 , m2 - callreturn msg.
		
		stream_1 = m2.paramstream
		user_2 = m.async
		prx_3 = m.prx
		if m2.errcode != tce.RpcConsts.RPCERROR_SUCC: return 
		try:
			idx_4 = 0
			d_5 = stream_1
			r_6 = True
			p_7 = None
			p_7,idx_4 = tce.unserial_string(d_5,idx_4)
			if r_6:
				user_2(p_7,prx_3,m.cookie)
		except:
			traceback.print_exc()
		
	

class ITerminalGatewayServer(tce.RpcServantBase):
	# -- INTERFACE -- 
	def __init__(self):
		tce.RpcServantBase.__init__(self)
		if not hasattr(self,'delegatecls'):
			self.delegatecls = {}
		self.delegatecls[1] = ITerminalGatewayServer_delegate
	
Ejemplo n.º 26
0
	def unmarshall(self,d,idx_=0):
		idx = idx_
		try:
			self.seq,idx = tce.unserial_string(d,idx)
			self.sender_id,idx = tce.unserial_string(d,idx)
			self.sent_time,idx = tce.unserial_string(d,idx)
			self.title,idx = tce.unserial_string(d,idx)
			self.content,idx = tce.unserial_string(d,idx)
			self.expire_time,idx = tce.unserial_string(d,idx)
			self.send_time,idx = tce.unserial_string(d,idx)
			self.accept_time,idx = tce.unserial_string(d,idx)
			self.type_,idx = tce.unserial_int(d,idx)
			r,idx = self.style.unmarshall(d,idx)
			if not r: return False,idx
			r,idx = self.action.unmarshall(d,idx)
			if not r: return False,idx
			self.custom,idx = tce.unserial_string(d,idx)
			self.loop_times,idx = tce.unserial_int(d,idx)
			self.loop_inerval,idx = tce.unserial_int(d,idx)
			self.alert,idx = tce.unserial_string(d,idx)
			self.badge,idx = tce.unserial_int(d,idx)
			self.sound,idx = tce.unserial_string(d,idx)
			self.category,idx = tce.unserial_string(d,idx)
			self.raw,idx = tce.unserial_string(d,idx)
		except:
			traceback.print_exc()
			return False,idx
		return True,idx
Ejemplo n.º 27
0
            raise tce.RpcException(tce.RpcConsts.RPCERROR_SENDFAILED)

    @staticmethod
    def datetime_asyncparser(m, m2):
        # function index: idx_6 , m2 - callreturn msg.

        stream_1 = m2.paramstream
        user_2 = m. async
        prx_3 = m.prx
        if m2.errcode != tce.RpcConsts.RPCERROR_SUCC: return
        try:
            idx_4 = 0
            d_5 = stream_1
            r_6 = True
            p_7 = None
            p_7, idx_4 = tce.unserial_string(d_5, idx_4)
            if r_6:
                user_2(p_7, prx_3, m.cookie)
        except:
            traceback.print_exc()


class ITerminalGatewayServer(tce.RpcServantBase):
    # -- INTERFACE --
    def __init__(self):
        tce.RpcServantBase.__init__(self)
        if not hasattr(self, 'delegatecls'):
            self.delegatecls = {}
        self.delegatecls[1] = ITerminalGatewayServer_delegate

    def ping(self, ctx):