-
Notifications
You must be signed in to change notification settings - Fork 3
Regression: storeToJsonFile and restoreFromJsonFile missing in JSONAble #22
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
restore functionality of 0.0.26 release
def storeToJsonFile(self,storeFilePrefix,tableName):
'''
store me with the given storeFilePrefix
Args:
storeFilePrefix(string): the prefix for the JSON file name
tableName(string): the name of the attribute for which to store the type information
'''
JSONAble.storeJsonToFile(self.toJSON(), "%s.json" % storeFilePrefix)
types=Types.forTable(self, tableName)
JSONAble.storeJsonToFile(types.toJSON(), "%s-types.json" % storeFilePrefix)
def restoreFromJsonFile(self,storeFilePrefix):
'''
restore me from the given storeFilePrefix
Args:
storeFilePrefix(string): the prefix for the JSON file name
'''
jsonStr=JSONAble.readJsonFromFile("%s.json" % storeFilePrefix)
typesJson=JSONAble.readJsonFromFile("%s-types.json" % storeFilePrefix)
types=Types(type(self).__name__)
types.fromJson(typesJson)
self.fromJson(jsonStr, types)take the Server Example:
class Server(JSONAble):
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working