Bladeren bron

Uh, fix?

tags/v0.1^2
Ben Kurtovic 13 jaren geleden
bovenliggende
commit
3614fb5f13
1 gewijzigde bestanden met toevoegingen van 9 en 5 verwijderingen
  1. +9
    -5
      bot/tasks/afc_statistics.py

+ 9
- 5
bot/tasks/afc_statistics.py Bestand weergeven

@@ -425,12 +425,16 @@ class Task(BaseTask):
used in the task's code.
"""
query = "SELECT page_latest FROM page WHERE page_title = ? AND page_namespace = ?"
namespace, base = title.decode("utf8").split(":", 1)
try:
ns = self.site.namespace_name_to_id(namespace)
except wiki.NamespaceNotFoundError:
base = title
ns = wiki.NS_MAIN
namespace, base = title.decode("utf8").split(":", 1)
except ValueError:
base = title.decode("utf8")
else:
try:
ns = self.site.namespace_name_to_id(namespace)
except wiki.NamespaceNotFoundError:
base = title.decode("utf8")
ns = wiki.NS_MAIN

result = self.site.sql_query(query, (base.replace(" ", "_"), ns))
revid = int(list(result)[0][0])


Laden…
Annuleren
Opslaan