]> code.communitydata.science - rises_declines_wikia_code.git/blob - mediawiki_dump_tools/Mediawiki-Utilities/mw/api/collections/pages.py
add copy of the GPL
[rises_declines_wikia_code.git] / mediawiki_dump_tools / Mediawiki-Utilities / mw / api / collections / pages.py
1 import logging
2
3 from ...util import none_or
4 from .collection import Collection
5
6 logger = logging.getLogger("mw.api.collections.pages")
7
8
9 class Pages(Collection):
10     """
11     TODO
12     """
13
14     def _edit(self, title=None, pageid=None, section=None, sectiontitle=None,
15               text=None, token=None, summary=None, minor=None,
16               notminor=None, bot=None, basetimestamp=None,
17               starttimestamp=None, recreate=None, createonly=None,
18               nocreate=None, watch=None, unwatch=None, watchlist=None,
19               md5=None, prependtext=None, appendtext=None, undo=None,
20               undoafter=None, redirect=None, contentformat=None,
21               contentmodel=None, assert_=None, nassert=None,
22               captchaword=None, captchaid=None):
23         params = {
24             'action': "edit"
25         }
26         params['title'] = none_or(title, str)
27         params['pageid'] = none_or(pageid, int)
28         params['section'] = none_or(section, int, levels={'new'})
29         params['sectiontitle'] = none_or(sectiontitle, str)
30         params['text'] = none_or(text, str)
31         params['token'] = none_or(token, str)
32         params['summary'] = none_or(summary, str)
33         params['minor'] = none_or(minor, bool)
34         params['notminor'] = none_or(notminor, bool)
35         params['bot'] = none_or(bot, bool)
36         params['basetimestamp'] = self._check_timestamp(basetimestamp)
37         params['starttimestamp'] = self._check_timestamp(starttimestamp)
38         params['recreate'] = none_or(recreate, bool)
39         params['createonly'] = none_or(createonly, bool)
40         params['nocreate'] = none_or(nocreate, bool)
41         params['watch'] = none_or(watch, bool)
42         params['unwatch'] = none_or(unwatch, bool)
43         params['watchlist'] = none_or(watchlist, bool)
44         params['md5'] = none_or(md5, str)
45         params['prependtext'] = none_or(prependtext, str)
46         params['appendtext'] = none_or(appendtext, str)
47         params['undo'] = none_or(undo, int)
48         params['undoafter'] = none_or(undoafter, int)
49
50         # TODO finish this

Community Data Science Collective || Want to submit a patch?