15
15
# You should have received a copy of the GNU General Public License along with
16
16
# GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
18
from distribute_setup import use_setuptools
19
ez_setup.use_setuptools()
22
from string import Template
24
sys.path.insert(0, 'src')
27
from mailman.version import VERSION as __version__
24
28
from setuptools import setup, find_packages
25
from string import Template
27
if sys.hexversion < 0x20700f0:
28
print 'Mailman requires at least Python 2.7'
32
if sys.hexversion < 0x20600f0:
33
print 'Mailman requires at least Python 2.6'
32
# Calculate the version number without importing the mailman package.
33
with open('src/mailman/version.py') as fp:
35
mo = re.match("VERSION = '(?P<version>[^']+?)'", line)
37
__version__ = mo.group('version')
40
print 'No version number found'
45
38
# Ensure that all the .mo files are generated from the corresponding .po file.
46
39
# This procedure needs to be made sane, probably when the language packs are
47
40
# properly split out.
49
# Create the .mo files from the .po files. There may be errors and warnings
50
# here and that could cause the digester.txt test to fail.
51
## start_dir = os.path.dirname('src/mailman/messages')
52
## for dirpath, dirnames, filenames in os.walk(start_dir):
53
## for filename in filenames:
54
## po_file = os.path.join(dirpath, filename)
55
## basename, ext = os.path.splitext(po_file)
58
## mo_file = basename + '.mo'
59
## if (not os.path.exists(mo_file) or
60
## os.path.getmtime(po_file) > os.path.getmtime(mo_file)):
61
## # The mo file doesn't exist or is older than the po file.
62
## os.system('msgfmt -o %s %s' % (mo_file, po_file))
43
import mailman.commands
44
import mailman.messages
46
start_dir = os.path.dirname(mailman.messages.__file__)
47
for dirpath, dirnames, filenames in os.walk(start_dir):
48
for filename in filenames:
49
po_file = os.path.join(dirpath, filename)
50
basename, ext = os.path.splitext(po_file)
53
mo_file = basename + '.mo'
54
if (not os.path.exists(mo_file) or
55
os.path.getmtime(po_file) > os.path.getmtime(mo_file)):
56
# The mo file doesn't exist or is older than the po file.
57
os.system('msgfmt -o %s %s' % (mo_file, po_file))