Skip to content
Snippets Groups Projects
Commit e970b927 authored by mschmit's avatar mschmit Committed by Adrien Béraud
Browse files

update python scripts to work with python3


Change-Id: I2364c9a8551295033c68e65d4f5c50fca34bef43
Reviewed-by: default avatarAdrien Béraud <adrien.beraud@savoirfairelinux.com>
parent 51c1ac89
No related branches found
No related tags found
No related merge requests found
......@@ -58,9 +58,9 @@ def render_to_template(defs, template_string):
if __name__ == "__main__":
try:
opts, args = getopt.getopt(sys.argv[1:], "i:o:t:m:p:", ["input=", "output=", "template=", "module=", "package="])
except getopt.GetoptError, err:
except getopt.GetoptError as err:
# print help information and exit:
print str(err) # will print something like "option -a not recognized"
print(str(err)) # will print something like "option -a not recognized"
sys.exit(2)
input_stream = None
output_file = None
......
......@@ -15,16 +15,16 @@ def rreplace(s, old, new, occurrence):
return new.join(li)
def usage():
print "jni-xml2cpp.py --file <file> | -i <file>"
print("jni-xml2cpp.py --file <file> | -i <file>")
# main
inputfile = "./dbus/callmanager-introspec.xml"
outputfile = "./dbus/callmanager-jni.h"
try:
opts, args = getopt.getopt(sys.argv[1:], "hi:o:", ["help", "input=", "output="])
except getopt.GetoptError, err:
except getopt.GetoptError as err:
usage()
print str(err)
print(str(err))
#print opts
sys.exit(2)
......@@ -37,11 +37,11 @@ for opt, arg in opts:
elif opt in ("-o", "--output"):
outputfile = arg
else:
print "error: argument not recognized"
print("error: argument not recognized")
sys.exit(3)
print "inputfile = %s" % (inputfile)
print "outputfile = %s" % (outputfile)
print("inputfile = %s" % (inputfile))
print("outputfile = %s" % (outputfile))
source = "".join(args)
# lxml.objectify
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment