本文整理匯總了Python中ACEStream.Core.DownloadConfig.DownloadConfigInterface.set_max_speed方法的典型用法代碼示例。如果您正苦於以下問題:Python DownloadConfigInterface.set_max_speed方法的具體用法?Python DownloadConfigInterface.set_max_speed怎麽用?Python DownloadConfigInterface.set_max_speed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ACEStream.Core.DownloadConfig.DownloadConfigInterface
的用法示例。
在下文中一共展示了DownloadConfigInterface.set_max_speed方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: set_max_speed
# 需要導入模塊: from ACEStream.Core.DownloadConfig import DownloadConfigInterface [as 別名]
# 或者: from ACEStream.Core.DownloadConfig.DownloadConfigInterface import set_max_speed [as 別名]
def set_max_speed(self, direct, speed, auto_limit = False):
if DEBUG:
log('DownloadRuntimeConfig::set_max_speed:', binascii.hexlify(self.get_hash()), direct, speed, auto_limit)
self.dllock.acquire()
try:
if self.sd is not None:
set_max_speed_lambda = lambda : self.sd is not None and self.sd.set_max_speed(direct, speed, auto_limit)
self.session.lm.rawserver.add_task(set_max_speed_lambda, 0)
DownloadConfigInterface.set_max_speed(self, direct, speed, auto_limit)
finally:
self.dllock.release()