def set_mode(self,mode):
     """ Note: this currently works only when the download is stopped. """
     self.dllock.acquire()
     try:
         DownloadConfigInterface.set_mode(self,mode)
     finally:
         self.dllock.release()
 def set_video_event_callback(self,usercallback,dlmode=DLMODE_VOD):
     """ Note: this currently works only when the download is stopped. """
     self.dllock.acquire()
     try:
         DownloadConfigInterface.set_video_event_callback(self,usercallback,dlmode=dlmode)
     finally:
         self.dllock.release()
Esempio n. 3
0
 def set_mode(self, mode):
     """ Note: this currently works only when the download is stopped. """
     self.dllock.acquire()
     try:
         DownloadConfigInterface.set_mode(self, mode)
     finally:
         self.dllock.release()
Esempio n. 4
0
 def set_selected_files(self, files):
     """ Note: this currently works only when the download is stopped. """
     self.dllock.acquire()
     try:
         DownloadConfigInterface.set_selected_files(self, files)
         self.set_filepieceranges(self.tdef.get_metainfo())
     finally:
         self.dllock.release()
 def set_selected_files(self,files):
     """ Note: this currently works only when the download is stopped. """
     self.dllock.acquire()
     try:
         DownloadConfigInterface.set_selected_files(self,files)
         self.set_filepieceranges(self.tdef.get_metainfo())
     finally:
         self.dllock.release()
 def set_max_conns(self,nconns):
     self.dllock.acquire()
     try:
         if self.sd is not None:
             set_max_conns_lambda = lambda:self.sd is not None and self.sd.set_max_conns(nconns,None)
             self.session.lm.rawserver.add_task(set_max_conns_lambda,0.0)
         DownloadConfigInterface.set_max_conns(self,nconns)
     finally:
         self.dllock.release()
Esempio n. 7
0
 def set_video_event_callback(self, usercallback, dlmode=DLMODE_VOD):
     """ Note: this currently works only when the download is stopped. """
     self.dllock.acquire()
     try:
         DownloadConfigInterface.set_video_event_callback(self,
                                                          usercallback,
                                                          dlmode=dlmode)
     finally:
         self.dllock.release()
 def set_proxy_mode(self,value):
     """ Set the proxymode for current download
     .
     @param value: the proxyservice mode: PROXY_MODE_OFF, PROXY_MODE_PRIVATE or PROXY_MODE_SPEED
     """
     self.dllock.acquire()
     try:
         DownloadConfigInterface.set_proxy_mode(self, value)
     finally:
         self.dllock.release()
Esempio n. 9
0
 def set_max_conns(self, nconns):
     self.dllock.acquire()
     try:
         if self.sd is not None:
             set_max_conns_lambda = lambda: self.sd.set_max_conns(
                 nconns, None)
             self.session.lm.rawserver.add_task(set_max_conns_lambda, 0.0)
         DownloadConfigInterface.set_max_conns(self, nconns)
     finally:
         self.dllock.release()
Esempio n. 10
0
 def get_rarest_first_priority_cutoff(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_rarest_first_priority_cutoff(
             self)
     finally:
         self.dllock.release()
Esempio n. 11
0
 def get_no_helpers(self):
     """ Returns the maximum number of helpers used for a download. 
     @return: a positive integer number
     """
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_no_helpers(self)
     finally:
         self.dllock.release()
Esempio n. 12
0
 def set_max_speed(self,direct,speed):
     if DEBUG:
         print >>sys.stderr,time.asctime(),'-', "Download: set_max_speed",`self.get_def().get_metainfo()['info']['name']`,direct,speed
     #print_stack()
     
     self.dllock.acquire()
     try:
         # Don't need to throw an exception when stopped, we then just save the new value and
         # use it at (re)startup.
         if self.sd is not None:
             set_max_speed_lambda = lambda:self.sd is not None and self.sd.set_max_speed(direct,speed,None)
             self.session.lm.rawserver.add_task(set_max_speed_lambda,0)
             
         # At the moment we can't catch any errors in the engine that this 
         # causes, so just assume it always works.
         DownloadConfigInterface.set_max_speed(self,direct,speed)
     finally:
         self.dllock.release()
Esempio n. 13
0
 def set_no_helpers(self,value):
     """ Set the maximum number of helpers used for a download.
     @param value: a positive integer number
     """
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.set_no_helpers(self, value)
     finally:
         self.dllock.release()
Esempio n. 14
0
 def get_proxy_mode(self):
     """ Returns the proxymode of the client.
     @return: one of the possible three values: PROXY_MODE_OFF, PROXY_MODE_PRIVATE, PROXY_MODE_SPEED
     """
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_proxy_mode(self)
     finally:
         self.dllock.release()
Esempio n. 15
0
    def set_max_speed(self, direct, speed):
        if DEBUG:
            print >> sys.stderr, "Download: set_max_speed", ` self.get_def(
            ).get_metainfo()['info']['name'] `, direct, speed
        #print_stack()

        self.dllock.acquire()
        try:
            # Don't need to throw an exception when stopped, we then just save the new value and
            # use it at (re)startup.
            if self.sd is not None:
                set_max_speed_lambda = lambda: self.sd.set_max_speed(
                    direct, speed, None)
                self.session.lm.rawserver.add_task(set_max_speed_lambda, 0)

            # At the moment we can't catch any errors in the engine that this
            # causes, so just assume it always works.
            DownloadConfigInterface.set_max_speed(self, direct, speed)
        finally:
            self.dllock.release()
Esempio n. 16
0
 def get_security(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_security(self)
     finally:
         self.dllock.release()
Esempio n. 17
0
 def get_round_robin_period(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_round_robin_period(self)
     finally:
         self.dllock.release()
Esempio n. 18
0
 def get_max_speed(self,direct):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_max_speed(self,direct)
     finally:
         self.dllock.release()
Esempio n. 19
0
 def get_http_timeout(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_http_timeout(self)
     finally:
         self.dllock.release()
Esempio n. 20
0
 def get_tcp_ack_fudge(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_tcp_ack_fudge(self)
     finally:
         self.dllock.release()
Esempio n. 21
0
 def get_video_events(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_video_events(self)
     finally:
         self.dllock.release()
Esempio n. 22
0
 def get_same_nat_try_internal(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_same_nat_try_internal(self)
     finally:
         self.dllock.release()
Esempio n. 23
0
 def get_poa(self, poa):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_poa(self)
     finally:
         self.dllock.release()
Esempio n. 24
0
 def set_poa(self, poa):
     self.dllock.acquire()
     try:
         DownloadConfigInterface.set_poa(self, poa)
     finally:
         self.dllock.release()
Esempio n. 25
0
 def get_ut_pex_max_addrs_from_peer(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_ut_pex_max_addrs_from_peer(self)
     finally:
         self.dllock.release()
Esempio n. 26
0
 def get_exclude_ips(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_exclude_ips(self)
     finally:
         self.dllock.release()
Esempio n. 27
0
 def get_auto_flush(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_auto_flush(self)
     finally:
         self.dllock.release()
Esempio n. 28
0
 def get_lock_while_reading(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_lock_while_reading(self)
     finally:
         self.dllock.release()
Esempio n. 29
0
 def get_security(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_security(self)
     finally:
         self.dllock.release()
Esempio n. 30
0
 def get_rarest_first_priority_cutoff(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_rarest_first_priority_cutoff(self)
     finally:
         self.dllock.release()
Esempio n. 31
0
 def get_unchoke_bias_for_internal(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_unchoke_bias_for_internal(self)
     finally:
         self.dllock.release()
Esempio n. 32
0
 def get_write_buffer_size(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_write_buffer_size(self)
     finally:
         self.dllock.release()
Esempio n. 33
0
 def get_max_files_open(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_max_files_open(self)
     finally:
         self.dllock.release()
Esempio n. 34
0
 def get_max_slice_length(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_max_slice_length(self)
     finally:
         self.dllock.release()
Esempio n. 35
0
 def get_breakup_seed_bitfield(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_breakup_seed_bitfield(self)
     finally:
         self.dllock.release()
Esempio n. 36
0
 def get_rerequest_interval(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_rerequest_interval(self)
     finally:
         self.dllock.release()
Esempio n. 37
0
 def get_min_uploads(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_min_uploads(self)
     finally:
         self.dllock.release()
Esempio n. 38
0
 def get_write_buffer_size(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_write_buffer_size(self)
     finally:
         self.dllock.release()
Esempio n. 39
0
 def get_triple_check_writes(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_triple_check_writes(self)
     finally:
         self.dllock.release()
Esempio n. 40
0
 def get_min_uploads(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_min_uploads(self)
     finally:
         self.dllock.release()
Esempio n. 41
0
 def get_lock_while_reading(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_lock_while_reading(self)
     finally:
         self.dllock.release()
Esempio n. 42
0
 def get_max_files_open(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_max_files_open(self)
     finally:
         self.dllock.release()
Esempio n. 43
0
 def get_exclude_ips(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_exclude_ips(self)
     finally:
         self.dllock.release()
Esempio n. 44
0
 def get_max_speed(self, direct):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_max_speed(self, direct)
     finally:
         self.dllock.release()
Esempio n. 45
0
 def set_poa(self, poa):
     self.dllock.acquire()
     try:
         DownloadConfigInterface.set_poa(self, poa)
     finally:
         self.dllock.release()
Esempio n. 46
0
 def get_triple_check_writes(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_triple_check_writes(self)
     finally:
         self.dllock.release()
Esempio n. 47
0
 def get_round_robin_period(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_round_robin_period(self)
     finally:
         self.dllock.release()
Esempio n. 48
0
 def get_auto_flush(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_auto_flush(self)
     finally:
         self.dllock.release()
Esempio n. 49
0
 def get_rerequest_interval(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_rerequest_interval(self)
     finally:
         self.dllock.release()
Esempio n. 50
0
 def get_ut_pex_max_addrs_from_peer(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_ut_pex_max_addrs_from_peer(self)
     finally:
         self.dllock.release()
Esempio n. 51
0
 def get_poa(self, poa):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_poa(self)
     finally:
         self.dllock.release()
Esempio n. 52
0
 def get_unchoke_bias_for_internal(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_unchoke_bias_for_internal(self)
     finally:
         self.dllock.release()
Esempio n. 53
0
 def get_breakup_seed_bitfield(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_breakup_seed_bitfield(self)
     finally:
         self.dllock.release()
Esempio n. 54
0
 def get_same_nat_try_internal(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_same_nat_try_internal(self)
     finally:
         self.dllock.release()
Esempio n. 55
0
 def get_max_conns_to_initiate(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_max_conns_to_initiate(self)
     finally:
         self.dllock.release()
Esempio n. 56
0
 def get_tcp_ack_fudge(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_tcp_ack_fudge(self)
     finally:
         self.dllock.release()
Esempio n. 57
0
 def get_download_slice_size(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_download_slice_size(self)
     finally:
         self.dllock.release()
Esempio n. 58
0
 def get_video_events(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_video_events(self)
     finally:
         self.dllock.release()
Esempio n. 59
0
 def get_http_timeout(self):
     self.dllock.acquire()
     try:
         return DownloadConfigInterface.get_http_timeout(self)
     finally:
         self.dllock.release()