“VTE策略、卡牌裁定和TWD搜索界面网站”,
codex-of-the-damned的Python项目详细描述
可恶的法典
这个网站是一个汇编吸血鬼:永恒的斗争战略资源。 该站点可在codex-of-the-damned.org公开。在
部分材料是Paradox Interactive AB的版权和商标, 并经许可使用。版权所有。 有关详细信息,请访问white-wolf.com。在
贡献
欢迎投稿。如果请求符合常规样式,则将合并请求。 问题将尽快得到解决。在
此网站使用Flask和{a4} 动态生成页面并处理国际化。在
安装
要安装站点的工作开发版本,请使用pip
:
python3 -m venv venv
pip install -e ".[dev]"
有一个make命令可以更新翻译:
^{pr2}$您可以使用codex
入口点运行站点的开发版本:
$ codex * Serving Flask app "codex_of_the_damned"(lazy loading) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
您可以设置DEBUG
环境变量以激活调试模式:
DEBUG=1 codex
要运行生产服务器,您需要一个像 uWSGI:
uwsgi --module codex_of_the_damned:app
或Gunicorn:
gunicorn codex_of_the_damned:app
有用的工具
图标
使用imagemagick
和potrace
将图标从光栅转换为SVG,
根据图标的不同,平滑效果可能更好或不更好:
convert -morphology Smooth Octagon:2 clan-ahrimanes.gif clan-ahrimanes.svg
谷歌翻译
使用python和Google Translate帮助翻译:
importpprintimportredefpre(s):print(re.sub(r"%\(([^\)]*)\)s",r"§KEEP\1§",s))defpre_list(it):forsinit:pre(s)defpost(s):s=pprint.pformat(re.sub(r"§KEEP([^§]*)§",r"%(\1)s",s),width=120)print(re.sub(r"(^')|('$)",'"',re.sub(r"^\s*","",s[1:-1],flags=re.MULTILINE),flags=re.MULTILINE).replace("\\n",""))# usage:# s = (# > copy paragraph to translate from the PO file# )# pre(s)# > Copy the result to Google Translate# t = """# > Copy translation# """# post(t)# > Copy result to the PO file and review it## pre_list can be used for multiple blocks in a list
- 项目
标签: