-
Notifications
You must be signed in to change notification settings - Fork 0
/
docstrings
24 lines (19 loc) · 942 Bytes
/
docstrings
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
def client_pattern_by_acronym(self, acronym):
"""Returns a client object, identified by client's acronym.
* Arguments:
- acronym: the acronym of the client looked for.
* Returns:
The first (and only) client object matching with the acronym,
since all clients_names have a different acronym.
The acronym uniqueness is ensured by the wxpython validators
enforced in .clients_names.ClientDialog.__init__
* Exceptions raised:
This function raises no exception since its caller knows
beforehand all the acronyms.
A KeyError might be interceptd in the future, if other callers
will be added.
"""
for client in self.client_patterns:
if client['acronym'] == acronym:
return client
# Placeholder for future: raise KeyError or a customised exception.