[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r17315: {updater} misc docs (in updater/trunk: . doc lib/thandy)



Author: nickm
Date: 2008-11-17 03:23:04 -0500 (Mon, 17 Nov 2008)
New Revision: 17315

Added:
   updater/trunk/doc/interface.txt
Modified:
   updater/trunk/TODO
   updater/trunk/lib/thandy/ClientCLI.py
   updater/trunk/lib/thandy/download.py
   updater/trunk/lib/thandy/util.py
Log:
misc docs

Modified: updater/trunk/TODO
===================================================================
--- updater/trunk/TODO	2008-11-17 08:08:42 UTC (rev 17314)
+++ updater/trunk/TODO	2008-11-17 08:23:04 UTC (rev 17315)
@@ -1,3 +1,6 @@
+03:07 < nickm> ok.  tomorrow morning I try to get messaging sorted, and try to
+               write up a registry-based exe version checker.
+
 - Download improvements.
   - Back off on download failure.
   - Handle full stalled file in download.

Added: updater/trunk/doc/interface.txt
===================================================================
--- updater/trunk/doc/interface.txt	                        (rev 0)
+++ updater/trunk/doc/interface.txt	2008-11-17 08:23:04 UTC (rev 17315)
@@ -0,0 +1,45 @@
+
+
+
+
+
+Thandy client interface:
+
+   thandy-client update [options] [bundlename...]
+
+Recognized options are:
+
+   --repo=<dir>    Store downloaded, finished information under <dir>.
+                   Defaults to ~/.thandy/cache
+
+   --no-download   Only decide what to download; don't actually download
+                   anything.
+
+   --loop          Do not exit after we have nothing more to download; keep
+                   waiting until there's something to do.
+
+   --no-packagesys Do not ask any underlying package system about what
+                   versions of things are installed.  Assume we need to
+                   fetch all packages not in the cache.
+
+   --install       Try to install packages after downloading them.
+
+   --socks-port=<port>
+                   Run all network operations over the SOCKS4a server at
+                   localhost:<port>
+
+   --debug|--info|--warn
+                   Set logging severity.
+
+
+   --force-check
+                   Download a fresh version of the timestamp file, whether
+                   we need it or not.
+
+
+02:55 < nickm> Right now, for a quick-and-dirty thing, vidalia can notice the 
+               specific form of the "Ready to install files:" message.  It can 
+               turn into something more formal later.
+02:56 < nickm> The only 'suggestions' thandy-client understands now are ones 
+               from command-line options, all of which are documented.
+02:56 < armadev> ok


Property changes on: updater/trunk/doc/interface.txt
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision

Modified: updater/trunk/lib/thandy/ClientCLI.py
===================================================================
--- updater/trunk/lib/thandy/ClientCLI.py	2008-11-17 08:08:42 UTC (rev 17314)
+++ updater/trunk/lib/thandy/ClientCLI.py	2008-11-17 08:23:04 UTC (rev 17315)
@@ -145,7 +145,7 @@
     print "Known commands:"
     print "  update [--repo=repository] [--no-download] [--loop]"
     print "         [--no-packagesys] [--install] [--socks-port=port]"
-    print "         [--debug|--info|--warn]"
+    print "         [--debug|--info|--warn] [--force-check]"
     sys.exit(1)
 
 def main():

Modified: updater/trunk/lib/thandy/download.py
===================================================================
--- updater/trunk/lib/thandy/download.py	2008-11-17 08:08:42 UTC (rev 17314)
+++ updater/trunk/lib/thandy/download.py	2008-11-17 08:23:04 UTC (rev 17315)
@@ -142,8 +142,9 @@
            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 @@
             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 @@
         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 @@
             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

Modified: updater/trunk/lib/thandy/util.py
===================================================================
--- updater/trunk/lib/thandy/util.py	2008-11-17 08:08:42 UTC (rev 17314)
+++ updater/trunk/lib/thandy/util.py	2008-11-17 08:23:04 UTC (rev 17315)
@@ -20,6 +20,9 @@
 import thandy.master_keys
 
 def moveFile(fromLocation, toLocation):
+    """Move the file from fromLocation to toLocation, removing any file
+       in toLocation.
+    """
     if sys.platform in ('cygwin', 'win32'):
         # Win32 doesn't let rename replace an existing file.
         try: