def saveSheet(fPath, json_dict): """ Saves the json data """ if not fileExists(fPath): raise exce.CreditSheetError('No such credit sheet') with open(fPath, 'w') as f: json_str = jh.dict_to_json(json_dict) f.write(json_str)
def newSheet(fPath, json_dict={INIT: timestamp()}): if fileExists(fPath): raise exce.CreditSheetExists('Credit sheet Exists') with open(fPath, 'w') as f: f.write(jh.dict_to_json(json_dict))