Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
 def getTmpFilename(self):
     if not self.isDownloaded() or self.errorOccured():
         raise hf.DownloadError(self)
     return os.path.basename(self.tmp_filename)
Ejemplo n.º 5
0
 def getArchiveFilename(self):
     if not self.isDownloaded() or self.errorOccured():
         raise hf.DownloadError(self)
     return self.filename