Browse Source

A couple fixes and improvements.

tags/v0.1^2
Ben Kurtovic 12 years ago
parent
commit
0d1e5ebdc1
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      earwigbot/commands/langcode.py

+ 3
- 0
earwigbot/commands/langcode.py View File

@@ -38,11 +38,14 @@ class Langcode(Command):
code = data.args[0]
site = self.bot.wiki.get_site()
matrix = site.api_query(action="sitematrix")["sitematrix"]
del matrix["count"]
del matrix["specials"]

for site in matrix.itervalues():
if site["code"] == code:
name = site["name"]
if name != site["localname"]:
name += " ({0})".format(site["localname"])
sites = ", ".join([s["url"] for s in site["site"]])
msg = "\x0302{0}\x0301 is {1} ({2})".format(code, name, sites)
self.reply(data, msg)


Loading…
Cancel
Save