Skip to content

Commit

Permalink
json2xml: Use new methods (#116)
Browse files Browse the repository at this point in the history
voc.tools.dict_to_schedule_xml() was removed in 74efa6d
(December 2018).
  • Loading branch information
jbeyerstedt authored Dec 13, 2023
1 parent e3bd7df commit 50bf387
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions schedule_json2xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os.path
import json
from collections import OrderedDict
import voc.tools
import voc.schedule

options, remainder = getopt.getopt(sys.argv[1:],
'i:o',
Expand All @@ -31,7 +31,8 @@

with open(input_file) as f:
schedule_json = f.read()
schedule = json.JSONDecoder(object_pairs_hook=OrderedDict).decode(schedule_json)
schedule_dict = json.JSONDecoder(object_pairs_hook=OrderedDict).decode(schedule_json)

with open(output_file, 'w') as f:
f.write(voc.tools.dict_to_schedule_xml(schedule))
schedule = voc.schedule.Schedule(json=schedule_dict)
f.write(schedule.xml())

0 comments on commit 50bf387

Please sign in to comment.