This method retrieves the string-valued contents for a
given user ID, and returns those values as a UserRecord instance.
# - - - U s e r D a t a b a s e . _ _ g e t i t e m _ _
def __getitem__ ( self, userId ):
'''Return self[userId] as a UserRecord.
'''
#-- 1 --
# [ if self.__db has an entry for key (userId) ->
# rawValue := corresponding value
# else -> raise KeyError ]
rawValue = self.__db[userId]
The three values—chapter number, persistent flag, and expiration time—are separated by commas.
#-- 2 --
rawChapterNo, rawPersist, rawExpiration = rawValue.split(',')
#-- 3 --
return UserRecord ( userId, int(rawChapterNo),
int(rawPersist), int(rawExpiration) )