From bddb3ec445d58c82537fd9f1fa1ebc50e90ab5b7 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sat, 31 Dec 2011 16:07:08 +0000 Subject: [PATCH] Updated epydoc --- zeroinstall/__init__.py | 2 +- zeroinstall/injector/config.py | 2 ++ zeroinstall/injector/iface_cache.py | 4 ++-- zeroinstall/injector/policy.py | 4 +--- zeroinstall/support/tasks.py | 20 +++++++++----------- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/zeroinstall/__init__.py b/zeroinstall/__init__.py index dfe8f8b..8687a54 100644 --- a/zeroinstall/__init__.py +++ b/zeroinstall/__init__.py @@ -7,7 +7,7 @@ The Python implementation of the Zero Install injector is divided into five sub- - L{zeroinstall.gtkui} contains code for making GTK user-interfaces - L{zeroinstall.support} contains helper code (not really specific to Zero Install) -@copyright: (C) 2010, Thomas Leonard +@copyright: (C) 2011, Thomas Leonard @see: U{http://0install.net} @var _: a function for translating strings using the zero-install domain (for use internally by Zero Install) diff --git a/zeroinstall/injector/config.py b/zeroinstall/injector/config.py index 6b0e8e2..640bcff 100644 --- a/zeroinstall/injector/config.py +++ b/zeroinstall/injector/config.py @@ -28,6 +28,8 @@ class Config(object): @type key_info_server: str @ivar feed_mirror: the base URL of a mirror site for keys and feeds @type feed_mirror: str | None + @ivar freshness: seconds since a feed was last checked before it is considered stale + @type freshness: int """ __slots__ = ['help_with_testing', 'freshness', 'network_use', 'feed_mirror', 'key_info_server', 'auto_approve_keys', diff --git a/zeroinstall/injector/iface_cache.py b/zeroinstall/injector/iface_cache.py index e85678c..035885a 100644 --- a/zeroinstall/injector/iface_cache.py +++ b/zeroinstall/injector/iface_cache.py @@ -81,7 +81,7 @@ class PendingFeed(object): When all downloads are done (successful or otherwise), add any new keys to the keyring, L{recheck}. @param fetcher: fetcher to manage the download (was Handler before version 1.5) - @type fetcher: L{fetcher.Fetcher} + @type fetcher: L{fetch.Fetcher} @param key_mirror: URL of directory containing keys, or None to use feed's directory @type key_mirror: str """ @@ -519,7 +519,7 @@ class IfaceCache(object): return [self.get_interface(uri) for uri in feed_targets] def is_stale(self, feed, freshness_threshold): - """Check whether feed needs updating, based on the configured L{freshness}. + """Check whether feed needs updating, based on the configured L{config.Config.freshness}. None is considered to be stale. If we already tried to update the feed within FAILED_CHECK_DELAY, returns false. @return: True if feed should be updated diff --git a/zeroinstall/injector/policy.py b/zeroinstall/injector/policy.py index c22e3fb..c3642a4 100644 --- a/zeroinstall/injector/policy.py +++ b/zeroinstall/injector/policy.py @@ -1,7 +1,5 @@ """ -This class brings together a L{solve.Solver} to choose a set of implmentations, a -L{fetch.Fetcher} to download additional components, and the user's configuration -settings. +@deprecated: see L{driver} instead. """ # Copyright (C) 2009, Thomas Leonard diff --git a/zeroinstall/support/tasks.py b/zeroinstall/support/tasks.py index 44d42e9..e03ceaa 100644 --- a/zeroinstall/support/tasks.py +++ b/zeroinstall/support/tasks.py @@ -8,13 +8,13 @@ while the user does other things. There are four ways to do this: - Use a recursive mainloop. - Use this module. -Using threads causes a number of problems. Some builds of pygtk/python don't -support them, they introduce race conditions, often lead to many subtle -bugs, and they require lots of resources (you probably wouldn't want 10,000 -threads running at once). In particular, two threads can run at exactly the -same time (perhaps on different processors), so you have to be really careful -that they don't both try to update the same variable at the same time. This -requires lots of messy locking, which is hard to get right. +Using threads causes a number of problems: they introduce race conditions, +often lead to many subtle bugs, and they require lots of resources (you +probably wouldn't want 10,000 threads running at once). In particular, two +threads can run at exactly the same time (perhaps on different processors), so +you have to be really careful that they don't both try to update the same +variables at the same time. This requires lots of messy locking, which is hard +to get right. Callbacks work within a single thread. For example, you open a dialog box and then tell the system to call one function if it's closed, and another if the @@ -26,11 +26,9 @@ save state somewhere and then pass it to the functions when they're called. A recursive mainloop only works with nested tasks (you can create a sub-task, but the main task can't continue until the sub-task has -finished). We use these for, eg, rox.alert() boxes since you don't -normally want to do anything else until the box is closed, but it is not -appropriate for long-running jobs. +finished), so they are not appropriate for long-running jobs. -Tasks use python's generator API to provide a more pleasant interface to +Tasks use Python's generator API to provide a more pleasant interface to callbacks. See the Task class (below) for more information. """ -- 2.11.4.GIT