4
class FlatFileDatabase(object):
5
def __init__(self, text):
7
A database that can be read from a flat file. Mainly for testing. text
8
is the complete text inside the definition file.
11
for line in text.splitlines():
14
elems = line.split("\t")
15
self._users[elems[0]] = elems[1], elems[2]
17
def check_user(self, user, password):
18
if not user in self._users:
25
def user_exists(self, user):
26
return user in self._users