a3a7a20c by Barry

Merge branch 'master' into 'master'

Update Print Statement

Updated Print statement to newer version of python which requires () around the statement.

See merge request !1
2 parents eafd74f1 03ad19d5
......@@ -38,8 +38,8 @@ parser.add_argument('-s', '--sourcexml', required=True, help="Source XML Directo
parser.add_argument('-o', '--outputdb', required=True, help="Destination SQLite Database")
args = parser.parse_args()
print "Source XML Directory: %s" % (args.sourcexml,)
print "Destination SQLite DB: %s" % (args.outputdb,)
print ("Source XML Directory: %s" % (args.sourcexml,))
print ("Destination SQLite DB: %s" % (args.outputdb,))
conn = sqlite3.connect(args.outputdb)
c = conn.cursor()
......@@ -49,13 +49,13 @@ for filename in os.listdir(args.sourcexml):
try:
fields = (', '.join('"' + item + '"' for item in field_list[filename]))
query = "CREATE TABLE \"%s\" (%s)" % (filename, fields)
print query
#print (query)
c.execute(query)
conn.commit()
except sqlite3.OperationalError:
pass
source_file = os.path.join(args.sourcexml, filename)
print "Parsing File: %s" % (source_file,)
print ("Parsing File: %s" % (source_file,))
doc = untangle.parse(source_file)
for item in doc.thing_list.thing:
row = []
......