From 6dfee80fff57e79c3b9b8db646a34f35cbc08219 Mon Sep 17 00:00:00 2001 From: oyving Date: Fri, 27 May 2005 15:13:16 +0000 Subject: [PATCH] Now how a working load function. A bit hackish since it now chdirs into the database directory. --- lib/mdb/db.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/mdb/db.py b/lib/mdb/db.py index 0afe187..2bc8ff2 100644 --- a/lib/mdb/db.py +++ b/lib/mdb/db.py @@ -100,12 +100,13 @@ class PVVDB: def load(self, username, lock=False): # Read the record from the database. Will do an automatic lock # if `lock' is True. - rv = self.rcs.checkout( - self.__filename(username), lock) - userfile = file(self.__filename(username)) + cwd = os.getcwd() + os.chdir(self.base) + rv = self.rcs.checkout(username + ",v") + userfile = file(username) + os.chdir(cwd) 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` @@ -121,7 +122,7 @@ class PVVDB: else: # we should not be here raise PVVDBError, "%s not legal datatype." % `self.format[key]` - member[key] = value + member[key] = v return PVVMember(member, self) def save(self, username, comment="", lock=False):