Пример #1
0
            def do_dispersy():
                from Tribler.Main.vwxGUI.SearchGridManager import ChannelManager

                self._logger.debug("Channel: fetching getChannelStateByCID from DB %s", self)

                searchManager = ChannelManager.getInstance()
                result = searchManager.getChannelStateByCID(self.dispersy_cid)
                return result
Пример #2
0
    def torrent(self):
        if self.channeltorrent_id:
            from Tribler.Main.vwxGUI.SearchGridManager import ChannelManager

            self._logger.debug("Marking: fetching getTorrentFromChannelTorrentId from DB %s", self)

            searchManager = ChannelManager.getInstance()
            return searchManager.getTorrentFromChannelTorrentId(None, self.channeltorrent_id, False)
Пример #3
0
 def torrent(self):
     if self._torrent is not None:
         return self._torrent
     
     if self.channeltorrent_id:
         from Tribler.Main.vwxGUI.SearchGridManager import ChannelManager
         
         searchManager = ChannelManager.getInstance()
         return searchManager.getTorrentFromChannelTorrentId(self.channel, self.channeltorrent_id)
Пример #4
0
            def do_dispersy():
                from Tribler.Main.vwxGUI.SearchGridManager import ChannelManager

                self._logger.debug(
                    "Channel: fetching getChannelStateByCID from DB %s", self)

                searchManager = ChannelManager.getInstance()
                result = searchManager.getChannelStateByCID(self.dispersy_cid)
                return result
Пример #5
0
    def torrent(self):
        if self.channeltorrent_id:
            from Tribler.Main.vwxGUI.SearchGridManager import ChannelManager

            if DEBUGDB:
                print >> sys.stderr, "Marking: fetching getTorrentFromChannelTorrentId from DB", self

            searchManager = ChannelManager.getInstance()
            return searchManager.getTorrentFromChannelTorrentId(None, self.channeltorrent_id, False)
Пример #6
0
    def torrent(self):
        if self.channeltorrent_id:
            from Tribler.Main.vwxGUI.SearchGridManager import ChannelManager

            if DEBUGDB:
                print >> sys.stderr, "Marking: fetching getTorrentFromChannelTorrentId from DB", self

            searchManager = ChannelManager.getInstance()
            return searchManager.getTorrentFromChannelTorrentId(
                None, self.channeltorrent_id)
Пример #7
0
 def getState(self):
     if self.isDispersy():
         from Tribler.Main.vwxGUI.SearchGridManager import ChannelManager
         
         searchManager = ChannelManager.getInstance()
         result = searchManager.getChannelStateByCID(self.dispersy_cid)
         if result:
             return result 
     
     return ChannelCommunity.CHANNEL_CLOSED, self.isMyChannel()
Пример #8
0
 def register(self):
     self.torrentsearch_manager = TorrentManager.getInstance(self)
     self.channelsearch_manager = ChannelManager.getInstance()
     self.library_manager = LibraryManager.getInstance(self)
     self.torrentstate_manager = TorrentStateManager.getInstance(self)
     
     self.torrentsearch_manager.connect(self.utility.session, self.library_manager, self.channelsearch_manager)
     self.channelsearch_manager.connect(self.utility.session, self.torrentsearch_manager)
     self.library_manager.connect(self.utility.session, self.torrentsearch_manager)
     self.torrentstate_manager.connect(self.torrentsearch_manager, self.library_manager, self.channelsearch_manager)
Пример #9
0
 def loadPopularTorrentNames(self, num_torrents, force_refresh=False):
     if not self.popular_torrents or force_refresh:
         from Tribler.Main.vwxGUI.GuiUtility import GUIUtility
         from Tribler.Main.vwxGUI.SearchGridManager import ChannelManager
         results = ChannelManager.getInstance(
         ).getMostPopularTorrentsFromChannel(
             self.id, ['Torrent.Name'],
             family_filter=GUIUtility.getInstance().getFamilyFilter(),
             limit=num_torrents)
         self.popular_torrents = [result[0] for result in results]
Пример #10
0
    def torrent(self):
        if self.channeltorrent_id:
            from Tribler.Main.vwxGUI.SearchGridManager import ChannelManager

            self._logger.debug(
                "Marking: fetching getTorrentFromChannelTorrentId from DB %s",
                self)

            searchManager = ChannelManager.getInstance()
            return searchManager.getTorrentFromChannelTorrentId(
                None, self.channeltorrent_id, False)
Пример #11
0
 def torrent(self):
     if self._torrent is not None:
         return self._torrent
     
     if self.channeltorrent_id:
         from Tribler.Main.vwxGUI.SearchGridManager import ChannelManager
         
         if DEBUGDB:
             print >> sys.stderr, "Comment: fetching getTorrentFromChannelTorrentId from DB", self
         
         searchManager = ChannelManager.getInstance()
         return searchManager.getTorrentFromChannelTorrentId(self.channel, self.channeltorrent_id)
Пример #12
0
    def getState(self):
        if self.isDispersy():
            from Tribler.Main.vwxGUI.SearchGridManager import ChannelManager

            if DEBUGDB:
                print >> sys.stderr, "Channel: fetching getChannelStateByCID from DB", self

            searchManager = ChannelManager.getInstance()
            result = searchManager.getChannelStateByCID(self.dispersy_cid)
            if result:
                return result

        return ChannelCommunity.CHANNEL_CLOSED, self.isMyChannel()
Пример #13
0
    def getState(self):
        if self.isDispersy():
            from Tribler.Main.vwxGUI.SearchGridManager import ChannelManager

            if DEBUGDB:
                print >> sys.stderr, "Channel: fetching getChannelStateByCID from DB", self

            searchManager = ChannelManager.getInstance()
            result = searchManager.getChannelStateByCID(self.dispersy_cid)
            if result:
                return result

        return ChannelCommunity.CHANNEL_CLOSED, self.isMyChannel()
Пример #14
0
    def torrent(self):
        if self._torrent is not None:
            return self._torrent

        if self.channeltorrent_id:
            from Tribler.Main.vwxGUI.SearchGridManager import ChannelManager

            if DEBUGDB:
                print >> sys.stderr, "Comment: fetching getTorrentFromChannelTorrentId from DB", self

            searchManager = ChannelManager.getInstance()
            return searchManager.getTorrentFromChannelTorrentId(
                self.channel, self.channeltorrent_id, False)
Пример #15
0
 def extended_description(self):
     if self.description:
         return self.description
     
     from Tribler.Main.vwxGUI.SearchGridManager import ChannelManager
     
     #No description, get swarmnames
     searchManager = ChannelManager.getInstance()
     _,_, torrents =  searchManager.getTorrentsFromPlaylist(self, limit = 3)
     names = [torrent.name for torrent in torrents]
     if len(names) > 0:
         return "Contents: '"+"'    '".join(names)+"'"
     else:
         return 'This playlist is currently empty, drag and drop any .torrent to add it to this playlist.'
Пример #16
0
 def register(self):
     if not self.registered:
         self.registered = True
         
         self.torrentsearch_manager = TorrentManager.getInstance(self)
         self.channelsearch_manager = ChannelManager.getInstance()
         self.library_manager = LibraryManager.getInstance(self)
         self.torrentstate_manager = TorrentStateManager.getInstance(self)
         
         self.torrentsearch_manager.connect(self.utility.session, self.library_manager, self.channelsearch_manager)
         self.channelsearch_manager.connect(self.utility.session, self.library_manager, self.torrentsearch_manager)
         self.library_manager.connect(self.utility.session, self.torrentsearch_manager, self.channelsearch_manager)
         self.torrentstate_manager.connect(self.torrentsearch_manager, self.library_manager, self.channelsearch_manager)
     else:
         raise RuntimeError('GuiUtility is already registered')
Пример #17
0
    def register(self):
        if not self.registered:
            self.registered = True

            self.torrentsearch_manager = TorrentManager.getInstance(self)
            self.channelsearch_manager = ChannelManager.getInstance()
            self.library_manager = LibraryManager.getInstance(self)
            self.torrentstate_manager = TorrentStateManager.getInstance(self)

            self.torrentsearch_manager.connect(self.utility.session, self.library_manager, self.channelsearch_manager)
            self.channelsearch_manager.connect(self.utility.session, self.library_manager, self.torrentsearch_manager)
            self.library_manager.connect(self.utility.session, self.torrentsearch_manager, self.channelsearch_manager)
            self.torrentstate_manager.connect(self.torrentsearch_manager, self.library_manager, self.channelsearch_manager)
        else:
            raise RuntimeError('GuiUtility is already registered')
Пример #18
0
    def register(self):
        self.torrentsearch_manager = TorrentManager.getInstance(self)
        self.channelsearch_manager = ChannelManager.getInstance()
        self.library_manager = LibraryManager.getInstance(self)
        self.torrentstate_manager = TorrentStateManager.getInstance(self)

        self.torrentsearch_manager.connect(self.utility.session,
                                           self.library_manager,
                                           self.channelsearch_manager)
        self.channelsearch_manager.connect(self.utility.session,
                                           self.torrentsearch_manager)
        self.library_manager.connect(self.utility.session,
                                     self.torrentsearch_manager,
                                     self.channelsearch_manager)
        self.torrentstate_manager.connect(self.torrentsearch_manager,
                                          self.library_manager,
                                          self.channelsearch_manager)
Пример #19
0
    def extended_description(self):
        if self.description:
            return self.description

        from Tribler.Main.vwxGUI.SearchGridManager import ChannelManager

        # No description, get swarmnames
        searchManager = ChannelManager.getInstance()
        _, _, torrents = searchManager.getTorrentsFromPlaylist(self, limit=3)
        names = [torrent.name for torrent in torrents]
        if len(names) > 0:
            return "Contents: '" + "'    '".join(names) +"'"
        elif self.channel.isOpen():
            return 'This playlist is currently empty, drag and drop any .torrent to add it to this playlist.'
        elif self.channel.isMyChannel():
            return 'This playlist is currently empty, you are the only one who can add torrents to it.'
        return 'This playlist is currently empty, the channel owner has restricted anyone but himself to add torrents to it.'
Пример #20
0
    def extended_description(self):
        if self.description:
            return self.description

        from Tribler.Main.vwxGUI.SearchGridManager import ChannelManager

        #No description, get swarmnames
        searchManager = ChannelManager.getInstance()
        _, _, torrents = searchManager.getTorrentsFromPlaylist(self, limit=3)
        names = [torrent.name for torrent in torrents]
        if len(names) > 0:
            return "Contents: '" + "'    '".join(names) + "'"
        elif self.channel.isOpen():
            return 'This playlist is currently empty, drag and drop any .torrent to add it to this playlist.'
        elif self.channel.isMyChannel():
            return 'This playlist is currently empty, you are the only one who can add torrents to it.'
        return 'This playlist is currently empty, the channel owner has restricted anyone but himself to add torrents to it.'
Пример #21
0
 def loadPopularTorrentNames(self, num_torrents, force_refresh=False):
     if not self.popular_torrents or force_refresh:
         from Tribler.Main.vwxGUI.GuiUtility import GUIUtility
         from Tribler.Main.vwxGUI.SearchGridManager import ChannelManager
         results = ChannelManager.getInstance().getMostPopularTorrentsFromChannel(self.id, ['Torrent.Name'], family_filter=GUIUtility.getInstance().getFamilyFilter(), limit= num_torrents)
         self.popular_torrents = [result[0] for result in results]