summaryrefslogtreecommitdiffstats
path: root/src/xmlpythonizer.h
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2009-05-14 17:06:18 +0200
committerDavid Sommerseth <davids@redhat.com>2009-05-14 17:06:18 +0200
commit9d47720a88ee77ac4c0ab5f138a8eaf601c492d0 (patch)
tree8f518648fe86d0e3d8b8d0fca258d60b555cf735 /src/xmlpythonizer.h
parenta92cc1236ca7c5abee27e4360284b67297e39c15 (diff)
downloadpython-dmidecode-9d47720a88ee77ac4c0ab5f138a8eaf601c492d0.tar.gz
python-dmidecode-9d47720a88ee77ac4c0ab5f138a8eaf601c492d0.tar.xz
python-dmidecode-9d47720a88ee77ac4c0ab5f138a8eaf601c492d0.zip
Added new Map attribute - emptyIsNone
If the emptyIsNone attribute is set to "1", the Python result will be forced to Py_None if the referenced XML value is empty. When checking if the value is empty, the XML value is right trimmed to remove trailing spaces. Only spaces are are removed.
Diffstat (limited to 'src/xmlpythonizer.h')
-rw-r--r--src/xmlpythonizer.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/xmlpythonizer.h b/src/xmlpythonizer.h
index d6fa54c..f0efaee 100644
--- a/src/xmlpythonizer.h
+++ b/src/xmlpythonizer.h
@@ -41,6 +41,8 @@ typedef struct ptzMAP_s {
// the rest of types, an XPath to XML data
int fixed_list_size; // Only to be used on lists
char *list_index ; // Only to be used on fixed lists
+ int emptyIsNone; // Only for ptzINT/ptzFLOAT values
+ // - if set to 1, empty input strings sets the result to Py_None
struct ptzMAP_s *child; // Only used for type_value == pyDICT
struct ptzMAP_s *next; // Pointer chain