From bdf9099df8c2a4636b0ad0e710b73330877eef37 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Fri, 24 Oct 2014 19:59:05 +0200 Subject: Very cleaner, much class, such readable, wow --- banapedia/wapi/WikipediaQuery.py | 42 ---------------------------------------- banapedia/wapi/__init__.py | 0 2 files changed, 42 deletions(-) delete mode 100644 banapedia/wapi/WikipediaQuery.py delete mode 100644 banapedia/wapi/__init__.py (limited to 'banapedia/wapi') diff --git a/banapedia/wapi/WikipediaQuery.py b/banapedia/wapi/WikipediaQuery.py deleted file mode 100644 index d3d2f94..0000000 --- a/banapedia/wapi/WikipediaQuery.py +++ /dev/null @@ -1,42 +0,0 @@ -from ..api.Query import JSONQuery - -__author__ = 'pacien' - -WIKIPEDIA_QUERY_BASE_URL = "https://en.wikipedia.org/w/api.php" -LIST_SEPARATOR = "|" -DEFAULT_BKPROP = ["id", "user", "userid", "by", "byid", "timestamp", "expiry", "reason", "range", "flags"] -DEFAULT_BKSHOW = ["account", "temp", "ip", "range"] - - -class WikipediaQuery(JSONQuery): - def __init__(self, params={}): - params.update({ - "action": "query", - "format": "json", - }) - JSONQuery.__init__(self, base_url=WIKIPEDIA_QUERY_BASE_URL, params=params) - - -class ListQuery(WikipediaQuery): - def __init__(self, list_name, params={}): - params.update({ - "list": list_name, - }) - WikipediaQuery.__init__(self, params) - - -class BlockQuery(ListQuery): - def __init__(self, bkprop=DEFAULT_BKPROP, bkshow=DEFAULT_BKSHOW, bkdir="newer", limit=500, continue_token=None): - params = { - "bkprop": LIST_SEPARATOR.join(bkprop), - "bkshow": LIST_SEPARATOR.join(bkshow), - "bkdir": bkdir, - "bklimit": limit, - } - - if continue_token is not None: - params.update({"bkcontinue": continue_token}) - - ListQuery.__init__(self, "blocks", params=params) - - diff --git a/banapedia/wapi/__init__.py b/banapedia/wapi/__init__.py deleted file mode 100644 index e69de29..0000000 -- cgit v1.2.3