From f274863148b3ed2920b40a0e122f1e106dfc447e Mon Sep 17 00:00:00 2001 From: oyving Date: Thu, 26 May 2005 21:09:08 +0000 Subject: [PATCH] Har gjort en del ting. --- lib/mdb/db.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/mdb/db.py b/lib/mdb/db.py index c3575de..0afe187 100644 --- a/lib/mdb/db.py +++ b/lib/mdb/db.py @@ -55,7 +55,8 @@ class PVVDB: self.base = base # base database directory self.locks = [] # list of activated locks self.rcs = rcs.RCS() # an RCS interface function - self.format = self.__format(self.base) + self.format = self.__format( + os.path.join(self.base, ".format")) def __del__(self): # clean up locks and such before being deleted. @@ -99,11 +100,12 @@ class PVVDB: def load(self, username, lock=False): # Read the record from the database. Will do an automatic lock # if `lock' is True. - if lock: - self.lock(username) + rv = self.rcs.checkout( + self.__filename(username), lock) userfile = file(self.__filename(username)) member = {} for line in userfile: + print line key, value = line.strip().split(": ", 1) if not key in self.format: raise PVVDBError, "%s not a legal attribute." % `key`