测试“test”“测试”的自动回复
[gaetalk.git] / config.py
blobb228ef276b9ced9442ee758fd4e2e47adbcab3b5
1 #!/usr/bin/env python2
2 # vim:fileencoding=utf-8
4 import urllib
5 from google.appengine.api import urlfetch
7 # 时区
8 timezoneoffset = 8
9 # 默认的命令前缀
10 default_prefix = '-'
11 # 除了 Unicode 分类为“字母”的字符外,昵称里还允许哪些字符。注意即使指定空白
12 # 符昵称中也不能包含之
13 allowedSymbolInNick = u'+-_@.™'
14 # 是否允许多次更改昵称
15 nick_can_change = True
16 # 单位是字节。一个汉字为 3 字节
17 nick_maxlen = 16
18 # Gtalk 官方中文版使用非加密的协议。检测到 Gtalk 官方中文版用户时要不要提示之。
19 warnGtalk105 = True
20 # root 用户,请指定群主的 JID。
21 root = 'lilydjwg@gmail.com'
22 # 发统计报告邮件用
23 appid = 'lilydjwg'
25 # 离开时某些客户端自动发送的消息(全文)
26 blocked_away_messages = (
27 "I'm currently away and will reply as soon as I return to eBuddy on my iPod touch",
28 'This is an autoreply: I am currently not available. Please leave your message, and I will get back to you as soon as possible.',
31 def post_code(msg):
32 '''将代码贴到网站,返回 URL 地址 或者 None(失败)'''
33 form_data = urllib.urlencode({
34 'vimcn': msg.encode('utf-8'),
36 try:
37 result = urlfetch.fetch(url='http://p.vim-cn.com/',
38 payload=form_data,
39 method=urlfetch.POST,
40 headers={'Content-Type': 'application/x-www-form-urlencoded'})
41 return result.content.strip() + '/text' # 默认当作纯文本高亮
42 except urlfetch.DownloadError:
43 return