-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildout.cfg
162 lines (147 loc) · 6.06 KB
/
buildout.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
[buildout]
extensions =
mr.developer
extends =
https://raw.github.com/collective/buildout.plonetest/master/test-4.3.x.cfg
https://raw.github.com/collective/buildout.plonetest/master/qa.cfg
versions-4.3.x.cfg
sources-dir = ${buildout:directory}/src
auto-checkout =
${canaimagnulinux:eggs}
show-picked-versions = true
package-name = canaimagnulinux.web.locales
eggs +=
Products.PDBDebugMode
aws.zope2zcmldoc
iw.debug
plone.reload
parts +=
checkversions
createcoverage
dependencychecker
precompile
i18ndude
i18nextract
i18ncheck
coverage-sh
[canaimagnulinux]
eggs =
canaimagnulinux.wizard
canaimagnulinux.userdata
locales-dir = ${buildout:sources-dir}/canaimagnulinux/web/locales/locales
[code-analysis]
directory = ${buildout:sources-dir}/canaimagnulinux/web/locales
pre-commit-hook = True
flake8-ignore = E501
clean-lines = True
deprecated-aliases = True
imports = True
flake8-max-complexity = 26
flake8-extensions =
# flake8-blind-except
flake8-coding
flake8-debugger
flake8-quotes
# pep8-naming
flake8-plone-api
[checkversions]
recipe = zc.recipe.egg
eggs = z3c.checkversions [buildout]
[dependencychecker]
recipe = zc.recipe.egg
eggs = z3c.dependencychecker
# You must have precompile to generate the '* .mo' for the tests. The '* .mo'
# are only generated when the instance goes up and to run the tests the instance
# is not raised.
# More options https://pypi.python.org/pypi/plone.recipe.precompiler
[precompile]
recipe = plone.recipe.precompiler
eggs = ${buildout:package-name}
compile-mo-files = true
[i18ndude]
recipe = zc.recipe.egg
eggs = i18ndude
[i18nextract]
recipe = collective.recipe.template
inline =
#!/bin/bash
set -x
domain=$1
localesdirectory="${canaimagnulinux:locales-dir}"
src="${buildout:sources-dir}/"
options=""
exclude=""
eggs="${canaimagnulinux:eggs}"
if [ "$domain" == "plone" ]; then
packages=$eggs
# exclude="rss_template.pt metadata_edit_form.cpt metadirectives.py Discussion_Item.xml event.py"
exclude="rss_template.pt"
fi
potfile=$localesdirectory/$domain.pot
potmanualfile=$localesdirectory/$domain-manual.pot
cd $src
${buildout:bin-directory}/i18ndude rebuild-pot --pot $potfile --create $domain \
--merge $potmanualfile $options --exclude="$exclude" $packages
# > rebuild-$domain-pot.log 2>&1
if [ ! -z "$fakedomain" ]; then
${buildout:bin-directory}/i18ndude filter $localesdirectory/$domain.pot $localesdirectory/../locales/$domain.pot > $localesdirectory/$domain.pot_
mv $localesdirectory/$domain.pot_ $localesdirectory/$domain.pot
fi
${buildout:bin-directory}/i18ndude sync --pot $potfile $localesdirectory/*/*/$domain.po
output = ${buildout:bin-directory}/i18nextract
mode = 755
[i18ncheck]
recipe = collective.recipe.template
inline =
#!/bin/sh
# This script allow to check templates for missing translations
# You can send the name of the template as parameter, without the path
# Examples:
#
# $ ./bin/i18ncheck canaimagnulinux.wizard
#
# $ ./bin/i18ncheck canaimagnulinux.wizard intro.pt
#
if test $1
then
if test $2
then
##find src -name $1 -exec bin/i18ndude find-untranslated {} \;
rm ${canaimagnulinux:locales-dir}/rebuild_i18n.log
WARNINGS=`find ${buildout:sources-dir}/$1 -name $2 | xargs ${buildout:bin-directory}/i18ndude find-untranslated | grep -e '^-WARN' | wc -l`
ERRORS=`find ${buildout:sources-dir}/$1 -name $2 | xargs ${buildout:bin-directory}/i18ndude find-untranslated | grep -e '^-ERROR' | wc -l`
FATAL=`find ${buildout:sources-dir}/$1 -name $2 | xargs ${buildout:bin-directory}/i18ndude find-untranslated | grep -e '^-FATAL' | wc -l`
echo
echo "There are $WARNINGS warnings \(possibly missing i18n markup\)"
echo "There are $ERRORS errors \(almost definitely missing i18n markup\)"
echo "There are $FATAL fatal errors \(template could not be parsed, eg. if it\'s not html\)"
echo "For more details, run \'find . -name \"\*pt\" \| xargs i18ndude find-untranslated\' or"
echo "Look the rebuild i18n log generate for this script called \'rebuild_i18n.log\' on locales dir"
touch ${canaimagnulinux:locales-dir}/rebuild_i18n.log
find ${buildout:sources-dir}/$1 -name $2 | xargs ${buildout:bin-directory}/i18ndude find-untranslated > ${canaimagnulinux:locales-dir}/rebuild_i18n.log
else
#find src -name '*.pt' -exec bin/i18ndude find-untranslated {} \;
rm ${canaimagnulinux:locales-dir}/rebuild_i18n.log
WARNINGS=`find ${buildout:sources-dir}/$1 -name "*pt" | xargs ${buildout:bin-directory}/i18ndude find-untranslated | grep -e '^-WARN' | wc -l`
ERRORS=`find ${buildout:sources-dir}/$1 -name "*pt" | xargs ${buildout:bin-directory}/i18ndude find-untranslated | grep -e '^-ERROR' | wc -l`
FATAL=`find ${buildout:sources-dir}/$1 -name "*pt" | xargs ${buildout:bin-directory}/i18ndude find-untranslated | grep -e '^-FATAL' | wc -l`
echo
echo "There are $WARNINGS warnings \(possibly missing i18n markup\)"
echo "There are $ERRORS errors \(almost definitely missing i18n markup\)"
echo "There are $FATAL fatal errors \(template could not be parsed, eg. if it\'s not html\)"
echo "For more details, run \'find . -name \"\*pt\" \| xargs i18ndude find-untranslated\' or"
echo "Look the rebuild i18n log generate for this script called \'rebuild_i18n.log\' on locales dir"
touch ${canaimagnulinux:locales-dir}/rebuild_i18n.log
find ${buildout:sources-dir}/$1 -name "*pt" | xargs ${buildout:bin-directory}/i18ndude find-untranslated > ${canaimagnulinux:locales-dir}/rebuild_i18n.log
fi
else
echo "No command-line arguments."
fi
output = ${buildout:bin-directory}/i18ncheck
mode = 755
[versions]
# use latest version of setuptools
setuptools =
[sources]
canaimagnulinux.wizard = git https://github.com/CanaimaGNULinux/canaimagnulinux.wizard.git
canaimagnulinux.userdata = git https://github.com/CanaimaGNULinux/canaimagnulinux.userdata.git