Example #1
0
 def prepare(self):
     todisk = Object()
     todisk.data = slice(self)
     todisk.saved_from = self.__class__.__module__
     todisk.type = self.__class__.__name__
     todisk.saved = self.saved = time.ctime(time.time())
     todisk.signature = signature(todisk.data)
     try: result = dumps(todisk, indent=4, ensure_ascii=False, sort_keys=True)
     except TypeError: raise NoJSON()
     return result
Example #2
0
    def json(self, *args, **kwargs): return dumps(self, *args, **kwargs)

    def load(self, path=""):