def getArchivePath(self): if not self.isDownloaded() or self.errorOccured(): raise hf.DownloadError(self) try: return os.path.join(hf.downloadService.archive_dir, self.filename) except AttributeError: raise hf.DownloadError(self)
def getArchiveUrl(self): if not self.isDownloaded() or self.errorOccured(): raise hf.DownloadError(self) try: return hf.url.join(hf.downloadService.archive_url, self.filename) except AttributeError: raise hf.DownloadError(self)
def getTmpPath(self, no_exception=False): """ :arg no_exception: default False. If set to True, no exception is thrown when there was a problem while downloading the file. """ if (not self.isDownloaded() or self.errorOccured()) and not no_exception: raise hf.DownloadError(self) try: return os.path.join(self.tmp_filename) except AttributeError: if not no_exception: raise hf.DownloadError(self)
def getTmpFilename(self): if not self.isDownloaded() or self.errorOccured(): raise hf.DownloadError(self) return os.path.basename(self.tmp_filename)
def getArchiveFilename(self): if not self.isDownloaded() or self.errorOccured(): raise hf.DownloadError(self) return self.filename