本文整理汇总了Python中pyaid.system.SystemUtils.SystemUtils.download方法的典型用法代码示例。如果您正苦于以下问题:Python SystemUtils.download方法的具体用法?Python SystemUtils.download怎么用?Python SystemUtils.download使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyaid.system.SystemUtils.SystemUtils
的用法示例。
在下文中一共展示了SystemUtils.download方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _download
# 需要导入模块: from pyaid.system.SystemUtils import SystemUtils [as 别名]
# 或者: from pyaid.system.SystemUtils.SystemUtils import download [as 别名]
def _download(self, url, target, httpsVerify =False, critical =None):
print('Downloading %s -> %s' % (url, target))
try:
result = SystemUtils.download(
url=url,
target=target,
httpsVerify=httpsVerify,
critical=critical,
raiseExceptions=self._raiseCommandExceptions)
except Exception as err:
print('DOWNLOAD FAILED\n', err)
if critical or (critical is None and self._raiseCommandExceptions):
raise err
else:
print(err)
return False
if not result:
if critical or (critical is None and self._raiseCommandExceptions):
raise Exception('Download failed')
else:
print('DOWNLOAD FAILED')
return False
print('SUCCESS')
return True
示例2: _download
# 需要导入模块: from pyaid.system.SystemUtils import SystemUtils [as 别名]
# 或者: from pyaid.system.SystemUtils.SystemUtils import download [as 别名]
def _download(self, url, target, httpsVerify =False, critical =None):
print 'Downloading %s -> %s' % (url, target)
try:
result = SystemUtils.download(
url=url,
target=target,
httpsVerify=httpsVerify,
critical=critical,
raiseExceptions=self._raiseCommandExceptions)
except Exception, err:
print 'DOWNLOAD FAILED\n', err
if critical or (critical is None and self._raiseCommandExceptions):
raise err
else:
print err
return False