Har gjort en del ting.
This commit is contained in:
parent
46c6155b2b
commit
f274863148
|
@ -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`
|
||||
|
|
Reference in New Issue