[Sync] ALS Typograf stability impovements
This commit is contained in:
1 parent
7793830e60
commit
fc43f89099
1 file changed
+4
-2
@@ -27,10 +27,12 @@ async def typograf(text, options={}):
|
|||||||
'Content-Type': 'text/xml',
|
'Content-Type': 'text/xml',
|
||||||
'SOAPAction': 'http://typograf.artlebedev.ru/webservices/ProcessText',
|
'SOAPAction': 'http://typograf.artlebedev.ru/webservices/ProcessText',
|
||||||
})
|
})
|
||||||
|
resp_text = resp.encode()
|
||||||
response_tree = etree.fromstring(resp.encode())
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# create xml tree from response
|
||||||
|
response_tree = etree.fromstring(resp_text)
|
||||||
|
|
||||||
# look for ProcessTextResult
|
# look for ProcessTextResult
|
||||||
typograf_response = response_tree.getchildren()[0].getchildren()[0].getchildren()[0].text
|
typograf_response = response_tree.getchildren()[0].getchildren()[0].getchildren()[0].text
|
||||||
except Exception as response_tree:
|
except Exception as response_tree:
|
||||||
|
|||||||
Reference in new issue
Block a user