Beispiel #1
0
 def set_max_upload(self, speed):
     """
     Sets the maximum upload speed in the rate limiter.
     :param speed: The maximum speed in KiB/s
     :return: Boolean indicating success.
     """
     try:
         DownloadManager.getInstance().set_max_upload(speed)
         return True
     except:
         return False
Beispiel #2
0
 def set_max_upload(self, speed):
     """
     Sets the maximum upload speed in the rate limiter.
     :param speed: The maximum speed in KiB/s
     :return: Boolean indicating success.
     """
     try:
         DownloadManager.getInstance().set_max_upload(speed)
         return True
     except:
         return False
Beispiel #3
0
    def run(self):
        """
        This sets up a Tribler session, loads the managers and the XML-RPC server.
        :return: Nothing.
        """

        _logger.error("Loading XMLRPCServer")
        self.xmlrpc = XMLRPCServer(iface="0.0.0.0", port=8000)

        _logger.error("Loading TriblerSessionService")
        self.tribler = TriblerSession(self.xmlrpc)
        self.tribler.start_session()

        # Wait for dispersy to initialize
        while not self.tribler.is_running():
            time.sleep(0.1)

        # Disable ChannelManager
        #_logger.error("Loading ChannelManager")
        #self.cm = ChannelManager.getInstance(self.tribler.get_session(), self.xmlrpc)

        _logger.error("Loading TorrentManager")
        self.tm = TorrentManager.getInstance(self.tribler.get_session(), self.xmlrpc)

        _logger.error("Loading DownloadManager")
        self.dm = DownloadManager.getInstance(self.tribler.get_session(), self.xmlrpc)

        _logger.error("Loading ConfigurationManager")
        # Load this last because it sets settings in other managers
        self.sm = SettingsManager.getInstance(self.tribler.get_session(), self.xmlrpc)

        _logger.error("Now running XMLRPC on http://%s:%s/tribler" % (self.xmlrpc._iface, self.xmlrpc._port))
        self.xmlrpc.start_server()
Beispiel #4
0
 def get_max_upload(self):
     """
     Gets the maximum upload speed from the rate limiter
     :return: Maximum upload speed in KiB/s
     """
     try:
         return DownloadManager.getInstance().get_max_upload()
     except:
         return False
Beispiel #5
0
 def get_max_upload(self):
     """
     Gets the maximum upload speed from the rate limiter
     :return: Maximum upload speed in KiB/s
     """
     try:
         return DownloadManager.getInstance().get_max_upload()
     except:
         return False