mediawiki backend: Use readurl instead of openurl
So that requests can be shown and saved if the debug options are activated. json.load(fp) is just calling json.loads(fp.read) so there is no performance loss.
This commit is contained in:
parent
4dc3e56d18
commit
44f6189ca5
1 changed files with 2 additions and 2 deletions
|
|
@ -169,11 +169,11 @@ class MediawikiBrowser(BaseBrowser):
|
|||
'''Submit a GET request to the website
|
||||
The JSON data is parsed and returned as a dictionary'''
|
||||
data['format'] = 'json'
|
||||
return simplejson.load(self.openurl(self.buildurl(self.apiurl, **data)), 'utf-8')
|
||||
return simplejson.loads(self.readurl(self.buildurl(self.apiurl, **data)), 'utf-8')
|
||||
|
||||
def API_post(self, data):
|
||||
'''Submit a POST request to the website
|
||||
The JSON data is parsed and returned as a dictionary'''
|
||||
|
||||
data['format'] = 'json'
|
||||
return simplejson.load(self.openurl(self.apiurl, urllib.urlencode(data)), 'utf-8')
|
||||
return simplejson.loads(self.readurl(self.apiurl, urllib.urlencode(data)), 'utf-8')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue