浏览代码

Limit short title lengths to 50 characters.

tags/v0.1^2
Ben Kurtovic 13 年前
父节点
当前提交
bafc660846
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. +4
    -1
      bot/tasks/afc_statistics.py

+ 4
- 1
bot/tasks/afc_statistics.py 查看文件

@@ -336,7 +336,10 @@ class Task(BaseTask):
return None, 0

def get_short_title(self, title):
return re.sub("Wikipedia(\s*talk)?\:Articles\sfor\screation\/", "", title)
short = re.sub("Wikipedia(\s*talk)?\:Articles\sfor\screation\/", "", title)
if len(short) > 50:
short = "".join((short[:47], "..."))
return short

def get_create(self, pageid):
query1 = "SELECT MIN(rev_id) FROM revision WHERE rev_page = ?"


正在加载...
取消
保存