diff --git a/ChangeLog b/ChangeLog index 73c7dbf0..e054d4bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22573,3 +22573,8 @@ Operations Guide to after the 'The RDCatch Main Window' section. 2021-11-04 Fred Gleason * Added a 'rivwebpyapi' API. +2021-11-05 Fred Gleason + * Removed the 'untangle' Python module dependency from the + 'rivwebpyapi' API. + * Added a 'xmltodict' Python module dependency to the 'rivwebpyapi' + API. diff --git a/apis/rivwebpyapi/api/rivwebpyapi.py b/apis/rivwebpyapi/api/rivwebpyapi.py index 15dba3d0..b7eb1d9d 100755 --- a/apis/rivwebpyapi/api/rivwebpyapi.py +++ b/apis/rivwebpyapi/api/rivwebpyapi.py @@ -19,7 +19,7 @@ # import requests -import untangle +import xmltodict class RivWebPyApi(object): """ @@ -66,4 +66,4 @@ class RivWebPyApi(object): r=requests.post(self.__connection_url,data=postdata) if(r.status_code!=requests.codes.ok): r.raise_for_status() - return untangle.parse(r.text) + return xmltodict.parse(r.text) diff --git a/apis/rivwebpyapi/tests/list_services.py b/apis/rivwebpyapi/tests/list_services.py index 32036bad..ab1eb9ed 100755 --- a/apis/rivwebpyapi/tests/list_services.py +++ b/apis/rivwebpyapi/tests/list_services.py @@ -52,10 +52,10 @@ if((not url)or(not username)): webapi=rivwebpyapi.RivWebPyApi(url=url,username=username,passwd=password) services=webapi.ListServices(False) -for svc in services.serviceList.service: - print('NAME: '+svc.name.cdata) - if(svc.description.cdata): - print('DESCRIPTION: '+svc.description.cdata) +for svc in services['serviceList']['service']: + print('NAME: '+svc['name']) + if(svc['description']): + print('DESCRIPTION: '+svc['description']) else: print('DESCRIPTION: [none]') print('')