aboutsummaryrefslogtreecommitdiff
path: root/sgdfi/objects/adherentname.py
diff options
context:
space:
mode:
Diffstat (limited to 'sgdfi/objects/adherentname.py')
-rw-r--r--sgdfi/objects/adherentname.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/sgdfi/objects/adherentname.py b/sgdfi/objects/adherentname.py
index f15e812..206b570 100644
--- a/sgdfi/objects/adherentname.py
+++ b/sgdfi/objects/adherentname.py
@@ -36,10 +36,10 @@ class AdherentName:
__slots__ = ('_title', '_first', '_common', '_last')
- def __init__(self, title, first_name, last_name, common_name):
+ def __init__(self, value):
if value is None:
return None
- if isinstance(value, _Name):
+ if isinstance(value, AdherentName):
return value
if type(value) != str:
raise ValueError("a string, an AdherentName or None is required")
@@ -55,18 +55,18 @@ class AdherentName:
fst = value.pop(0)
title = fst.upper().replace('.', '')
if title == 'M':
- title = Title.MISTER
+ title = AdherentTitle.MISTER
elif title == 'MME':
- title = Title.MISS
+ title = AdherentTitle.MISS
else:
- title = Title.UNKNOWN
+ title = AdherentTitle.UNKNOWN
value.insert(0, fst)
common = ' '.join(value[:-1])
last = value[-1]
self._title = title
- self._first = first
+ self._first = fst
self._last = last
self._common = common
@@ -88,8 +88,8 @@ class AdherentName:
ops = []
titl = {
- Title.MISTER: "M.",
- Title.MISS: "Mme"
+ AdherentTitle.MISTER: "M.",
+ AdherentTitle.MISS: "Mme"
}.get(self._title, None)
if titl is not None: