示例#1
0
 def getStateToCopyFor(self, participant):
     assert participant in self.members, "illegal copy of group"
     return {
         'name': self.name,
         'members': self.members,
         'remote': pb.ViewPoint(participant, self)
     }
示例#2
0
 def getStateToCopyFor(self, issuer):
     x = copy.copy(self.__dict__)
     del x['transport']
     # XXX refactor this attribute out; it's from protocol
     del x['server']
     del x['site']
     x['remote'] = pb.ViewPoint(issuer, self)
     return x
示例#3
0
    def getStateToCopyFor(self, perspective):
        all = ["properties", "attributeGroups", "accessors"]
        all.extend(self.properties)
        all.extend(self.attributeGroups)

        state = {}
        for key in all:
            state[key] = getattr(self, key)

        state['view'] = pb.ViewPoint(perspective, self)
        state['explorerClass'] = self.__class__.__name__
        return state
示例#4
0
    def getStateToCopyFor(self, issuer):
        x = self.__dict__.copy()
        del x['transport']
        # XXX refactor this attribute out; it's from protocol
        # del x['server']
        del x['channel']
        del x['content']
        del x['site']
        self.content.seek(0, 0)
        x['content_data'] = self.content.read()
        x['remote'] = pb.ViewPoint(issuer, self)

        # Address objects aren't jellyable
        x['host'] = _addressToTuple(x['host'])
        x['client'] = _addressToTuple(x['client'])

        return x
示例#5
0
    def getStateToCopyFor(self, issuer):
        # This is for distrib compatibility
        x = {}

        x['prepath'] = self.prepath
        x['postpath'] = self.postpath
        x['method'] = self.method
        x['uri'] = self.uri

        x['clientproto'] = self.clientproto
        self.content.seek(0, 0)
        x['content_data'] = self.content.read()
        x['remote'] = pb.ViewPoint(issuer, self)

        x['host'] = _addressToTuple(
            self.request.chanRequest.channel.transport.getHost())
        x['client'] = _addressToTuple(
            self.request.chanRequest.channel.transport.getPeer())

        return x