projects
/
python-simplemediawiki.debian
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bed00de
)
Forget about version checking for right now
author
Ian Weller
<ian@ianweller.org>
Sat, 5 Feb 2011 06:31:07 +0000
(
00:31
-0600)
committer
Benjamin Mako Hill
<mako@atdot.cc>
Sat, 12 Feb 2011 19:07:10 +0000
(14:07 -0500)
simplemediawiki.py
patch
|
blob
|
history
diff --git
a/simplemediawiki.py
b/simplemediawiki.py
index 2934ab9d96d071ad89c297dc4ac1b24a98ed706f..ec12a11754d8efdb157e68435a5335ac9c86e030 100644
(file)
--- a/
simplemediawiki.py
+++ b/
simplemediawiki.py
@@
-55,7
+55,6
@@
class MediaWiki():
_high_limits = None
_namespaces = None
_psuedo_namespaces = None
_high_limits = None
_namespaces = None
_psuedo_namespaces = None
- _mediawiki_version = None
def __init__(self, api_url, cookie_file=None, user_agent=DEFAULT_UA):
self._api_url = api_url
def __init__(self, api_url, cookie_file=None, user_agent=DEFAULT_UA):
self._api_url = api_url
@@
-111,17
+110,9
@@
class MediaWiki():
in order to test whether the given URL will return JSON.
"""
data = self._fetch_http(api_url, {'action': 'query',
in order to test whether the given URL will return JSON.
"""
data = self._fetch_http(api_url, {'action': 'query',
- 'meta': 'siteinfo',
- 'siprop': 'general',
- 'format': 'json'})
+ 'meta': 'siteinfo'})
try:
data_json = json.loads(data)
try:
data_json = json.loads(data)
- # may as well set the version
- try:
- version_string = data_json['query']['general']['generator']
- self._mediawiki_version = version_string.split(' ', 1)[1]
- except KeyError:
- pass
return (data, data_json)
except ValueError:
return (data, None)
return (data, data_json)
except ValueError:
return (data, None)
Benjamin Mako Hill
||
Want to submit a patch?