本文整理匯總了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