| 31 | import logging |
| 32 | |
| 33 | class ASCommandResponse: |
| 34 | |
| 35 | def __init__(self, response): |
| 36 | self.wbxmlBody = response |
| 37 | try: |
| 38 | if ( len(response) > 0): |
| 39 | self.xmlString = self.decodeWBXML(self.wbxmlBody) |
| 40 | else: |
| 41 | raise ValueError("Empty WBXML body passed") |
| 42 | except Exception as e: |
| 43 | self.xmlString = None |
| 44 | raise ValueError("Error: {0}".format(e)) |
| 45 | |
| 46 | def getWBXMLBytes(self): |
| 47 | return self.wbxmlBytes |
| 48 | |
| 49 | def getXMLString(self): |
| 50 | return self.xmlString |
| 51 | |
| 52 | def decodeWBXML(self, body): |
| 53 | self.instance = ASWBXML() |
| 54 | self.instance.loadBytes(body) |
| 55 | return self.instance.getXml() |
| 56 | |
| 57 | if __name__ == "__main__": |
| 58 | import os |
no outgoing calls
no test coverage detected
searching dependent graphs…