5621: cleanup
svn: r19038
This commit is contained in:
parent
76a128bd1e
commit
9006235aa3
@ -34,11 +34,7 @@ output_dir = po
|
|||||||
input_file = po/messages.pot
|
input_file = po/messages.pot
|
||||||
|
|
||||||
[compile_catalog]
|
[compile_catalog]
|
||||||
domain = gramps
|
#domain = gramps
|
||||||
directory = po
|
#directory = po
|
||||||
#output_file = $prefix/share/locale/lang/LC_MESSAGES/gramps.mo
|
#output_file = $prefix/share/locale/lang/LC_MESSAGES/gramps.mo
|
||||||
|
|
||||||
[init_catalog]
|
|
||||||
domain = gramps
|
|
||||||
input_file = po/messages.pot
|
|
||||||
#output_dir = po
|
|
||||||
|
67
setup.py
67
setup.py
@ -53,7 +53,7 @@ def modules_check ():
|
|||||||
mod_list = [#'metakit',
|
mod_list = [#'metakit',
|
||||||
('pygtk','gtk'),
|
('pygtk','gtk'),
|
||||||
('pycairo','cairo'),
|
('pycairo','cairo'),
|
||||||
'pygobject'
|
'pygobject', 'babel',
|
||||||
]
|
]
|
||||||
ok = 1
|
ok = 1
|
||||||
for m in mod_list:
|
for m in mod_list:
|
||||||
@ -223,17 +223,19 @@ def os_files ():
|
|||||||
]
|
]
|
||||||
return files
|
return files
|
||||||
|
|
||||||
# compile_catalog class ?
|
|
||||||
def make_po ():
|
class compile_catalog():
|
||||||
for po in glob.glob(os.path.join(PO_DIR, '*.po')):
|
|
||||||
lang = os.path.basename(po[:-3])
|
def run (self):
|
||||||
mo = os.path.join(MO_DIR, lang, 'gramps.mo')
|
for po in glob.glob(os.path.join(PO_DIR, '*.po')):
|
||||||
directory = os.path.dirname(mo)
|
lang = os.path.basename(po[:-3])
|
||||||
if not os.path.exists(directory):
|
mo = os.path.join(MO_DIR, lang, 'gramps.mo')
|
||||||
os.makedirs(directory)
|
directory = os.path.dirname(mo)
|
||||||
if os.name == 'posix':
|
if not os.path.exists(directory):
|
||||||
os.system('msgfmt %s/%s.po -o %s' % (PO_DIR, lang, mo))
|
os.makedirs(directory)
|
||||||
print (directory)
|
if os.name == 'posix':
|
||||||
|
os.system('msgfmt %s/%s.po -o %s' % (PO_DIR, lang, mo))
|
||||||
|
print (directory)
|
||||||
|
|
||||||
def trans_files ():
|
def trans_files ():
|
||||||
translation_files = []
|
translation_files = []
|
||||||
@ -248,12 +250,9 @@ def trans_files ():
|
|||||||
return translation_files
|
return translation_files
|
||||||
|
|
||||||
class BuildData(build):
|
class BuildData(build):
|
||||||
def run (self):
|
|
||||||
|
def initialize_options (self):
|
||||||
# /!\ default install will overwrite files with admin rights on build directory
|
|
||||||
make_po ()
|
|
||||||
|
|
||||||
# /!\ default install will overwrite files with admin rights on build directory
|
|
||||||
if os.name == 'posix':
|
if os.name == 'posix':
|
||||||
# initial makefiles ... create launcher and generate const.py
|
# initial makefiles ... create launcher and generate const.py
|
||||||
# see script !
|
# see script !
|
||||||
@ -264,9 +263,26 @@ class BuildData(build):
|
|||||||
os.system('intltool-merge -x po/ data/gramps.xml.in data/gramps.xml')
|
os.system('intltool-merge -x po/ data/gramps.xml.in data/gramps.xml')
|
||||||
os.system('intltool-merge -k po/ data/gramps.keys.in data/gramps.keys')
|
os.system('intltool-merge -k po/ data/gramps.keys.in data/gramps.keys')
|
||||||
|
|
||||||
class InstallData(install_data):
|
|
||||||
def run (self):
|
def run (self):
|
||||||
|
|
||||||
|
# os.name == 'posix'
|
||||||
|
# Run upgrade pre script
|
||||||
|
# /!\ should be gramps.sh with variables
|
||||||
|
# missing const.py (const.py.in)
|
||||||
|
pass
|
||||||
|
|
||||||
|
def finalize_options (self):
|
||||||
|
|
||||||
|
compile_catalog()
|
||||||
|
|
||||||
|
class InstallData(install_data):
|
||||||
|
|
||||||
|
def run (self):
|
||||||
|
|
||||||
|
install_data.run(self)
|
||||||
|
|
||||||
|
def finalize_options (self):
|
||||||
|
|
||||||
if os.name == 'posix':
|
if os.name == 'posix':
|
||||||
#update the XDG Shared MIME-Info database cache
|
#update the XDG Shared MIME-Info database cache
|
||||||
sys.stdout.write('Updating the Shared MIME-Info database cache.\n')
|
sys.stdout.write('Updating the Shared MIME-Info database cache.\n')
|
||||||
@ -279,8 +295,8 @@ class InstallData(install_data):
|
|||||||
# update the XDG .desktop file database
|
# update the XDG .desktop file database
|
||||||
sys.stdout.write('Updating the .desktop file database.\n')
|
sys.stdout.write('Updating the .desktop file database.\n')
|
||||||
subprocess.call(["update-desktop-database"])
|
subprocess.call(["update-desktop-database"])
|
||||||
|
|
||||||
install_data.run(self)
|
#ldconfig
|
||||||
|
|
||||||
class Uninstall(Command):
|
class Uninstall(Command):
|
||||||
description = "Attempt an uninstall from an install log file"
|
description = "Attempt an uninstall from an install log file"
|
||||||
@ -342,12 +358,7 @@ if os.name == 'nt':
|
|||||||
elif os.name == 'darwin':
|
elif os.name == 'darwin':
|
||||||
script = [os.path.join('mac','launcher.sh')]
|
script = [os.path.join('mac','launcher.sh')]
|
||||||
else:
|
else:
|
||||||
# os.name == 'posix'
|
|
||||||
# Run upgrade pre script
|
|
||||||
# /!\ should be gramps.sh with variables
|
|
||||||
# /!\ default install will write file with admin rights on build directory
|
|
||||||
script = [os.path.join('gramps.sh')]
|
script = [os.path.join('gramps.sh')]
|
||||||
# ldconfig
|
|
||||||
|
|
||||||
if platform.system() == 'FreeBSD':
|
if platform.system() == 'FreeBSD':
|
||||||
man_dir = 'man'
|
man_dir = 'man'
|
||||||
@ -382,13 +393,13 @@ result = setup(
|
|||||||
data_files = trans_files () + os_files(),
|
data_files = trans_files () + os_files(),
|
||||||
platforms = ['Linux', 'FreeBSD', 'MacOS', 'Windows'],
|
platforms = ['Linux', 'FreeBSD', 'MacOS', 'Windows'],
|
||||||
scripts = script,
|
scripts = script,
|
||||||
requires = ['pygtk', 'pycairo', 'pygobject'],
|
requires = ['pygtk', 'pycairo', 'pygobject', 'babel'],
|
||||||
cmdclass = {
|
cmdclass = {
|
||||||
'build': BuildData,
|
'build': BuildData,
|
||||||
'install_data': InstallData,
|
'install_data': InstallData,
|
||||||
'uninstall': Uninstall,
|
'uninstall': Uninstall,
|
||||||
'compile_catalog': babel.compile_catalog,
|
# 'compile_catalog': babel.compile_catalog,
|
||||||
|
'compile_catalog': compile_catalog,
|
||||||
'extract_messages': babel.extract_messages,
|
'extract_messages': babel.extract_messages,
|
||||||
'init_catalog': babel.init_catalog,
|
|
||||||
'update_catalog': babel.update_catalog},
|
'update_catalog': babel.update_catalog},
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user