Exemplo n.º 1
0
 def error(self, text):
     """
     Convenient shortcut to main EDLM LOGGER
     """
     if self.index_file:
         LOGGER.error(f'"{self.index_file}": {text}')
     else:
         LOGGER.error(f'"{self.source_folder}": {text}')
Exemplo n.º 2
0
    def _download(self) -> bool:
        if self._archive_is_correct():
            LOGGER.debug(
                '{self.__class__.__name__}: archive already downloaded')
            return True

        LOGGER.debug(
            f'{self.__class__.__name__}: downloading: {self.url} -> {self.archive}'
        )
        if elib.downloader.download(url=self.url,
                                    outfile=self.archive.absolute(),
                                    hexdigest=self.hash):
            LOGGER.debug(f'{self.__class__.__name__}: download successful')
            return True
        else:
            LOGGER.error(f'{self.__class__.__name__}: download failed')
            exit(-1)