ia64/xen-unstable

changeset 8016:b8bca5421d5c

Added comment describing usage.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Wed Nov 23 19:31:14 2005 +0000 (2005-11-23)
parents 55aae13c9e0a
children 9ee811544c40
files tools/python/xen/xend/xenstore/xswatch.py
line diff
     1.1 --- a/tools/python/xen/xend/xenstore/xswatch.py	Wed Nov 23 19:19:24 2005 +0000
     1.2 +++ b/tools/python/xen/xend/xenstore/xswatch.py	Wed Nov 23 19:31:14 2005 +0000
     1.3 @@ -13,6 +13,18 @@ from xen.xend.XendLogging import log
     1.4  
     1.5  class xswatch:
     1.6  
     1.7 +    ##
     1.8 +    # Create a watch on the given path in the store.  The watch will fire
     1.9 +    # immediately, then subsequently each time the watched path is changed,
    1.10 +    # until the watch is deregistered, either by the return value from the
    1.11 +    # watch callback being False, or by an explicit call to unwatch.
    1.12 +    #
    1.13 +    # @param fn The function to be called when the watch fires.  This function
    1.14 +    # should take the path that has changed as its first argument, followed by
    1.15 +    # the extra arguments given to this constructor, if any.  It should return
    1.16 +    # True if the watch is to remain registered, or False if it is to be
    1.17 +    # deregistered.
    1.18 +    #
    1.19      def __init__(self, path, fn, *args, **kwargs):
    1.20          self.path = path
    1.21          self.fn = fn