@@ -74,12 +74,13 @@ class AFCReport(Command): | |||||
return page | return page | ||||
def report(self, page): | def report(self, page): | ||||
url = page.url.replace("en.wikipedia.org/wiki", "enwp.org") | |||||
url = page.url.encode("utf8") | |||||
url = url.replace("en.wikipedia.org/wiki", "enwp.org") | |||||
short = self.statistics.get_short_title(page.title) | short = self.statistics.get_short_title(page.title) | ||||
status = self.get_status(page) | status = self.get_status(page) | ||||
user = page.get_creator() | user = page.get_creator() | ||||
user_name = user.name | user_name = user.name | ||||
user_url = user.get_talkpage().url | |||||
user_url = user.get_talkpage().url.encode("utf8") | |||||
msg1 = "AfC submission report for \x0302{0}\x0F ({1}):" | msg1 = "AfC submission report for \x0302{0}\x0F ({1}):" | ||||
msg2 = "Status: \x0303{0}\x0F" | msg2 = "Status: \x0303{0}\x0F" | ||||
@@ -54,6 +54,6 @@ class AFCSubmissions(Command): | |||||
site = self.bot.wiki.get_site() | site = self.bot.wiki.get_site() | ||||
category = site.get_category("Pending AfC submissions") | category = site.get_category("Pending AfC submissions") | ||||
members = category.get_members(limit=number + len(self.ignore_list)) | 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] | |||||
urls = [member.url.encode("utf8") for member in members if member.title not in self.ignore_list] | |||||
pages = ", ".join(urls[:number]) | pages = ", ".join(urls[:number]) | ||||
self.reply(data, "{0} pending AfC subs: {1}".format(number, pages)) | self.reply(data, "{0} pending AfC subs: {1}".format(number, pages)) |
@@ -35,15 +35,15 @@ class Link(Command): | |||||
if re.search("(\[\[(.*?)\]\])|(\{\{(.*?)\}\})", msg): | if re.search("(\[\[(.*?)\]\])|(\{\{(.*?)\}\})", msg): | ||||
links = self.parse_line(msg) | links = self.parse_line(msg) | ||||
links = " , ".join(links) | |||||
self.reply(data, links) | |||||
links = u" , ".join(links) | |||||
self.reply(data, links.encode("utf8")) | |||||
elif data.command == "link": | elif data.command == "link": | ||||
if not data.args: | if not data.args: | ||||
self.reply(data, "what do you want me to link to?") | self.reply(data, "what do you want me to link to?") | ||||
return | return | ||||
pagename = " ".join(data.args) | pagename = " ".join(data.args) | ||||
link = self.site.get_page(pagename).url | |||||
link = self.site.get_page(pagename).url.encode("utf8") | |||||
self.reply(data, link) | self.reply(data, link) | ||||
def parse_line(self, line): | def parse_line(self, line): | ||||
@@ -68,5 +68,4 @@ class Link(Command): | |||||
return results | return results | ||||
def parse_template(self, pagename): | def parse_template(self, pagename): | ||||
pagename = "".join(("Template:", pagename)) | |||||
return self.site.get_page(pagename).url | |||||
return self.site.get_page("Template:" + pagename).url |
@@ -269,7 +269,8 @@ class AFCStatistics(Task): | |||||
tracked = [i[0] for i in cursor.fetchall()] | tracked = [i[0] for i in cursor.fetchall()] | ||||
category = self.site.get_category(self.pending_cat) | category = self.site.get_category(self.pending_cat) | ||||
for title, pageid in category.get_members(): | |||||
for page in category.get_members(): | |||||
title, pageid = page.title, page.pageid | |||||
if title in self.ignore_list: | if title in self.ignore_list: | ||||
continue | continue | ||||
if pageid not in tracked: | if pageid not in tracked: | ||||
@@ -513,9 +513,9 @@ class Page(CopyvioMixIn): | |||||
return self._fullurl | return self._fullurl | ||||
else: | else: | ||||
encoded = self._title.encode("utf8").replace(" ", "_") | encoded = self._title.encode("utf8").replace(" ", "_") | ||||
slug = quote(encoded, safe="/:") | |||||
slug = quote(encoded, safe="/:").decode("utf8") | |||||
path = self.site._article_path.replace("$1", slug) | path = self.site._article_path.replace("$1", slug) | ||||
return ''.join((self.site.url, path)) | |||||
return u"".join((self.site.url, path)) | |||||
@property | @property | ||||
def namespace(self): | def namespace(self): | ||||