diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-03-02 20:01:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-03-02 20:01:10 +0000 |
commit | da875fcb62c801b8d19b3d4d984ad963574fb356 (patch) | |
tree | 3d85503747c56c2a387b291524442946f4bebb73 /examples/FTMLnorm.py | |
parent | Initial commit. (diff) | |
download | pysilfont-upstream.tar.xz pysilfont-upstream.zip |
Adding upstream version 1.6.0.upstream/1.6.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'examples/FTMLnorm.py')
-rw-r--r-- | examples/FTMLnorm.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/FTMLnorm.py b/examples/FTMLnorm.py new file mode 100644 index 0000000..638b2db --- /dev/null +++ b/examples/FTMLnorm.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python +'Normalize an FTML file' +__url__ = 'http://github.com/silnrsi/pysilfont' +__copyright__ = 'Copyright (c) 2016 SIL International (http://www.sil.org)' +__license__ = 'Released under the MIT License (http://opensource.org/licenses/MIT)' +__author__ = 'David Raymond' + +from silfont.core import execute +import silfont.ftml as ftml +from xml.etree import cElementTree as ET + +argspec = [ + ('infile',{'help': 'Input ftml file'}, {'type': 'infile'}), + ('outfile',{'help': 'Output ftml file', 'nargs': '?'}, {'type': 'outfile', 'def': '_new.xml'}), + ('-l','--log',{'help': 'Log file'}, {'type': 'outfile', 'def': '_ftmltest.log'}) + ] + +def doit(args) : + f = ftml.Fxml(args.infile) + f.save(args.outfile) + +def cmd() : execute("",doit,argspec) +if __name__ == "__main__": cmd()execute("", doit, argspec) + |