mediawiki: Add support for the revision argument

refs #1067
This commit is contained in:
Laurent Bachelier 2013-03-11 00:39:01 +01:00
commit 0b29991387
2 changed files with 15 additions and 6 deletions

View file

@ -54,12 +54,13 @@ class MediawikiBackend(BaseBackend, ICapContent):
self.config['apiurl'].get(),
username, password)
def get_content(self, _id):
def get_content(self, _id, revision=None):
_id = _id.replace(' ', '_').encode('utf-8')
content = Content(_id)
page = _id
rev = revision.id if revision else None
with self.browser:
data = self.browser.get_wiki_source(page)
data = self.browser.get_wiki_source(page, rev)
content.content = data
return content