2 # -*- coding: utf-8 -*-
4 #Created by Mika Bostrom, released into the public domain as far as legally possible.
6 #This program is distributed in the hope that it will be useful,
7 #but WITHOUT ANY WARRANTY; without even the implied warranty of
8 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 # Python packaging for fpdb
12 from distutils
.core
import setup
13 from distutils
.command
.install_data
import install_data
as INST
15 import glob
, string
, os
18 class inst_translations(INST
):
20 # Return triples for installations
21 def __locales(self
, rootdir
):
22 _globstr
= '%s/*/*/*.mo' % rootdir
23 paths
= glob
.glob(_globstr
)
26 rp
= string
.split(p
, '/', 2)
27 (lang
, loc
, mo
) = string
.split(rp
[2], '/')
28 _locales
.append( (lang
, loc
, mo
) )
32 locales
= self
.__locales
('pyfpdb/locale')
33 for (lang
, loc
, mo_file
) in locales
:
34 lang_dir
= os
.path
.join('share', 'locale', lang
, loc
)
35 lang_file
= os
.path
.join('pyfpdb/locale', lang
, loc
, mo_file
)
36 self
.data_files
.append( (lang_dir
, [lang_file
]) )
41 'install_data': inst_translations
45 description
= 'Free Poker Database',
48 author_email
= 'fpdb-main@lists.sourceforge.net',
50 package_dir
= { 'fpdb' : 'pyfpdb' },
53 ('/usr/share/pixmaps',
54 ['gfx/fpdb-icon.png', 'gfx/fpdb-icon2.png',
57 ('/usr/share/applications',
58 ['files/fpdb.desktop']),
59 ('/usr/share/python-fpdb',
60 ['pyfpdb/logging.conf', 'pyfpdb/Cards01.png',
61 'pyfpdb/HUD_config.xml.example'