5621: do not need babel dependency
svn: r19049
This commit is contained in:
parent
4010e20cdd
commit
c2849f8aa3
22
babel.cfg
22
babel.cfg
@ -1,22 +0,0 @@
|
|||||||
[python: src/**.py]
|
|
||||||
encoding = utf-8
|
|
||||||
|
|
||||||
[glade: src/**.glade.h]
|
|
||||||
encoding = utf-8
|
|
||||||
#extractor = babelglade.extractor
|
|
||||||
|
|
||||||
#[xml: data/**.desktop]
|
|
||||||
#encoding = utf-8
|
|
||||||
|
|
||||||
#[xml: data/**.keys]
|
|
||||||
#encoding = utf-8
|
|
||||||
|
|
||||||
[xml: **.xml.h]
|
|
||||||
encoding = utf-8
|
|
||||||
|
|
||||||
#[xml: src/**.xml]
|
|
||||||
#encoding = utf-8
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
16
setup.cfg
16
setup.cfg
@ -22,19 +22,3 @@ doc_files = README INSTALL COPYING NEWS FAQ TODO
|
|||||||
#dist-dir =
|
#dist-dir =
|
||||||
#install-script =
|
#install-script =
|
||||||
|
|
||||||
[extract_messages]
|
|
||||||
#keywords = _, N_, gettext, ngettext, sgettext
|
|
||||||
#mapping_file = babel.cfg
|
|
||||||
#width = 80
|
|
||||||
#output_file = po/messages.pot
|
|
||||||
#input-dirs = .
|
|
||||||
|
|
||||||
[update_catalog]
|
|
||||||
output_dir = po
|
|
||||||
input_file = po/messages.pot
|
|
||||||
|
|
||||||
[compile_catalog]
|
|
||||||
#domain = gramps
|
|
||||||
#directory = po
|
|
||||||
#output_file = $prefix/share/locale/lang/LC_MESSAGES/gramps.mo
|
|
||||||
|
|
||||||
|
101
setup.py
101
setup.py
@ -20,7 +20,6 @@ from distutils.cmd import Command
|
|||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
from distutils.command.build import build
|
from distutils.command.build import build
|
||||||
from distutils.command.install_data import install_data
|
from distutils.command.install_data import install_data
|
||||||
from babel.messages import frontend as babel
|
|
||||||
import sys
|
import sys
|
||||||
import glob
|
import glob
|
||||||
import os.path
|
import os.path
|
||||||
@ -66,7 +65,7 @@ def modules_check():
|
|||||||
mod_list = [#'metakit',
|
mod_list = [#'metakit',
|
||||||
('pygtk','gtk'),
|
('pygtk','gtk'),
|
||||||
('pycairo','cairo'),
|
('pycairo','cairo'),
|
||||||
'pygobject', 'babel',
|
'pygobject',
|
||||||
]
|
]
|
||||||
ok = 1
|
ok = 1
|
||||||
for m in mod_list:
|
for m in mod_list:
|
||||||
@ -105,7 +104,6 @@ def gramps():
|
|||||||
'GrampsLocale/*.py',
|
'GrampsLocale/*.py',
|
||||||
'GrampsLogger/*.py',
|
'GrampsLogger/*.py',
|
||||||
'Merge/*.py',
|
'Merge/*.py',
|
||||||
'Mime/*.py',
|
|
||||||
'Simple/*.py'],
|
'Simple/*.py'],
|
||||||
'gramps.cli': [
|
'gramps.cli': [
|
||||||
'*.py',
|
'*.py',
|
||||||
@ -156,15 +154,15 @@ def gramps():
|
|||||||
'*.py',
|
'*.py',
|
||||||
'*/*.py',
|
'*/*.py',
|
||||||
'lib/*.xml',
|
'lib/*.xml',
|
||||||
'lib/maps/*.py',
|
'lib/maps/*.py',
|
||||||
'webstuff/css/*.css',
|
|
||||||
'webstuff/images/*.svg',
|
|
||||||
'webstuff/images/*.png',
|
|
||||||
'webstuff/images/*.gif',
|
|
||||||
'*.glade',
|
'*.glade',
|
||||||
'*/*.glade'],
|
'*/*.glade'],
|
||||||
'gramps.webapp': [
|
'gramps.webapp': [
|
||||||
'*.py',
|
'*.py',
|
||||||
|
'webstuff/css/*.css',
|
||||||
|
'webstuff/images/*.svg',
|
||||||
|
'webstuff/images/*.png',
|
||||||
|
'webstuff/images/*.gif',
|
||||||
'grampsdb/fixtures/initial_data.json',
|
'grampsdb/fixtures/initial_data.json',
|
||||||
'*/*.py',
|
'*/*.py',
|
||||||
'sqlite.db',
|
'sqlite.db',
|
||||||
@ -239,7 +237,7 @@ def os_files():
|
|||||||
|
|
||||||
def glade():
|
def glade():
|
||||||
|
|
||||||
#POTFILES.in
|
#POTFILES.in / POTFILES.skip
|
||||||
files = [
|
files = [
|
||||||
'src/plugins/docgen/gtkprint.glade',
|
'src/plugins/docgen/gtkprint.glade',
|
||||||
'src/glade/editperson.glade',
|
'src/glade/editperson.glade',
|
||||||
@ -311,51 +309,64 @@ def glade():
|
|||||||
]
|
]
|
||||||
|
|
||||||
return files
|
return files
|
||||||
|
|
||||||
|
|
||||||
class CompileCatalog():
|
|
||||||
'''
|
|
||||||
Mixture between babel class and custom compilation
|
|
||||||
'''
|
|
||||||
|
|
||||||
user_options = [('domain=gramps', 'directory=po', 'fr.po', 'fr.mo')]
|
|
||||||
|
|
||||||
def initialize_options(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def finalize_options(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
class ExtractMessages(Command):
|
class ExtractMessages(Command):
|
||||||
'''
|
'''
|
||||||
Mixture between babel class and custom extraction
|
Custom extraction for gramps' files
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
# message_extractors = po/POTFILES.in
|
||||||
|
|
||||||
user_options = [('fake', None, 'Override')]
|
user_options = [('fake', None, 'Override')]
|
||||||
|
|
||||||
def initialize_options(self):
|
def initialize_options(self):
|
||||||
for f in glade():
|
for g in glade():
|
||||||
os.system('''intltool-extract --type=gettext/glade %s''' % f)
|
os.system('''intltool-extract --type=gettext/glade %s''' % g)
|
||||||
os.system('''intltool-extract --type=gettext/xml src/data/tips.xml.in''')
|
os.system('''intltool-extract --type=gettext/xml src/data/tips.xml.in''')
|
||||||
os.system('''intltool-extract --type=gettext/xml data/gramps.xml.in''')
|
os.system('''intltool-extract --type=gettext/xml data/gramps.xml.in''')
|
||||||
#os.system('''intltool-extract --type=gettext/text data/gramps.desktop.in''')
|
os.system('''intltool-extract --type=gettext/ini data/gramps.desktop.in''')
|
||||||
#os.system('''intltool-extract --type=gettext/text data/gramps.keys.in''')
|
os.system('''intltool-extract --type=gettext/keys data/gramps.keys.in''')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
#babel.extract_messages
|
# gramps
|
||||||
pass
|
for main in gramps()['gramps']:
|
||||||
|
os.system('''xgettext -j --language=Python --keyword=_ '''
|
||||||
def finalize_options(self):
|
'''--keyword=ngettext --keyword=sgettext '''
|
||||||
|
'''--from-code=UTF-8 -o "po/gramps.pot" '''
|
||||||
|
'''src/%s''' % main)
|
||||||
|
# gramps.cli
|
||||||
|
for cli in gramps()['gramps.cli']:
|
||||||
|
os.system('''xgettext -j --language=Python --keyword=_ '''
|
||||||
|
'''--keyword=ngettext --keyword=sgettext '''
|
||||||
|
'''--from-code=UTF-8 -o "po/gramps.pot" '''
|
||||||
|
'''src/cli/%s''' % cli)
|
||||||
|
# gramps.gen
|
||||||
|
for gen in gramps()['gramps.gen']:
|
||||||
|
os.system('''xgettext -j --language=Python --keyword=_ '''
|
||||||
|
'''--keyword=ngettext --keyword=sgettext '''
|
||||||
|
'''--from-code=UTF-8 -o "po/gramps.pot" '''
|
||||||
|
'''src/gen/%s''' % gen)
|
||||||
|
# gramps.gui
|
||||||
|
for gui in gramps()['gramps.gui']:
|
||||||
|
os.system('''xgettext -j --language=Python --keyword=_ '''
|
||||||
|
'''--keyword=ngettext --keyword=sgettext '''
|
||||||
|
'''--from-code=UTF-8 -o "po/gramps.pot" '''
|
||||||
|
'''src/gui/%s''' % gui)
|
||||||
|
# gramps.plugins
|
||||||
|
for plug in gramps()['gramps.plugins']:
|
||||||
|
os.system('''xgettext -j --language=Python --keyword=_ '''
|
||||||
|
'''--keyword=ngettext --keyword=sgettext '''
|
||||||
|
'''--from-code=UTF-8 -o "po/gramps.pot" '''
|
||||||
|
'''src/plugins/%s''' % plug)
|
||||||
|
# glade (gramps.glade + gramps.plugins - POTFILES.skip ???)
|
||||||
os.system('''xgettext -j --keyword=N_ --from-code=UTF-8'''
|
os.system('''xgettext -j --keyword=N_ --from-code=UTF-8'''
|
||||||
''' -o "po/gramps.pot" '''
|
''' -o "po/gramps.pot" '''
|
||||||
'''src/*/*.glade.h''')
|
'''src/*/*.glade.h src/*/*/*.glade */*.in.h */*/*.in.h''')
|
||||||
os.system('''xgettext -j --keyword=_ --keyword=N_'''
|
|
||||||
''' -o "po/gramps.pot" '''
|
def finalize_options (self):
|
||||||
'''*/*/*.xml.h''')
|
pass
|
||||||
|
|
||||||
|
|
||||||
def trans_files():
|
def trans_files():
|
||||||
'''
|
'''
|
||||||
@ -395,8 +406,6 @@ class BuildData(build):
|
|||||||
# /!\ should be gramps.sh with variables
|
# /!\ should be gramps.sh with variables
|
||||||
# missing const.py (const.py.in)
|
# missing const.py (const.py.in)
|
||||||
|
|
||||||
#CompileCatalog()
|
|
||||||
#babel.compile_catalog()
|
|
||||||
for po in glob.glob(os.path.join(PO_DIR, '*.po')):
|
for po in glob.glob(os.path.join(PO_DIR, '*.po')):
|
||||||
lang = os.path.basename(po[:-3])
|
lang = os.path.basename(po[:-3])
|
||||||
mo = os.path.join(MO_DIR, lang, 'gramps.mo')
|
mo = os.path.join(MO_DIR, lang, 'gramps.mo')
|
||||||
@ -540,13 +549,11 @@ 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', 'babel'],
|
requires = ['pygtk', 'pycairo', 'pygobject'],
|
||||||
cmdclass = {
|
cmdclass = {
|
||||||
'build': BuildData,
|
'build': BuildData,
|
||||||
'install': Install,
|
'install': InstallData, # override Install!
|
||||||
'install_data': InstallData,
|
#'install_data': InstallData,
|
||||||
'uninstall': Uninstall,
|
'uninstall': Uninstall,
|
||||||
'compile_catalog': babel.compile_catalog,
|
'extract_messages': ExtractMessages,}
|
||||||
'extract_messages': ExtractMessages,
|
|
||||||
'update_catalog': babel.update_catalog},
|
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user