yaml for persistence

2009-03-03 Thread Paul
class User(object): def __init__(self, uid): self.uid = uid self.__dict__.update(yaml.load(str('uid')+'.yaml')) def save(self): f=open(str(self.uid)+'.yaml') yaml.dump(self.__dict__, f) is there a better way to persist using Yaml Paul http://bidegg.com --

Re: yaml for persistence

2009-03-03 Thread Diez B. Roggisch
Paul schrieb: class User(object): def __init__(self, uid): self.uid = uid self.__dict__.update(yaml.load(str('uid')+'.yaml')) def save(self): f=open(str(self.uid)+'.yaml') yaml.dump(self.__dict__, f) is there a better way to persist using Yaml Paul http:

Re: yaml for persistence

2009-03-02 Thread Aaron Brady
On Mar 2, 8:19 pm, Paul wrote: > class User(object): >     def __init__(self, uid): >        self.uid = uid >        self.__dict__.update(yaml.load(str('uid')+'.yaml')) > >     def save(self): >         f=open(str(self.uid)+'.yaml') >         yaml.dump(self.__dict__, f) > > is there a better way t