示例#1
0
    def OnListBoxItem(self, evt):
        "The user selected an event in the listbox"
        index = evt.m_itemIndex
        curtime, curdesc, curclass, curdata = self.packets[index]
        self.errorinfo = ""
        self.hex.SetData("")
        self.hex.highlightrange(-1, -1)
        if len(curdata):
            self.hex.SetData(curdata)
            # self.hex.ShowPosition(self.hex.XYToPosition(0,0))
        else:
            self.hex.SetData(curdesc)
            # self.hex.ShowPosition(self.hex.XYToPosition(0,0))

        self.tree.DeleteAllItems()
        if len(curclass):
            b = prototypes.buffer(curdata)
            try:
                klass = common.getfullname(curclass)
            except Exception, e:
                self.errorme("Finding class", e)
                wx.TipWindow(self.tree, self.errorinfo)
                return
            try:
                obj = klass()
            except Exception, e:
                self.errorme("Instantiating object", e)
                wx.TipWindow(self.tree, self.errorinfo)
                return
	def __send(self, methodname, args):

        self.__ensure_channel()

        request=xmlrpclib.dumps(args, methodname, encoding=None) 

        self.__channel.sendall( ("%08d" % (len(request),))+request)

        resplen=self.__recvall(self.__channel, 8)

        resplen=int(resplen)

        response=self.__recvall(self.__channel, resplen)

        p, u = xmlrpclib.getparser()

        p.feed(response)

        p.close()

        try:

            response=u.close()

        except xmlrpclib.Fault,e:

            if e.faultCode!=17:

                raise e

            klass,str=e.faultString.split(':', 1)

            raise common.getfullname(klass)(str)
示例#3
0
    def OnListBoxItem(self,evt):
        "The user selected an event in the listbox"
        index=evt.m_itemIndex
        curtime, curdesc, curclass, curdata=self.packets[index]
        self.errorinfo=""
        self.hex.SetData("")
        self.hex.highlightrange(-1,-1)
        if len(curdata):
            self.hex.SetData(curdata)
            # self.hex.ShowPosition(self.hex.XYToPosition(0,0))
        else:
            self.hex.SetData(curdesc)
            # self.hex.ShowPosition(self.hex.XYToPosition(0,0))

        self.tree.DeleteAllItems()
        if len(curclass):
            b=prototypes.buffer(curdata)
            try:
                klass=common.getfullname(curclass)
            except Exception,e:
                self.errorme("Finding class",e)
                wx.TipWindow(self.tree,self.errorinfo)
                return
            try:
                obj=klass()
            except Exception,e:
                self.errorme("Instantiating object",e)
                wx.TipWindow(self.tree,self.errorinfo)
                return
def _getidvalue(defaultmodule, name):
    try:
        return eval(name)
    except NameError:
        pass
    try:
        return getattr(defaultmodule, name)
    except AttributeError:
        pass
    return common.getfullname(name)
示例#5
0
def _getidvalue(defaultmodule, name):
    # try name by itself
    try:
        return eval(name)
    except NameError:
        pass
    # ok, try to get it from the module
    try:
        return getattr(defaultmodule, name)
    except AttributeError:
        pass
    return common.getfullname(name)
示例#6
0
def _getidvalue(defaultmodule, name):
    # try name by itself
    try:
        return eval(name)
    except NameError:
        pass
    # ok, try to get it from the module
    try:
        return getattr(defaultmodule, name)
    except AttributeError:
        pass
    return common.getfullname(name)
示例#7
0
 def __send(self, methodname, args):
     self.__ensure_channel()
     request=xmlrpclib.dumps(args, methodname, encoding=None) #  allow_none=False (allow_none is py2.3+)
     self.__channel.sendall( ("%08d" % (len(request),))+request)
     resplen=self.__recvall(self.__channel, 8)
     resplen=int(resplen)
     response=self.__recvall(self.__channel, resplen)
     p, u = xmlrpclib.getparser()
     p.feed(response)
     p.close()
     # if the response was a Fault, then it is raised by u.close()
     try:
         response=u.close()
     except xmlrpclib.Fault,e:
         if e.faultCode!=17:
             raise e
         klass,str=e.faultString.split(':', 1)
         raise common.getfullname(klass)(str)