You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defstoreToJsonFile(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)
defrestoreFromJsonFile(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):
The text was updated successfully, but these errors were encountered:
restore functionality of 0.0.26 release
take the Server Example:
The text was updated successfully, but these errors were encountered: