WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Added behaviour to read() to read directly from the tran

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Added behaviour to read() to read directly from the transaction's path if no
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 28 Sep 2005 13:16:11 +0000
Delivery-date: Wed, 28 Sep 2005 13:13:46 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@ewan
# Node ID a65cdee92c0f5ce1c8240710b258013f9827002e
# Parent  1e288a9316fdff2967889ae9ac5d016fa4e996d2
Added behaviour to read() to read directly from the transaction's path if no
arguments are specified.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 1e288a9316fd -r a65cdee92c0f 
tools/python/xen/xend/xenstore/xstransact.py
--- a/tools/python/xen/xend/xenstore/xstransact.py      Wed Sep 28 12:41:44 2005
+++ b/tools/python/xen/xend/xenstore/xstransact.py      Wed Sep 28 12:43:07 2005
@@ -42,8 +42,15 @@
                                '%s, while reading %s' % (ex.args[1], path))
 
     def read(self, *args):
-        if len(args) == 0:
-            raise TypeError
+        """If no arguments are given, return the value at this transaction's
+        path.  If one argument is given, treat that argument as a subpath to
+        this transaction's path, and return the value at that path.
+        Otherwise, treat each argument as a subpath to this transaction's
+        path, and return a list composed of the values at each of those
+        instead.
+        """
+        if len(args) == 0:
+            return xshandle().read(self.path)
         if len(args) == 1:
             return self._read(args[0])
         ret = []
@@ -191,6 +198,13 @@
 
 
     def Read(cls, path, *args):
+        """If only one argument is given (path), return the value stored at
+        that path.  If two arguments are given, treat the second argument as a
+        subpath within the first, and return the value at the composed path.
+        Otherwise, treat each argument after the first as a subpath to the
+        given path, and return a list composed of the values at each of those
+        instead.  This operation is performed inside a transaction.
+        """
         while True:
             t = cls(path)
             try:
@@ -234,6 +248,12 @@
     Remove = classmethod(Remove)
 
     def List(cls, path, *args):
+        """If no arguments are given (path), list its contents, returning the
+        entries therein, or None if no entries are found.  Otherwise, treat
+        each further argument as a subpath to the given path, and return the
+        cumulative listing of each of those instead.  This operation is
+        performed inside a transaction.
+        """
         while True:
             t = cls(path)
             try:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Added behaviour to read() to read directly from the transaction's path if no, Xen patchbot -unstable <=