From f1ac019b3eca25d5edf5f4fab4c28f4be00e9b50 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Thu, 5 Jul 2012 19:40:11 -0400 Subject: [PATCH] Remove all use_sql from commands+tasks. --- earwigbot/commands/afc_submissions.py | 3 +-- earwigbot/tasks/afc_history.py | 2 +- earwigbot/tasks/afc_statistics.py | 4 +--- earwigbot/wiki/page.py | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/earwigbot/commands/afc_submissions.py b/earwigbot/commands/afc_submissions.py index 163c055..d20722e 100644 --- a/earwigbot/commands/afc_submissions.py +++ b/earwigbot/commands/afc_submissions.py @@ -55,8 +55,7 @@ class AFCSubmissions(Command): site = self.bot.wiki.get_site() category = site.get_category("Pending AfC submissions") - limit = number + len(self.ignore_list) - members = category.get_members(use_sql=True, limit=limit) + members = category.get_members(limit=number + len(self.ignore_list)) urls = [member.url for member in members if member.title not in self.ignore_list] pages = ", ".join(urls[:number]) self.reply(data, "{0} pending AfC subs: {1}".format(number, pages)) diff --git a/earwigbot/tasks/afc_history.py b/earwigbot/tasks/afc_history.py index 87c8636..7a0582a 100644 --- a/earwigbot/tasks/afc_history.py +++ b/earwigbot/tasks/afc_history.py @@ -130,7 +130,7 @@ class AFCHistory(Task): q_delete = "DELETE FROM page WHERE page_id = ?" q_update = "UPDATE page SET page_date = ?, page_status = ? WHERE page_id = ?" q_insert = "INSERT INTO page VALUES (?, ?, ?)" - members = category.get_members(use_sql=True) + members = category.get_members() with self.conn.cursor() as cursor: for title, pageid in members: diff --git a/earwigbot/tasks/afc_statistics.py b/earwigbot/tasks/afc_statistics.py index 69dd311..be6d95a 100644 --- a/earwigbot/tasks/afc_statistics.py +++ b/earwigbot/tasks/afc_statistics.py @@ -271,9 +271,7 @@ class AFCStatistics(Task): tracked = [i[0] for i in cursor.fetchall()] category = self.site.get_category(self.pending_cat) - pending = category.get_members(use_sql=True) - - for title, pageid in pending: + for title, pageid in category.get_members(): if title in self.ignore_list: continue if pageid not in tracked: diff --git a/earwigbot/wiki/page.py b/earwigbot/wiki/page.py index bebd355..d5a4cca 100644 --- a/earwigbot/wiki/page.py +++ b/earwigbot/wiki/page.py @@ -476,7 +476,7 @@ class Page(CopyrightMixIn): Makes an API query only if we haven't already made one and the *pageid* parameter to :py:meth:`__init__` was left as ``None``, which should be true for all cases except when pages are returned by an SQL generator - (like :py:meth:`category.get_members(use_sql=True) + (like :py:meth:`category.get_members() `). Raises :py:exc:`~earwigbot.exceptions.InvalidPageError` or