tools/web: forward all arguments passed to getJSON and getXML to getURLContent

This commit is contained in:
nemunaire 2017-07-04 06:53:34 +02:00 committed by nemunaire
parent 384fbc6717
commit 4d68410777

View File

@ -162,15 +162,13 @@ def getURLContent(url, body=None, timeout=7, header=None):
(res.status, http.client.responses[res.status])) (res.status, http.client.responses[res.status]))
def getXML(url, timeout=7): def getXML(*args, **kwargs):
"""Get content page and return XML parsed content """Get content page and return XML parsed content
Arguments: Arguments: same as getURLContent
url -- the URL to get
timeout -- maximum number of seconds to wait before returning an exception
""" """
cnt = getURLContent(url, timeout=timeout) cnt = getURLContent(*args, **kwargs)
if cnt is None: if cnt is None:
return None return None
else: else:
@ -178,15 +176,13 @@ def getXML(url, timeout=7):
return parseString(cnt) return parseString(cnt)
def getJSON(url, timeout=7): def getJSON(*args, **kwargs):
"""Get content page and return JSON content """Get content page and return JSON content
Arguments: Arguments: same as getURLContent
url -- the URL to get
timeout -- maximum number of seconds to wait before returning an exception
""" """
cnt = getURLContent(url, timeout=timeout) cnt = getURLContent(*args, **kwargs)
if cnt is None: if cnt is None:
return None return None
else: else: