Пример #1
0
    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
0
 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