Browse Source

Uh, fix?

tags/v0.1^2
Ben Kurtovic 13 years ago
parent
commit
3614fb5f13
1 changed files with 9 additions and 5 deletions
  1. +9
    -5
      bot/tasks/afc_statistics.py

+ 9
- 5
bot/tasks/afc_statistics.py View File

@@ -425,12 +425,16 @@ class Task(BaseTask):
used in the task's code. used in the task's code.
""" """
query = "SELECT page_latest FROM page WHERE page_title = ? AND page_namespace = ?" query = "SELECT page_latest FROM page WHERE page_title = ? AND page_namespace = ?"
namespace, base = title.decode("utf8").split(":", 1)
try: 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)) result = self.site.sql_query(query, (base.replace(" ", "_"), ns))
revid = int(list(result)[0][0]) revid = int(list(result)[0][0])


Loading…
Cancel
Save