Clean up trailing whitespace.
This commit is contained in:
parent
15fcf1ed85
commit
28b722b92d
@ -24,7 +24,7 @@
|
|||||||
"""
|
"""
|
||||||
update_man.py for command line documentation.
|
update_man.py for command line documentation.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
python update_man.py -t
|
python update_man.py -t
|
||||||
|
|
||||||
Tests if 'sphinx' and 'python' are well configured.
|
Tests if 'sphinx' and 'python' are well configured.
|
||||||
@ -49,7 +49,7 @@ DATE = ''
|
|||||||
# You can set these variables from the command line.
|
# You can set these variables from the command line.
|
||||||
SPHINXBUILD = 'sphinx-build'
|
SPHINXBUILD = 'sphinx-build'
|
||||||
|
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
pythonCmd = os.path.join(sys.prefix, 'bin', 'python.exe')
|
pythonCmd = os.path.join(sys.prefix, 'bin', 'python.exe')
|
||||||
sphinxCmd = os.path.join(sys.prefix, 'bin', 'sphinx-build.exe')
|
sphinxCmd = os.path.join(sys.prefix, 'bin', 'sphinx-build.exe')
|
||||||
elif sys.platform in ['linux2', 'darwin', 'cygwin']:
|
elif sys.platform in ['linux2', 'darwin', 'cygwin']:
|
||||||
@ -70,13 +70,13 @@ def tests():
|
|||||||
os.system('''%(program)s -V''' % {'program': pythonCmd})
|
os.system('''%(program)s -V''' % {'program': pythonCmd})
|
||||||
except:
|
except:
|
||||||
print ('Please, install python')
|
print ('Please, install python')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print("\n=================='Sphinx-build'=============================\n")
|
print("\n=================='Sphinx-build'=============================\n")
|
||||||
os.system('''%(program)s''' % {'program': sphinxCmd})
|
os.system('''%(program)s''' % {'program': sphinxCmd})
|
||||||
except:
|
except:
|
||||||
print ('Please, install sphinx')
|
print ('Please, install sphinx')
|
||||||
|
|
||||||
if not DOCUTILS:
|
if not DOCUTILS:
|
||||||
print('\nNo docutils support, cannot use -m/--man and -o/--odt arguments.')
|
print('\nNo docutils support, cannot use -m/--man and -o/--odt arguments.')
|
||||||
|
|
||||||
@ -85,49 +85,49 @@ def main():
|
|||||||
The utility for handling documentation stuff.
|
The utility for handling documentation stuff.
|
||||||
What is need by Gramps, nothing more.
|
What is need by Gramps, nothing more.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
parser = ArgumentParser(
|
parser = ArgumentParser(
|
||||||
description='This program aims to handle documentation'
|
description='This program aims to handle documentation'
|
||||||
' and related translated versions.',
|
' and related translated versions.',
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_argument("-t", "--test",
|
parser.add_argument("-t", "--test",
|
||||||
action="store_true", dest="test", default=True,
|
action="store_true", dest="test", default=True,
|
||||||
help="test if 'python' and 'sphinx' are properly installed")
|
help="test if 'python' and 'sphinx' are properly installed")
|
||||||
|
|
||||||
parser.add_argument("-b", "--build",
|
parser.add_argument("-b", "--build",
|
||||||
action="store_true", dest="build", default=False,
|
action="store_true", dest="build", default=False,
|
||||||
help="build man documentation (via sphinx-build)")
|
help="build man documentation (via sphinx-build)")
|
||||||
|
|
||||||
parser.add_argument("-m", "--man",
|
parser.add_argument("-m", "--man",
|
||||||
action="store_true", dest="man", default=False,
|
action="store_true", dest="man", default=False,
|
||||||
help="build man documentation (via docutils)")
|
help="build man documentation (via docutils)")
|
||||||
|
|
||||||
parser.add_argument("-o", "--odt",
|
parser.add_argument("-o", "--odt",
|
||||||
action="store_true", dest="odt", default=False,
|
action="store_true", dest="odt", default=False,
|
||||||
help="build odt documentation (via docutils)")
|
help="build odt documentation (via docutils)")
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.test:
|
if args.test:
|
||||||
tests()
|
tests()
|
||||||
|
|
||||||
if args.build:
|
if args.build:
|
||||||
build()
|
build()
|
||||||
|
|
||||||
if args.man and DOCUTILS:
|
if args.man and DOCUTILS:
|
||||||
man()
|
man()
|
||||||
|
|
||||||
if args.odt and DOCUTILS:
|
if args.odt and DOCUTILS:
|
||||||
odt()
|
odt()
|
||||||
|
|
||||||
def build():
|
def build():
|
||||||
"""
|
"""
|
||||||
Build documentation.
|
Build documentation.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# testing stage
|
# testing stage
|
||||||
|
|
||||||
os.system('''%(program)s -b html . _build/html''' % {'program': sphinxCmd})
|
os.system('''%(program)s -b html . _build/html''' % {'program': sphinxCmd})
|
||||||
os.system('''%(program)s -b htmlhelp . _build/htmlhelp''' % {'program': sphinxCmd})
|
os.system('''%(program)s -b htmlhelp . _build/htmlhelp''' % {'program': sphinxCmd})
|
||||||
if DOCUTILS:
|
if DOCUTILS:
|
||||||
@ -136,48 +136,48 @@ def build():
|
|||||||
os.system('''%(program)s -b changes . _build/changes''' % {'program': sphinxCmd})
|
os.system('''%(program)s -b changes . _build/changes''' % {'program': sphinxCmd})
|
||||||
#os.system('''%(program)s -b linkcheck . _build/linkcheck''' % {'program': sphinxCmd})
|
#os.system('''%(program)s -b linkcheck . _build/linkcheck''' % {'program': sphinxCmd})
|
||||||
os.system('''%(program)s -b gettext . _build/gettext''' % {'program': sphinxCmd})
|
os.system('''%(program)s -b gettext . _build/gettext''' % {'program': sphinxCmd})
|
||||||
|
|
||||||
for lang in LANGUAGES:
|
for lang in LANGUAGES:
|
||||||
os.system('''%(program)s -b html -D language="%(lang)s" master_doc="%(lang)s" %(lang)s %(lang)s'''
|
os.system('''%(program)s -b html -D language="%(lang)s" master_doc="%(lang)s" %(lang)s %(lang)s'''
|
||||||
% {'lang': lang, 'program': sphinxCmd})
|
% {'lang': lang, 'program': sphinxCmd})
|
||||||
os.system('''%(program)s -b htmlhelp -D language="%(lang)s" master_doc="%(lang)s" %(lang)s %(lang)s'''
|
os.system('''%(program)s -b htmlhelp -D language="%(lang)s" master_doc="%(lang)s" %(lang)s %(lang)s'''
|
||||||
% {'lang': lang, 'program': sphinxCmd})
|
% {'lang': lang, 'program': sphinxCmd})
|
||||||
if DOCUTILS:
|
if DOCUTILS:
|
||||||
os.system('''%(program)s -b man %(lang)s %(lang)s'''
|
os.system('''%(program)s -b man %(lang)s %(lang)s'''
|
||||||
% {'lang': lang, 'program': sphinxCmd})
|
% {'lang': lang, 'program': sphinxCmd})
|
||||||
os.system('''%(program)s -b text -D language="%(lang)s" master_doc="%(lang)s" %(lang)s %(lang)s'''
|
os.system('''%(program)s -b text -D language="%(lang)s" master_doc="%(lang)s" %(lang)s %(lang)s'''
|
||||||
% {'lang': lang, 'program': sphinxCmd})
|
% {'lang': lang, 'program': sphinxCmd})
|
||||||
# for update/migration
|
# for update/migration
|
||||||
os.system('''%(program)s -b gettext -D language="%(lang)s" master_doc="%(lang)s" . _build/gettext/%(lang)s'''
|
os.system('''%(program)s -b gettext -D language="%(lang)s" master_doc="%(lang)s" . _build/gettext/%(lang)s'''
|
||||||
% {'lang': lang, 'program': sphinxCmd})
|
% {'lang': lang, 'program': sphinxCmd})
|
||||||
|
|
||||||
def man():
|
def man():
|
||||||
"""
|
"""
|
||||||
man file generation via docutils (python)
|
man file generation via docutils (python)
|
||||||
|
|
||||||
from docutils.core import publish_cmdline, default_description
|
from docutils.core import publish_cmdline, default_description
|
||||||
from docutils.writers import manpage
|
from docutils.writers import manpage
|
||||||
"""
|
"""
|
||||||
|
|
||||||
os.system('''rst2man en.rst gramps.1''')
|
os.system('''rst2man en.rst gramps.1''')
|
||||||
|
|
||||||
for lang in LANGUAGES:
|
for lang in LANGUAGES:
|
||||||
os.system('''rst2man %(lang)s/%(lang)s.rst -l %(lang)s %(lang)s/gramps.1'''
|
os.system('''rst2man %(lang)s/%(lang)s.rst -l %(lang)s %(lang)s/gramps.1'''
|
||||||
% {'lang': lang})
|
% {'lang': lang})
|
||||||
|
|
||||||
def odt():
|
def odt():
|
||||||
"""
|
"""
|
||||||
odt file generation via docutils (python)
|
odt file generation via docutils (python)
|
||||||
|
|
||||||
from docutils.core import publish_cmdline_to_binary, default_description
|
from docutils.core import publish_cmdline_to_binary, default_description
|
||||||
from docutils.writers.odf_odt import Writer, Reader
|
from docutils.writers.odf_odt import Writer, Reader
|
||||||
"""
|
"""
|
||||||
|
|
||||||
os.system('''rst2odt en.rst gramps.odt''')
|
os.system('''rst2odt en.rst gramps.odt''')
|
||||||
|
|
||||||
for lang in LANGUAGES:
|
for lang in LANGUAGES:
|
||||||
os.system('''rst2odt %(lang)s/%(lang)s.rst -l %(lang)s %(lang)s/gramps.odt'''
|
os.system('''rst2odt %(lang)s/%(lang)s.rst -l %(lang)s %(lang)s/gramps.odt'''
|
||||||
% {'lang': lang})
|
% {'lang': lang})
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
"""
|
"""
|
||||||
update_doc.py for Gramps API(s) documentation.
|
update_doc.py for Gramps API(s) documentation.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
python update_doc.py -t
|
python update_doc.py -t
|
||||||
|
|
||||||
Tests if 'sphinx' and 'python' are well configured.
|
Tests if 'sphinx' and 'python' are well configured.
|
||||||
@ -39,7 +39,7 @@ from argparse import ArgumentParser
|
|||||||
# You can set these variables from the command line.
|
# You can set these variables from the command line.
|
||||||
SPHINXBUILD = 'sphinx-build'
|
SPHINXBUILD = 'sphinx-build'
|
||||||
|
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
pythonCmd = os.path.join(sys.prefix, 'bin', 'python.exe')
|
pythonCmd = os.path.join(sys.prefix, 'bin', 'python.exe')
|
||||||
sphinxCmd = os.path.join(sys.prefix, 'bin', 'sphinx-build.exe')
|
sphinxCmd = os.path.join(sys.prefix, 'bin', 'sphinx-build.exe')
|
||||||
elif sys.platform in ['linux2', 'darwin', 'cygwin']:
|
elif sys.platform in ['linux2', 'darwin', 'cygwin']:
|
||||||
@ -60,7 +60,7 @@ def tests():
|
|||||||
os.system('''%(program)s -V''' % {'program': pythonCmd})
|
os.system('''%(program)s -V''' % {'program': pythonCmd})
|
||||||
except:
|
except:
|
||||||
print ('Please, install python')
|
print ('Please, install python')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print("\n=================='Shpinx-build'=============================\n")
|
print("\n=================='Shpinx-build'=============================\n")
|
||||||
os.system('''%(program)s''' % {'program': sphinxCmd})
|
os.system('''%(program)s''' % {'program': sphinxCmd})
|
||||||
@ -72,38 +72,38 @@ def main():
|
|||||||
The utility for handling documentation stuff.
|
The utility for handling documentation stuff.
|
||||||
What is need by Gramps, nothing more.
|
What is need by Gramps, nothing more.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
parser = ArgumentParser(
|
parser = ArgumentParser(
|
||||||
description='This program aims to handle manual'
|
description='This program aims to handle manual'
|
||||||
' and translated version.',
|
' and translated version.',
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_argument("-t", "--test",
|
parser.add_argument("-t", "--test",
|
||||||
action="store_true", dest="test", default=True,
|
action="store_true", dest="test", default=True,
|
||||||
help="test if 'python' and 'sphinx' are properly installed")
|
help="test if 'python' and 'sphinx' are properly installed")
|
||||||
|
|
||||||
parser.add_argument("-b", "--build",
|
parser.add_argument("-b", "--build",
|
||||||
action="store_true", dest="build", default=True,
|
action="store_true", dest="build", default=True,
|
||||||
help="build documentation")
|
help="build documentation")
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.test:
|
if args.test:
|
||||||
tests()
|
tests()
|
||||||
|
|
||||||
if args.build:
|
if args.build:
|
||||||
build()
|
build()
|
||||||
|
|
||||||
def build():
|
def build():
|
||||||
"""
|
"""
|
||||||
Build documentation.
|
Build documentation.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# testing stage
|
# testing stage
|
||||||
|
|
||||||
os.system('''%(program)s -b html . _build/html''' % {'program': sphinxCmd})
|
os.system('''%(program)s -b html . _build/html''' % {'program': sphinxCmd})
|
||||||
os.system('''%(program)s -b changes . _build/changes''' % {'program': sphinxCmd})
|
os.system('''%(program)s -b changes . _build/changes''' % {'program': sphinxCmd})
|
||||||
os.system('''%(program)s -b linkcheck . _build/linkcheck''' % {'program': sphinxCmd})
|
os.system('''%(program)s -b linkcheck . _build/linkcheck''' % {'program': sphinxCmd})
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# the Free Software Foundation; either version 2 of the License, or
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
@ -27,7 +27,7 @@ import unittest
|
|||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
from test import test_util
|
from test import test_util
|
||||||
test_util.path_append_parent()
|
test_util.path_append_parent()
|
||||||
|
|
||||||
def get_potfile(filename):
|
def get_potfile(filename):
|
||||||
with open(filename, "r") as fp:
|
with open(filename, "r") as fp:
|
||||||
@ -62,10 +62,10 @@ class TestPOT(unittest.TestCase):
|
|||||||
found = True
|
found = True
|
||||||
if found:
|
if found:
|
||||||
self.assertFalse(pathfile[3:] not in excluded_files and
|
self.assertFalse(pathfile[3:] not in excluded_files and
|
||||||
pathfile[3:] not in self.potfiles,
|
pathfile[3:] not in self.potfiles,
|
||||||
"'%s' is not in POTFILES.in" % (pathfile[3:],))
|
"'%s' is not in POTFILES.in" % (pathfile[3:],))
|
||||||
else:
|
else:
|
||||||
self.assertTrue(True, "'%s' doesn't contain '%s'" %
|
self.assertTrue(True, "'%s' doesn't contain '%s'" %
|
||||||
(file, search))
|
(file, search))
|
||||||
else:
|
else:
|
||||||
self.assertTrue(True, "'%s' doesn't exist" % file)
|
self.assertTrue(True, "'%s' doesn't exist" % file)
|
||||||
@ -88,7 +88,7 @@ class TestMake(unittest.TestCase):
|
|||||||
elif os.path.exists(makefile):
|
elif os.path.exists(makefile):
|
||||||
with open(makefile, "r") as fp:
|
with open(makefile, "r") as fp:
|
||||||
lines = fp.read()
|
lines = fp.read()
|
||||||
self.assertTrue(filename in lines, "'%s' not in %s/Makefile.in" %
|
self.assertTrue(filename in lines, "'%s' not in %s/Makefile.in" %
|
||||||
(filename, path))
|
(filename, path))
|
||||||
else:
|
else:
|
||||||
self.assertTrue(True, "no makefile in '%s'" % dir)
|
self.assertTrue(True, "no makefile in '%s'" % dir)
|
||||||
@ -109,7 +109,7 @@ class TestGetText(unittest.TestCase):
|
|||||||
found = False
|
found = False
|
||||||
for search in searches:
|
for search in searches:
|
||||||
found = (search in lines) or found
|
found = (search in lines) or found
|
||||||
self.assertTrue(found, "'%s' is in POTFILES.in but does not contain '%s'" %
|
self.assertTrue(found, "'%s' is in POTFILES.in but does not contain '%s'" %
|
||||||
(pofile, searches))
|
(pofile, searches))
|
||||||
|
|
||||||
class TestDups(unittest.TestCase):
|
class TestDups(unittest.TestCase):
|
||||||
@ -130,15 +130,15 @@ def suite1():
|
|||||||
Suite of tests designed to see if that if one of a set of phrases
|
Suite of tests designed to see if that if one of a set of phrases
|
||||||
is in a file, then that file better be in POTFILES.in.
|
is in a file, then that file better be in POTFILES.in.
|
||||||
"""
|
"""
|
||||||
suite = unittest.TestSuite()
|
suite = unittest.TestSuite()
|
||||||
for dir, subdir, files in os.walk('../../src'):
|
for dir, subdir, files in os.walk('../../src'):
|
||||||
for file in files:
|
for file in files:
|
||||||
if glob.fnmatch.fnmatch(file,"*.py"):
|
if glob.fnmatch.fnmatch(file,"*.py"):
|
||||||
suite.addTest(TestPOT('test_pot_py_%04d',
|
suite.addTest(TestPOT('test_pot_py_%04d',
|
||||||
dir, file, ["import gettext",
|
dir, file, ["import gettext",
|
||||||
"import sgettext"]))
|
"import sgettext"]))
|
||||||
elif glob.fnmatch.fnmatch(file,"*.glade"):
|
elif glob.fnmatch.fnmatch(file,"*.glade"):
|
||||||
suite.addTest(TestPOT('test_pot_glade_%04d',
|
suite.addTest(TestPOT('test_pot_glade_%04d',
|
||||||
dir, file, ["translatable=\"yes\""]))
|
dir, file, ["translatable=\"yes\""]))
|
||||||
if glob.fnmatch.fnmatch(file,"*.py"):
|
if glob.fnmatch.fnmatch(file,"*.py"):
|
||||||
suite.addTest(TestMake('test_make_py_%04d', dir, file))
|
suite.addTest(TestMake('test_make_py_%04d', dir, file))
|
||||||
@ -162,7 +162,7 @@ def suite2():
|
|||||||
continue
|
continue
|
||||||
if glob.fnmatch.fnmatch(potfile,"*.py"):
|
if glob.fnmatch.fnmatch(potfile,"*.py"):
|
||||||
suite.addTest(TestGetText('test_gettext_py_%04d', potfile,
|
suite.addTest(TestGetText('test_gettext_py_%04d', potfile,
|
||||||
["import gettext",
|
["import gettext",
|
||||||
"from gramps.gen.ggettext",
|
"from gramps.gen.ggettext",
|
||||||
"import sgettext"]))
|
"import sgettext"]))
|
||||||
elif glob.fnmatch.fnmatch(potfile,"*.glade"):
|
elif glob.fnmatch.fnmatch(potfile,"*.glade"):
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
"""
|
"""
|
||||||
update_po.py for Gramps translations.
|
update_po.py for Gramps translations.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
python update_po.py -t
|
python update_po.py -t
|
||||||
|
|
||||||
Tests if 'gettext' and 'python' are well configured.
|
Tests if 'gettext' and 'python' are well configured.
|
||||||
@ -291,7 +291,7 @@ def DesktopParse(filename):
|
|||||||
msgid "Genealogy System"
|
msgid "Genealogy System"
|
||||||
msgid "Gramps Genealogy System"
|
msgid "Gramps Genealogy System"
|
||||||
msgid ""
|
msgid ""
|
||||||
"Manage genealogical information,
|
"Manage genealogical information,
|
||||||
perform genealogical research and analysis"
|
perform genealogical research and analysis"
|
||||||
'''
|
'''
|
||||||
with open('../data/gramps.desktop.in.h', 'w') as desktop:
|
with open('../data/gramps.desktop.in.h', 'w') as desktop:
|
||||||
@ -375,7 +375,7 @@ def main():
|
|||||||
parser.add_argument("-c", "--clean",
|
parser.add_argument("-c", "--clean",
|
||||||
action="store_true", dest="clean", default=False,
|
action="store_true", dest="clean", default=False,
|
||||||
help="remove created files")
|
help="remove created files")
|
||||||
parser.add_argument("-p", "--pot",
|
parser.add_argument("-p", "--pot",
|
||||||
action="store_true", dest="catalog", default=False,
|
action="store_true", dest="catalog", default=False,
|
||||||
help="create a new catalog")
|
help="create a new catalog")
|
||||||
|
|
||||||
@ -691,7 +691,7 @@ def check(args):
|
|||||||
% {'lang.po': arg, 'txt': arg[:-3]})
|
% {'lang.po': arg, 'txt': arg[:-3]})
|
||||||
os.system('''%(python)s ./check_po -s %(lang.po)s > %(lang)s.txt''' \
|
os.system('''%(python)s ./check_po -s %(lang.po)s > %(lang)s.txt''' \
|
||||||
% {'python': pythonCmd, 'lang.po': arg, 'lang': arg[:-3]})
|
% {'python': pythonCmd, 'lang.po': arg, 'lang': arg[:-3]})
|
||||||
os.system('''%(msgfmt)s -c -v %(lang.po)s'''
|
os.system('''%(msgfmt)s -c -v %(lang.po)s'''
|
||||||
% {'msgfmt': msgfmtCmd, 'lang.po': arg})
|
% {'msgfmt': msgfmtCmd, 'lang.po': arg})
|
||||||
|
|
||||||
def untranslated(arg):
|
def untranslated(arg):
|
||||||
|
76
setup.py
76
setup.py
@ -80,8 +80,8 @@ def intltool_version():
|
|||||||
'''
|
'''
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
cmd = ["perl", "-e print qx(intltool-update --version) =~ m/(\d+.\d+.\d+)/;"]
|
cmd = ["perl", "-e print qx(intltool-update --version) =~ m/(\d+.\d+.\d+)/;"]
|
||||||
try:
|
try:
|
||||||
ver, ret = subprocess.Popen(cmd ,stdout=subprocess.PIPE,
|
ver, ret = subprocess.Popen(cmd ,stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE, shell=True).communicate()
|
stderr=subprocess.PIPE, shell=True).communicate()
|
||||||
ver = ver.decode("utf-8")
|
ver = ver.decode("utf-8")
|
||||||
if ver > "":
|
if ver > "":
|
||||||
@ -121,9 +121,9 @@ def build_trans(build_cmd):
|
|||||||
data_files = build_cmd.distribution.data_files
|
data_files = build_cmd.distribution.data_files
|
||||||
for lang in ALL_LINGUAS:
|
for lang in ALL_LINGUAS:
|
||||||
po_file = os.path.join('po', lang + '.po')
|
po_file = os.path.join('po', lang + '.po')
|
||||||
mo_file = os.path.join(build_cmd.build_base, 'mo', lang, 'LC_MESSAGES',
|
mo_file = os.path.join(build_cmd.build_base, 'mo', lang, 'LC_MESSAGES',
|
||||||
'gramps.mo')
|
'gramps.mo')
|
||||||
mo_file_unix = (build_cmd.build_base + '/mo/' + lang +
|
mo_file_unix = (build_cmd.build_base + '/mo/' + lang +
|
||||||
'/LC_MESSAGES/gramps.mo')
|
'/LC_MESSAGES/gramps.mo')
|
||||||
mo_dir = os.path.dirname(mo_file)
|
mo_dir = os.path.dirname(mo_file)
|
||||||
if not(os.path.isdir(mo_dir) or os.path.islink(mo_dir)):
|
if not(os.path.isdir(mo_dir) or os.path.islink(mo_dir)):
|
||||||
@ -225,20 +225,20 @@ def merge(in_file, out_file, option, po_dir='po', cache=True):
|
|||||||
if (not os.path.exists(out_file) and os.path.exists(in_file)):
|
if (not os.path.exists(out_file) and os.path.exists(in_file)):
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
cmd = (('set LC_ALL=C && perl -S intltool-merge %(opt)s %(po_dir)s %(in_file)s '
|
cmd = (('set LC_ALL=C && perl -S intltool-merge %(opt)s %(po_dir)s %(in_file)s '
|
||||||
'%(out_file)s') %
|
'%(out_file)s') %
|
||||||
{'opt' : option,
|
{'opt' : option,
|
||||||
'po_dir' : po_dir,
|
'po_dir' : po_dir,
|
||||||
'in_file' : in_file,
|
'in_file' : in_file,
|
||||||
'out_file' : out_file})
|
'out_file' : out_file})
|
||||||
else:
|
else:
|
||||||
cmd = (('LC_ALL=C intltool-merge %(opt)s %(po_dir)s %(in_file)s '
|
cmd = (('LC_ALL=C intltool-merge %(opt)s %(po_dir)s %(in_file)s '
|
||||||
'%(out_file)s') %
|
'%(out_file)s') %
|
||||||
{'opt' : option,
|
{'opt' : option,
|
||||||
'po_dir' : po_dir,
|
'po_dir' : po_dir,
|
||||||
'in_file' : in_file,
|
'in_file' : in_file,
|
||||||
'out_file' : out_file})
|
'out_file' : out_file})
|
||||||
if os.system(cmd) != 0:
|
if os.system(cmd) != 0:
|
||||||
msg = ('ERROR: %s was not merged into the translation files!\n' %
|
msg = ('ERROR: %s was not merged into the translation files!\n' %
|
||||||
out_file)
|
out_file)
|
||||||
raise SystemExit(msg)
|
raise SystemExit(msg)
|
||||||
|
|
||||||
@ -324,27 +324,27 @@ package_core = ['gramps',
|
|||||||
'gramps.gen.utils',
|
'gramps.gen.utils',
|
||||||
'gramps.gen.utils.docgen',
|
'gramps.gen.utils.docgen',
|
||||||
'gramps.test',
|
'gramps.test',
|
||||||
'gramps.plugins',
|
'gramps.plugins',
|
||||||
'gramps.plugins.database',
|
'gramps.plugins.database',
|
||||||
'gramps.plugins.database.bsddb_support',
|
'gramps.plugins.database.bsddb_support',
|
||||||
'gramps.plugins.database.dbapi_support',
|
'gramps.plugins.database.dbapi_support',
|
||||||
'gramps.plugins.database.dbapi_support.defaults',
|
'gramps.plugins.database.dbapi_support.defaults',
|
||||||
'gramps.plugins.docgen',
|
'gramps.plugins.docgen',
|
||||||
'gramps.plugins.drawreport',
|
'gramps.plugins.drawreport',
|
||||||
'gramps.plugins.export',
|
'gramps.plugins.export',
|
||||||
'gramps.plugins.gramplet',
|
'gramps.plugins.gramplet',
|
||||||
'gramps.plugins.graph',
|
'gramps.plugins.graph',
|
||||||
'gramps.plugins.importer',
|
'gramps.plugins.importer',
|
||||||
'gramps.plugins.lib',
|
'gramps.plugins.lib',
|
||||||
'gramps.plugins.lib.maps',
|
'gramps.plugins.lib.maps',
|
||||||
'gramps.plugins.mapservices',
|
'gramps.plugins.mapservices',
|
||||||
'gramps.plugins.quickview',
|
'gramps.plugins.quickview',
|
||||||
'gramps.plugins.rel',
|
'gramps.plugins.rel',
|
||||||
'gramps.plugins.sidebar',
|
'gramps.plugins.sidebar',
|
||||||
'gramps.plugins.textreport',
|
'gramps.plugins.textreport',
|
||||||
'gramps.plugins.tool',
|
'gramps.plugins.tool',
|
||||||
'gramps.plugins.view',
|
'gramps.plugins.view',
|
||||||
'gramps.plugins.webreport',
|
'gramps.plugins.webreport',
|
||||||
'gramps.plugins.webstuff',
|
'gramps.plugins.webstuff',
|
||||||
]
|
]
|
||||||
package_gui = ['gramps.gui',
|
package_gui = ['gramps.gui',
|
||||||
@ -377,7 +377,7 @@ package_data_core = []
|
|||||||
basedir = os.path.join('gramps', 'plugins')
|
basedir = os.path.join('gramps', 'plugins')
|
||||||
for (dirpath, dirnames, filenames) in os.walk(basedir):
|
for (dirpath, dirnames, filenames) in os.walk(basedir):
|
||||||
root, subdir = os.path.split(dirpath)
|
root, subdir = os.path.split(dirpath)
|
||||||
if subdir.startswith("."):
|
if subdir.startswith("."):
|
||||||
dirnames[:] = []
|
dirnames[:] = []
|
||||||
continue
|
continue
|
||||||
for dirname in dirnames:
|
for dirname in dirnames:
|
||||||
@ -450,20 +450,20 @@ data_files = data_files_core + data_files_gui
|
|||||||
# Setup
|
# Setup
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
setup(name = 'gramps',
|
setup(name = 'gramps',
|
||||||
description = ('Gramps (Genealogical Research and Analysis Management '
|
description = ('Gramps (Genealogical Research and Analysis Management '
|
||||||
'Programming System)'),
|
'Programming System)'),
|
||||||
long_description = ('Gramps (Genealogical Research and Analysis '
|
long_description = ('Gramps (Genealogical Research and Analysis '
|
||||||
'Management Programming System) is a full featured '
|
'Management Programming System) is a full featured '
|
||||||
'genealogy program supporting a Python based plugin '
|
'genealogy program supporting a Python based plugin '
|
||||||
'system.'),
|
'system.'),
|
||||||
version = VERSION,
|
version = VERSION,
|
||||||
author = 'Donald N. Allingham',
|
author = 'Donald N. Allingham',
|
||||||
author_email = 'don@gramps-project.org',
|
author_email = 'don@gramps-project.org',
|
||||||
maintainer = 'Gramps Development Team',
|
maintainer = 'Gramps Development Team',
|
||||||
maintainer_email = 'benny.malengier@gmail.com',
|
maintainer_email = 'benny.malengier@gmail.com',
|
||||||
url = 'http://gramps-project.org',
|
url = 'http://gramps-project.org',
|
||||||
license = 'GPL v2 or greater',
|
license = 'GPL v2 or greater',
|
||||||
platforms = ['FreeBSD', 'Linux', 'MacOS', 'Windows'],
|
platforms = ['FreeBSD', 'Linux', 'MacOS', 'Windows'],
|
||||||
cmdclass = {'build': build, 'install': install, 'test': test},
|
cmdclass = {'build': build, 'install': install, 'test': test},
|
||||||
packages = packages,
|
packages = packages,
|
||||||
|
@ -42,11 +42,11 @@ class GtkHandlerTest(unittest.TestCase):
|
|||||||
|
|
||||||
rh = RotateHandler(capacity=20)
|
rh = RotateHandler(capacity=20)
|
||||||
rh.setLevel(logging.DEBUG)
|
rh.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
gtkh = GtkHandler(rotate_handler=rh)
|
gtkh = GtkHandler(rotate_handler=rh)
|
||||||
gtkh.setLevel(logging.ERROR)
|
gtkh.setLevel(logging.ERROR)
|
||||||
|
|
||||||
l = logging.getLogger("GtkHandlerTest")
|
l = logging.getLogger("GtkHandlerTest")
|
||||||
l.setLevel(logging.DEBUG)
|
l.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
l.addHandler(rh)
|
l.addHandler(rh)
|
||||||
@ -65,7 +65,7 @@ class GtkHandlerTest(unittest.TestCase):
|
|||||||
Gtk.main_iteration()
|
Gtk.main_iteration()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def testSuite():
|
def testSuite():
|
||||||
suite = unittest.makeSuite(GtkHandlerTest,'test')
|
suite = unittest.makeSuite(GtkHandlerTest,'test')
|
||||||
return suite
|
return suite
|
||||||
|
@ -86,7 +86,7 @@ try:
|
|||||||
add_source( db,"A short test",True,False)
|
add_source( db,"A short test",True,False)
|
||||||
print "Add person 3"
|
print "Add person 3"
|
||||||
add_person( db,"Chris","Connor",True,False)
|
add_person( db,"Chris","Connor",True,False)
|
||||||
print_db_content( db)
|
print_db_content( db)
|
||||||
print "Closing Database file: %s" % filename1
|
print "Closing Database file: %s" % filename1
|
||||||
#db.close()
|
#db.close()
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ try:
|
|||||||
add_person( db,"Felix", "Fowler",True,False)
|
add_person( db,"Felix", "Fowler",True,False)
|
||||||
print "Add person 4"
|
print "Add person 4"
|
||||||
add_person( db,"Felix", "Fowler",False,False)
|
add_person( db,"Felix", "Fowler",False,False)
|
||||||
print_db_content( db)
|
print_db_content( db)
|
||||||
print "Closing Database file: %s" % filename1
|
print "Closing Database file: %s" % filename1
|
||||||
#db.close()
|
#db.close()
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ try:
|
|||||||
print "Add source 2 will fail"
|
print "Add source 2 will fail"
|
||||||
add_source( db,"Bang bang bang",True,True)
|
add_source( db,"Bang bang bang",True,True)
|
||||||
|
|
||||||
print_db_content( db)
|
print_db_content( db)
|
||||||
print "Closing Database file: %s" % filename2
|
print "Closing Database file: %s" % filename2
|
||||||
#db.close()
|
#db.close()
|
||||||
finally:
|
finally:
|
||||||
|
@ -25,7 +25,7 @@ Testing framework for performing a variety of unttests for GRAMPS.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
@ -39,9 +39,9 @@ def make_parser():
|
|||||||
usage = "usage: %prog [options]"
|
usage = "usage: %prog [options]"
|
||||||
parser = OptionParser(usage)
|
parser = OptionParser(usage)
|
||||||
parser.add_option("-v", "--verbosity", type="int", dest="verbose_level", default=0,
|
parser.add_option("-v", "--verbosity", type="int", dest="verbose_level", default=0,
|
||||||
help="Level of verboseness")
|
help="Level of verboseness")
|
||||||
parser.add_option("-p", "--performance", action="store_true", dest="performance", default=False,
|
parser.add_option("-p", "--performance", action="store_true", dest="performance", default=False,
|
||||||
help="Run the performance tests.")
|
help="Run the performance tests.")
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ def getTestSuites():
|
|||||||
# It just walks the filetree from '.' downwards and returns
|
# It just walks the filetree from '.' downwards and returns
|
||||||
# a tuple per directory of (dirpath,filelist) if the directory
|
# a tuple per directory of (dirpath,filelist) if the directory
|
||||||
# contains any test files.
|
# contains any test files.
|
||||||
|
|
||||||
paths = [(f[0],f[2]) for f in os.walk('.') \
|
paths = [(f[0],f[2]) for f in os.walk('.') \
|
||||||
if len ([i for i in f[2] \
|
if len ([i for i in f[2] \
|
||||||
if i[-8:] == "_Test.py"]) ]
|
if i[-8:] == "_Test.py"]) ]
|
||||||
@ -78,7 +78,7 @@ def allTheTests():
|
|||||||
|
|
||||||
def perfTests():
|
def perfTests():
|
||||||
return unittest.TestSuite(getTestSuites()[1])
|
return unittest.TestSuite(getTestSuites()[1])
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
console = logging.StreamHandler()
|
console = logging.StreamHandler()
|
||||||
console.setLevel(logging.INFO)
|
console.setLevel(logging.INFO)
|
||||||
@ -86,7 +86,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
logger = logging.getLogger('Gramps')
|
logger = logging.getLogger('Gramps')
|
||||||
logger.addHandler(console)
|
logger.addHandler(console)
|
||||||
|
|
||||||
(options,args) = make_parser().parse_args()
|
(options,args) = make_parser().parse_args()
|
||||||
|
|
||||||
if options.verbose_level == 1:
|
if options.verbose_level == 1:
|
||||||
|
Loading…
Reference in New Issue
Block a user