22 lines
394 B
Python
22 lines
394 B
Python
|
|
import os
|
|
import json
|
|
|
|
|
|
class Loader:
|
|
|
|
def __init__(self):
|
|
self.PATH = "../jsonfiles/"
|
|
|
|
@staticmethod
|
|
def readGraph(filename):
|
|
f = open(filename, 'r')
|
|
graph = json.load(f)
|
|
f.close()
|
|
return graph
|
|
|
|
def dumpFile(self, filename, service):
|
|
f = open(self.PATH + filename, "w")
|
|
json.dump(service, f, indent=2)
|
|
f.close()
|