2021-12-06 Fred Gleason <fredg@paravelsystems.com>

* Modified the 'List*' methods in th 'rivwebpyapi' API to return
	None in fields that do not exist in the schema of the queried
	system.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2021-12-06 12:19:58 -05:00
parent bdb038f7b1
commit ab28750a5a
2 changed files with 21 additions and 12 deletions

View File

@ -22656,3 +22656,7 @@
2021-12-04 Fred Gleason <fredg@paravelsystems.com>
* Fixed multiple typos in the inline documentation for the
'rivwebpyapi' API.
2021-12-06 Fred Gleason <fredg@paravelsystems.com>
* Modified the 'List*' methods in th 'rivwebpyapi' API to return
None in fields that do not exist in the schema of the queried
system.

View File

@ -38,26 +38,31 @@ class RivWebPyApi_ListHandler(ContentHandler):
def output(self):
for d in self.__output: # Convert to the appropriate types
for f in self.__fields.keys():
d[f]=d[f].strip()
if(self.__fields[f]=='boolean'):
d[f]=self.__fromBoolean(d[f])
elif(self.__fields[f]=='datetime'):
d[f]=self.__fromDatetime(d[f])
elif(self.__fields[f]=='date'):
d[f]=self.__fromDate(d[f])
elif(self.__fields[f]=='integer'):
d[f]=self.__fromInteger(d[f])
elif(self.__fields[f]=='time'):
d[f]=self.__fromTime(d[f])
if(d[f]!=None):
d[f]=d[f].strip()
if(self.__fields[f]=='boolean'):
d[f]=self.__fromBoolean(d[f])
elif(self.__fields[f]=='datetime'):
d[f]=self.__fromDatetime(d[f])
elif(self.__fields[f]=='date'):
d[f]=self.__fromDate(d[f])
elif(self.__fields[f]=='integer'):
d[f]=self.__fromInteger(d[f])
elif(self.__fields[f]=='time'):
d[f]=self.__fromTime(d[f])
return self.__output
def startElement(self,tag,attrs):
if(tag==self.__base_tag): # Create new (empty) record
self.__record={}
for f in self.__fields.keys():
self.__record[f]=''
self.__record[f]=None
else:
if(tag in self.__fields.keys()):
self.__record[tag]=''
if('src' in attrs.keys()):
tag=tag+attrs['src'].capitalize()
self.__record[tag]=''
self.__field=tag
def endElement(self,tag):