Parcourir la source

Remove all use_sql from commands+tasks.

tags/v0.1^2
Ben Kurtovic il y a 12 ans
Parent
révision
f1ac019b3e
4 fichiers modifiés avec 4 ajouts et 7 suppressions
  1. +1
    -2
      earwigbot/commands/afc_submissions.py
  2. +1
    -1
      earwigbot/tasks/afc_history.py
  3. +1
    -3
      earwigbot/tasks/afc_statistics.py
  4. +1
    -1
      earwigbot/wiki/page.py

+ 1
- 2
earwigbot/commands/afc_submissions.py Voir le fichier

@@ -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))

+ 1
- 1
earwigbot/tasks/afc_history.py Voir le fichier

@@ -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:


+ 1
- 3
earwigbot/tasks/afc_statistics.py Voir le fichier

@@ -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:


+ 1
- 1
earwigbot/wiki/page.py Voir le fichier

@@ -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()
<earwigbot.wiki.category.Category.get_members>`).

Raises :py:exc:`~earwigbot.exceptions.InvalidPageError` or


Chargement…
Annuler
Enregistrer