id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,mlocked 13619,Python services-api enhancements,rcrdnalor,Bill Meek,"1) Python's lxml module works best if fed with raw data from a 'Request.session.get' response. A new option provided by this patch allows returning data as raw data i.e.: returning the recieved 'response.content'. This can be easily handled by the lxml.etree.fromstring() method. An example how to use this feature: {{{ $ python3 >>> from MythTV.services_api import send as API >>> from lxml import etree >>> host = ""localhost"" >>> mythrequest = API.Send(host) >>> endpoint = ""/Dvr/GetRecordedList"" >>> restdata = ""Descending=True&Count=3"" >>> opts = {'rawxml': True} ### < --- new option >>> response = mythrequest.send(endpoint=endpoint, rest=restdata, opts=opts) >>> eroot = etree.fromstring(response) >>> print(etree.tostring(eroot, pretty_print=True, encoding='unicode')) }}} Verified also with python2. Attached a patch adding this additional option. 2) The mythservices-api requires the 'post' data to be passed as dictionary. For classes derived from dictionary (dict), it is not mandatory to provide an attribute 'keys', but the methods 'keys()', 'values()', 'items()' must always be implemented. Using the latter methods, allows logging of a 'post' operation for those classes derived from 'dict'. Otherwise, on get a traceback showing an '!AttributeError' or a '!KeyError'. The class '!OrdDict' from the python bindings is such an example. Attached a patch that improves logging for 'post' operations.",Patch - Feature,closed,minor,31.1,Bindings - Python,Master Head,medium,fixed,services-api,,0