瀏覽代碼

Store site names escaped to get around MySQL 5.1 unicode limitation.

pull/24/head
Ben Kurtovic 12 年之前
父節點
當前提交
99f75be9ee
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. +2
    -2
      pages/copyvios.mako

+ 2
- 2
pages/copyvios.mako 查看文件

@@ -139,7 +139,7 @@
if time_since_update > max_staleness: if time_since_update > max_staleness:
update_sites(bot.wiki.get_site(), cursor) update_sites(bot.wiki.get_site(), cursor)
cursor.execute(query2) cursor.execute(query2)
langs = cursor.fetchall()
langs = [(code, name.decode("unicode_escape")) for (code, name) in cursor.fetchall()]
cursor.execute(query3) cursor.execute(query3)
projects = cursor.fetchall() projects = cursor.fetchall()
return langs, projects return langs, projects
@@ -165,7 +165,7 @@
this.add((project, project.capitalize())) this.add((project, project.capitalize()))
if this: if this:
code = site["code"] code = site["code"]
name = site["name"]
name = site["name"].encode("unicode_escape")
languages.add((code, u"{0} ({1})".format(code, name))) languages.add((code, u"{0} ({1})".format(code, name)))
projects |= this projects |= this
save_site_updates(cursor, languages, projects) save_site_updates(cursor, languages, projects)


Loading…
取消
儲存