diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-11-17 08:23:04 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-11-17 08:23:04 +0000 |
commit | e5ec1b2ce20f7578fea683229aadc95431fdb451 (patch) | |
tree | a681a6e8df59f07925b1edceb5375ed099e5821b /lib/thandy/download.py | |
parent | 8315047663e745608ae5b9526f694977825b6aa7 (diff) |
misc docs
git-svn-id: file:///home/or/svnrepo/updater/trunk@17315 55e972cd-5a19-0410-ae62-a4d7a52db4cd
Diffstat (limited to 'lib/thandy/download.py')
-rw-r--r-- | lib/thandy/download.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/thandy/download.py b/lib/thandy/download.py index 2f98b30..d7fa19a 100644 --- a/lib/thandy/download.py +++ b/lib/thandy/download.py @@ -142,8 +142,9 @@ class DownloadJob: store it in targetPath. Store partial results in tmpPath; if there is already a file in tmpPath, assume that it is an incomplete download. If wantHash, reject the file unless - the hash is as given. If useTor, use a socks connection.""" - #DOCDODC repofile + the hash is as given. If useTor, use a socks connection. + If repoFile, use that RepositoryFile to validate the downloaded + data.""" self._destPath = targetPath self._tmpPath = tmpPath self._wantHash = wantHash @@ -196,7 +197,8 @@ class DownloadJob: return False def _checkTmpFile(self): - """DOCDOC""" + """Helper: check whether the downloaded temporary file matches + the hash and/or format we need.""" if self._wantHash and not self._repoFile: gotHash = thandy.formats.getFileDigest(self._tmpPath) if gotHash != self._wantHash: @@ -204,6 +206,7 @@ class DownloadJob: elif self._repoFile: self._repoFile.checkFile(self._tmpPath, self._wantHash) + def _download(self): # Implementation function. Unlike download(), can throw exceptions. f_in = f_out = None @@ -215,7 +218,8 @@ class DownloadJob: except thandy.Exception: pass else: - # What luck! This file was what we wanted. + # What luck! This stalled file was what we wanted. + # (This happens mostly with ) thandy.util.ensureParentDir(self._destPath) thandy.util.moveFile(self._tmpPath, self._destPath) return |