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

* Added a 'ListSystemSettings()' method to the 'rivwebpyapi' API.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2021-12-04 12:36:37 -05:00
parent 2f15913d2a
commit 308636eb72
4 changed files with 120 additions and 1 deletions

View File

@@ -938,3 +938,44 @@ class rivwebpyapi(object):
xml.sax.parseString(r.text,handler)
return handler.output()
def ListSystemSettings(self):
"""
Returns Rivendell system settings (dictionary)
"""
#
# Build the WebAPI arguments
#
postdata={
'COMMAND': '33',
'LOGIN_NAME': self.__connection_username,
'PASSWORD': self.__connection_password
}
#
# Fetch the XML
#
r=requests.post(self.__connection_url,data=postdata)
if(r.status_code!=requests.codes.ok):
r.raise_for_status()
#
# Generate the output dictionary
#
fields={
'realmName': 'string',
'sampleRate': 'integer',
'duplicateTitles': 'boolean',
'fixDuplicateTitles': 'boolean',
'maxPostLength': 'integer',
'isciXreferencePath': 'string',
'tempCartGroup': 'string',
'longDateFormat': 'string',
'shortDateFormat': 'string',
'showTwelveHourTime': 'boolean'
}
handler=RivWebPyApi_ListHandler(base_tag='systemSettings',fields=fields)
xml.sax.parseString(r.text,handler)
return handler.output()