Ejemplo n.º 1
0
    def _get_channel_community(self, cid):
        assert isinstance(cid, str)
        assert len(cid) == 20

        try:
            return self._dispersy.get_community(cid, True)
        except KeyError:
            if self.auto_join_channel:
                if __debug__: dprint("join channel community ", cid.encode("HEX"))
                return ChannelCommunity.join_community(DummyMember(cid), self._my_member, self.integrate_with_tribler)
            else:
                if __debug__: dprint("join preview community ", cid.encode("HEX"))
                return PreviewChannelCommunity.join_community(DummyMember(cid), self._my_member, self.integrate_with_tribler)
Ejemplo n.º 2
0
 def _get_channel_community(self, cid):
     assert isinstance(cid, str)
     assert len(cid) == 20
     
     try:
         return self._dispersy.get_community(cid, True)
     except KeyError:
         if self.auto_join_channel:
             if __debug__: dprint("join channel community ", cid.encode("HEX"))
             return ChannelCommunity.join_community(DummyMember(cid), self._my_member, self.integrate_with_tribler)
         else:
             if __debug__: dprint("join preview community ", cid.encode("HEX"))
             return PreviewChannelCommunity.join_community(DummyMember(cid), self._my_member, self.integrate_with_tribler)
Ejemplo n.º 3
0
    def _get_channel_community(self, cid):
        assert isinstance(cid, str)
        assert len(cid) == 20

        try:
            return self._dispersy.get_community(cid, True)
        except KeyError:
            if self.auto_join_channel:
                logger.debug("join channel community %s", cid.encode("HEX"))
                return ChannelCommunity.join_community(self._dispersy, self._dispersy.get_temporary_member_from_id(cid), self._my_member, self.integrate_with_tribler)
            else:
                logger.debug("join preview community %s", cid.encode("HEX"))
                return PreviewChannelCommunity.join_community(self._dispersy, self._dispersy.get_temporary_member_from_id(cid), self._my_member, self.integrate_with_tribler)