Si vous constatez la perte de tickets, de commentaires ou de projets, veuillez consulter la page https://status.framasoft.org/incident/626.

Commit 41721da6 authored by Julien Pivotto's avatar Julien Pivotto

Update PoX subproject management

Signed-off-by: Julien Pivotto's avatarJulien Pivotto <roidelapluie@inuits.eu>
parent 3dfae2a0
......@@ -2,8 +2,8 @@
"""lingvoj.py
Usage:
tox.py post-update <sourcedir> <template>
tox.py pre-commit <sourcedir> <template>
tox.py post-update <sourcedir> <filemask>
tox.py pre-commit <sourcedir> <filemask>
Options:
sourcedir: Path to the source directory
......@@ -37,7 +37,7 @@ class Pox:
_dirpath = '.'
for dirpath, _, filenames in os.walk('.'):
if not os.path.relpath('.', dirpath) == os.path.relpath('.', _dirpath):
logging.debug('%s != %s' % (dirpath, _dirpath))
logging.debug('%s != %s' % (os.path.relpath('.', dirpath), os.path.relpath('.', _dirpath)))
continue
logging.debug('Found potfiles in %s' % dirpath)
logging.debug('Pot in %s' % dirpath)
......@@ -98,7 +98,7 @@ class Pox:
_dirpath = '.'
for dirpath, _, filenames in os.walk('.'):
if not os.path.relpath('.', dirpath) == os.path.relpath('.', _dirpath):
logging.debug('%s != %s' % (dirpath, _dirpath))
logging.debug('%s != %s' % (os.path.relpath('.', dirpath), os.path.relpath('.', _dirpath)))
continue
if 'locale.pot' in filenames:
logging.debug('Pot in %s' % dirpath)
......@@ -201,7 +201,7 @@ class Pox:
def main():
arguments = docopt(__doc__, version='0.1')
srcdir = arguments['<sourcedir>']
srcdir = arguments['<filemask>']
filemask = arguments['<filemask>']
if arguments['pre-commit']:
exit(Pox(srcdir, filemask).precommit())
elif arguments['post-update']:
......
......@@ -13,7 +13,7 @@ do
echo
tmpdir="$(mktemp -d)"
cp -rv $i/input/ "$tmpdir"
./pox.py pre-commit "$tmpdir/input"
./pox.py pre-commit "$tmpdir/input" "*.po"
echo "Comparing $tmpdir/input and $i/output"
if diff -r "$tmpdir/input" "$i/output"
then
......@@ -26,7 +26,6 @@ do
done
for i in tests/e;
do
export WL_FILEMASK="*.pot"
name="$(basename $i)"
echo "-------------${name//?/-}"
echo "Running test $name"
......@@ -34,7 +33,7 @@ do
echo
tmpdir="$(mktemp -d)"
cp -rv $i/input/ "$tmpdir"
./pox.py post-update "$tmpdir/input"
./pox.py post-update "$tmpdir/input" "*.po"
echo "Comparing $tmpdir/input and $i/output"
if diff -I Language:.fr -I POT-Creation-Date -ur "$tmpdir/input" "$i/output"
then
......
<html>
<head>
<title>Ceci est un test</title>
</head>
<body>
<p>Ceci est un test du projet ToX</p>
<p>Ceci aussi.</p>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment