f4d17450 |
#
# Copyright (C) 2015 vmware inc.
#
# Author: Sharath George <sharathg@vmware.com>
import json |
dc0dfc30 |
import collections |
f4d17450 |
class JsonWrapper(object):
def __init__(self, filename):
self.filename = filename
def read(self): |
06555f96 |
with open(self.filename) as json_data:
self.data = json.load(json_data, object_pairs_hook=collections.OrderedDict) |
f4d17450 |
return self.data
def write(self, data):
self.data = data |
06555f96 |
with open(self.filename, 'wb') as outfile:
json.dump(data, outfile) |