本文整理汇总了Python中BaseLib.Core.DownloadConfig.DownloadConfigInterface类的典型用法代码示例。如果您正苦于以下问题:Python DownloadConfigInterface类的具体用法?Python DownloadConfigInterface怎么用?Python DownloadConfigInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DownloadConfigInterface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_video_event_callback
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()
示例2: set_mode
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()
示例3: set_selected_files
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()
示例4: set_max_conns
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()
示例5: set_proxy_mode
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()
示例6: set_max_speed
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()
示例7: get_no_helpers
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()
示例8: set_no_helpers
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()
示例9: get_proxy_mode
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()
示例10: get_same_nat_try_internal
def get_same_nat_try_internal(self):
self.dllock.acquire()
try:
return DownloadConfigInterface.get_same_nat_try_internal(self)
finally:
self.dllock.release()
示例11: get_poa
def get_poa(self, poa):
self.dllock.acquire()
try:
return DownloadConfigInterface.get_poa(self)
finally:
self.dllock.release()
示例12: set_poa
def set_poa(self, poa):
self.dllock.acquire()
try:
DownloadConfigInterface.set_poa(self, poa)
finally:
self.dllock.release()
示例13: get_ut_pex_max_addrs_from_peer
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()
示例14: get_rarest_first_priority_cutoff
def get_rarest_first_priority_cutoff(self):
self.dllock.acquire()
try:
return DownloadConfigInterface.get_rarest_first_priority_cutoff(self)
finally:
self.dllock.release()
示例15: get_write_buffer_size
def get_write_buffer_size(self):
self.dllock.acquire()
try:
return DownloadConfigInterface.get_write_buffer_size(self)
finally:
self.dllock.release()