1
2
3
4 """
5 User map class.
6 """
7
10
12 """
13 I add parse methods to a dictionary to parse a username mapping string.
14 The string contains one entry per line.
15 Each line contains an old username and a new username, separated by
16 a colon.
17 """
19 i = -1
20 for line in text.strip().split('\n'):
21 i += 1
22 if line.startswith('#'):
23 continue
24 try:
25 old, new = line.split(':')
26 except ValueError:
27 raise UserMapException("Could not parse line %d (%s)" % (
28 i, line))
29 self.append((old, new))
30
34