From a75b2d306a24747185e1b3bc7328043d4dec8cfb Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 6 Aug 2014 17:39:07 +0200 Subject: [PATCH] Add trick to ensure line endings are correct on Windows in the apixml2python.py script. --- tools/python/apixml2python.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/python/apixml2python.py b/tools/python/apixml2python.py index ee31c09c3..6dc59c95b 100755 --- a/tools/python/apixml2python.py +++ b/tools/python/apixml2python.py @@ -118,12 +118,20 @@ hand_written_functions = [ 'linphone_core_new_with_config' ] -def generate(apixmlfile, f): +def generate(apixmlfile, outputfile): tree = ET.parse(apixmlfile) renderer = pystache.Renderer() m = LinphoneModule(tree, blacklisted_classes, blacklisted_events, blacklisted_functions, hand_written_functions) os.chdir('apixml2python') + tmpfilename = outputfile.name + '.tmp' + f = open(tmpfilename, 'w') f.write(renderer.render(m)) + f.close() + f = open(tmpfilename, 'rU') + for line in f: + outputfile.write(line) + f.close() + os.unlink(tmpfilename) def main(argv = None):