【发布时间】:2016-03-08 07:25:33
【问题描述】:
考虑一个支持多语言的 python 包(使用gettext)。执行setup.py时如何将*.po文件即时编译为*.mo文件?我真的不想分发预编译的*.mo 文件。
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from distutils.core import setup
setup(
name='tractorbeam',
version='0.1.0',
url='http://starfleet.org/tractorbeam/',
description='Pull beer out of the fridge while sitting on the couch.',
author='James T. Kirk',
author_email= 'jkirk@starfleet.org',
packages=['tractorbeam'],
package_data={
'tractorbeam': [
'locale/*.po',
'locale/*.mo', # How to compile on the fly?
]
},
install_requires=[
'requests'
]
)
提前致谢!
【问题讨论】:
标签: python gettext distutils setup.py po