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] [xen-unstable] tools/python: sxp parser: show empty stri

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tools/python: sxp parser: show empty string
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 29 Jun 2010 13:45:10 -0700
Delivery-date: Tue, 29 Jun 2010 13:45:23 -0700
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
# Date 1277740185 -3600
# Node ID a37de3ca134140b23797bbda6967ab0db670225a
# Parent  bf64e1081333696c68c9430cbc32c8bd6ee18796
tools/python: sxp parser: show empty string

This patch makes the sxp parser show empty string.

Test case:
 import sxp
 sxp.show(sxp.from_string('(a "")'))
 sxp.show(sxp.from_string("(a '')"))

Without this patch:
 (a )(a )
With this patch:
 (a '')(a '')

Signed-off-by: Zhigang Wang <zhigang.x.wang@xxxxxxxxxx>
---
 tools/python/xen/xend/sxp.py |    2 ++
 1 files changed, 2 insertions(+)

diff -r bf64e1081333 -r a37de3ca1341 tools/python/xen/xend/sxp.py
--- a/tools/python/xen/xend/sxp.py      Fri Jun 25 16:05:20 2010 +0100
+++ b/tools/python/xen/xend/sxp.py      Mon Jun 28 16:49:45 2010 +0100
@@ -365,6 +365,8 @@ def atomp(sxpr):
 def atomp(sxpr):
     """Check if an sxpr is an atom.
     """
+    if sxpr == '':
+        return 0
     if sxpr.isalnum() or sxpr == '@':
         return 1
     for c in sxpr:

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] tools/python: sxp parser: show empty string, Xen patchbot-unstable <=