@@ -18,30 +18,30 @@ class ResponseTemplate(object):
1818 """
1919
2020 def __init__ (self , response = "" ):
21- descr = "Empty API response. Probably unreachable API end point"
2221 #: Holds the response as plain text / string
23- self .__raw = response
22+ self ._raw = response
2423 if (response is "" ) or (response is None ):
25- self .__raw = "[RESPONSE]\r \n CODE=423\r \n DESCRIPTION=%s\r \n EOF\r \n " % (descr )
24+ descr = "Empty API response. Probably unreachable API end point {CONNECTION_URL}"
25+ self ._raw = "[RESPONSE]\r \n CODE=423\r \n DESCRIPTION=%s\r \n EOF\r \n " % (descr )
2626
2727 # try/except to support old versions of python (python2.5)
2828 try :
29- if isinstance (self .__raw , bytes ):
30- self .__raw = self .__raw .decode ("utf-8" )
29+ if isinstance (self ._raw , bytes ):
30+ self ._raw = self ._raw .decode ("utf-8" )
3131 except UnicodeError :
32- self .__raw = self .__raw .decode ("latin1" )
32+ self ._raw = self ._raw .decode ("latin1" )
3333 except BaseException :
34- self .__raw = self .__raw .decode ("utf-8" )
34+ self ._raw = self ._raw .decode ("utf-8" )
3535
3636 if isinstance (response , dict ):
3737 raise TypeError ('Type "dict" is not allowed for parameter "response". Use type "string" instead.' )
3838 else :
3939 #: Holds the response as hash
40- self .__hash = RP .parse (self .__raw )
40+ self .__hash = RP .parse (self ._raw )
4141
4242 if ('CODE' not in self .__hash ) or ('DESCRIPTION' not in self .__hash ):
43- self .__raw = '[RESPONSE]\r \n CODE=423\r \n DESCRIPTION=Invalid API response. Contact Support\r \n EOF\r \n '
44- self .__hash = RP .parse (self .__raw )
43+ self ._raw = '[RESPONSE]\r \n CODE=423\r \n DESCRIPTION=Invalid API response. Contact Support\r \n EOF\r \n '
44+ self .__hash = RP .parse (self ._raw )
4545
4646 def getCode (self ):
4747 """
@@ -59,7 +59,7 @@ def getPlain(self):
5959 """
6060 Returns the plain API response
6161 """
62- return self .__raw
62+ return self ._raw
6363
6464 def getQueuetime (self ):
6565 """
0 commit comments