本文整理汇总了Python中pyupdater.client.downloader.FileDownloader.download_verify_write方法的典型用法代码示例。如果您正苦于以下问题:Python FileDownloader.download_verify_write方法的具体用法?Python FileDownloader.download_verify_write怎么用?Python FileDownloader.download_verify_write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyupdater.client.downloader.FileDownloader
的用法示例。
在下文中一共展示了FileDownloader.download_verify_write方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _full_update
# 需要导入模块: from pyupdater.client.downloader import FileDownloader [as 别名]
# 或者: from pyupdater.client.downloader.FileDownloader import download_verify_write [as 别名]
def _full_update(self):
log.debug('Starting full update')
file_hash = self._get_file_hash_from_manifest()
with dsdev_utils.paths.ChDir(self.update_folder):
log.debug('Downloading update...')
fd = FileDownloader(self.filename, self.update_urls,
hexdigest=file_hash, verify=self.verify,
progress_hooks=self.progress_hooks)
result = fd.download_verify_write()
if result:
log.debug('Download Complete')
return True
else: # pragma: no cover
log.debug('Failed To Download Latest Version')
return False
示例2: _full_update
# 需要导入模块: from pyupdater.client.downloader import FileDownloader [as 别名]
# 或者: from pyupdater.client.downloader.FileDownloader import download_verify_write [as 别名]
def _full_update(self, name):
log.info('Starting full update')
latest = get_highest_version(name, self.platform, self.easy_data)
filename = get_filename(name, latest, self.platform, self.easy_data)
hash_key = '{}*{}*{}*{}*{}'.format(self.updates_key, name,
latest, self.platform,
'file_hash')
file_hash = self.easy_data.get(hash_key)
with jms_utils.paths.ChDir(self.update_folder):
log.info('Downloading update...')
fd = FileDownloader(filename, self.update_urls,
file_hash, self.verify, self.progress_hooks)
result = fd.download_verify_write()
if result:
log.info('Download Complete')
return True
else: # pragma: no cover
log.error('Failed To Download Latest Version')
return False