Projects
/
mdb-ng
Archived
4
0
Fork 0

Har gjort en del ting.

This commit is contained in:
Øyvind Grønnesby 2005-05-26 21:09:08 +00:00
parent 46c6155b2b
commit f274863148
1 changed files with 5 additions and 3 deletions

View File

@ -55,7 +55,8 @@ class PVVDB:
self.base = base # base database directory self.base = base # base database directory
self.locks = [] # list of activated locks self.locks = [] # list of activated locks
self.rcs = rcs.RCS() # an RCS interface function 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): def __del__(self):
# clean up locks and such before being deleted. # clean up locks and such before being deleted.
@ -99,11 +100,12 @@ class PVVDB:
def load(self, username, lock=False): def load(self, username, lock=False):
# Read the record from the database. Will do an automatic lock # Read the record from the database. Will do an automatic lock
# if `lock' is True. # if `lock' is True.
if lock: rv = self.rcs.checkout(
self.lock(username) self.__filename(username), lock)
userfile = file(self.__filename(username)) userfile = file(self.__filename(username))
member = {} member = {}
for line in userfile: for line in userfile:
print line
key, value = line.strip().split(": ", 1) key, value = line.strip().split(": ", 1)
if not key in self.format: if not key in self.format:
raise PVVDBError, "%s not a legal attribute." % `key` raise PVVDBError, "%s not a legal attribute." % `key`