Example #1
0
 def restart(self, initialdlstatus=None):
     """
     Restarts the stopped Download.
     
     @param initialdlstatus An optional parameter to restart the Download in 
     a specific state.
     """
     # Called by any thread
     DownloadImpl.restart(self, initialdlstatus)
Example #2
0
 def restart(self,initialdlstatus=None):
     """
     Restarts the stopped Download.
     
     @param initialdlstatus An optional parameter to restart the Download in 
     a specific state.
     """
     # Called by any thread
     DownloadImpl.restart(self, initialdlstatus)
Example #3
0
 def set_state_callback(self,usercallback,getpeerlist=True):
     """ 
     Set a callback for retrieving the state of the download. This callback
     will be called immediately with a DownloadState object as first parameter.
     The callback method must return a tuple (when,getpeerlist) where "when" 
     indicates whether the callback should be called again and represents a
     number of seconds from now. If "when" <= 0.0 the callback will not be
     called again. "getpeerlist" is a boolean that indicates whether the 
     DownloadState passed to the callback on the next invocation should
     contain info about the set of current peers.
     
     The callback will be called by a popup thread which can be used
     indefinitely (within reason) by the higher level code.
             
     @param usercallback Function that accepts DownloadState as parameter and 
     returns a (float,boolean) tuple.
     """
     DownloadImpl.set_state_callback(self,usercallback,getpeerlist=getpeerlist)
Example #4
0
 def set_state_callback(self, usercallback, getpeerlist=False, delay=0.0):
     """ 
     Set a callback for retrieving the state of the download. This callback
     will be called immediately with a DownloadState object as first parameter.
     The callback method must return a tuple (when,getpeerlist) where "when" 
     indicates whether the callback should be called again and represents a
     number of seconds from now. If "when" <= 0.0 the callback will not be
     called again. "getpeerlist" is a boolean that indicates whether the 
     DownloadState passed to the callback on the next invocation should
     contain info about the set of current peers.
     
     The callback will be called by a popup thread which can be used
     indefinitely (within reason) by the higher level code.
             
     @param usercallback Function that accepts DownloadState as parameter and 
     returns a (float,boolean) tuple.
     """
     DownloadImpl.set_state_callback(self,
                                     usercallback,
                                     getpeerlist=getpeerlist,
                                     delay=delay)
Example #5
0
 def __init__(self, session, tdef):
     """ Internal constructor
     @param session Session
     @param tdef TorrentDef 
     """
     DownloadImpl.__init__(self, session, tdef)
Example #6
0
 def get_dest_files(self, exts=None):
     """ Returns the filenames on disk to which this Download saves
     @return A list of (filename-in-torrent, disk filename) tuples.
     """
     return DownloadImpl.get_dest_files(self, exts)
Example #7
0
 def set_server_ip(self, ipAddr):
     # Called by any thread
     DownloadImpl.set_server_ip(self, ipAddr)
Example #8
0
 def get_num_msgs(self):
     # Called by any thread
     return DownloadImpl.get_num_msgs(self)
Example #9
0
 def get_packet_loss(self):
     # Called by any thread
     return DownloadImpl.get_packet_loss(self)
Example #10
0
 def set_max_desired_speed(self,direct,speed):
     """ Sets the maximum desired upload/download speed for this Download. 
     @param direct The direction (UPLOAD/DOWNLOAD) 
     @param speed The speed in KB/s.
     """
     DownloadImpl.set_max_desired_speed(self,direct,speed)
Example #11
0
 def stop(self):
     """ Stops the Download, i.e. closes all connections to other peers. """
     # Called by any thread
     DownloadImpl.stop(self)
Example #12
0
 def stop(self):
     """ Stops the Download, i.e. closes all connections to other peers. """
     # Called by any thread 
     DownloadImpl.stop(self)
Example #13
0
 def get_def(self):
     """
     Return the read-only torrent definition (TorrentDef) for this Download.
     @return A TorrentDef object.
     """
     return DownloadImpl.get_def(self)
Example #14
0
 def __init__(self,session,tdef):
     """ Internal constructor
     @param session Session
     @param tdef TorrentDef 
     """
     DownloadImpl.__init__(self,session,tdef)
Example #15
0
 def get_dest_files(self, exts = None):
     """ Returns the filenames on disk to which this Download saves
     @return A list of (filename-in-torrent, disk filename) tuples.
     """
     return DownloadImpl.get_dest_files(self, exts)
Example #16
0
 def get_max_desired_speed(self,direct):
     """ Returns the maximum desired upload/download speed for this Download.
     @return The previously set speed in KB/s 
     """
     return DownloadImpl.get_max_desired_speed(self,direct)
Example #17
0
 def get_def(self):
     """
     Return the read-only torrent definition (TorrentDef) for this Download.
     @return A TorrentDef object.
     """
     return DownloadImpl.get_def(self)
Example #18
0
 def set_max_desired_speed(self, direct, speed):
     """ Sets the maximum desired upload/download speed for this Download. 
     @param direct The direction (UPLOAD/DOWNLOAD) 
     @param speed The speed in KB/s.
     """
     DownloadImpl.set_max_desired_speed(self, direct, speed)
Example #19
0
 def get_server_ip(self):
     # Called by any thread
     return DownloadImpl.get_server_ip(self)
Example #20
0
 def restart(self):
     """ Restarts the stopped Download. """
     # Called by any thread
     DownloadImpl.restart(self)
Example #21
0
 def set_flag(self, ipAddr):
     return DownloadImpl.set_flag(self, ipAddr)
Example #22
0
 def get_max_desired_speed(self, direct):
     """ Returns the maximum desired upload/download speed for this Download.
     @return The previously set speed in KB/s 
     """
     return DownloadImpl.get_max_desired_speed(self, direct)
Example #23
0
 def update_peerlist(self, highpeers, lowpeers):
     """ Updates peerlist. """
     # Called by any thread
     return DownloadImpl.update_peerlist(self, highpeers, lowpeers)