-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_family.py
49 lines (30 loc) · 1.71 KB
/
make_family.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from family import Family
from resources.seed_data import family_data, alpha_data
class MakeFamily(object):
def __init__(self):
self.make_family()
def make_family(self):
# add alpha king to family
Family().add_child_to_family("alpha", child=alpha_data[0]['name'], sex=alpha_data[0]['sex'],
mother=alpha_data[0]['mother'])
# # add alpha queen to the family
self.add_marriage_with_family_member(outsider_name=alpha_data[1]['name'],
outsider_sex=alpha_data[1]['sex'],
family_member=alpha_data[1]['partner'])
for i in family_data:
if i['mother']:
self.add_child(child_name=i["name"], sex=i["sex"], mother_name=i["mother"])
else:
self.add_marriage_with_family_member(outsider_name=i['name'],
outsider_sex=i['sex'],
family_member=i['partner'])
@staticmethod
def add_child(child_name: str, sex: str, mother_name: str, ):
Family().add_child_to_family(child=child_name, sex=sex, mother=mother_name)
@staticmethod
def add_marriage_with_family_member(outsider_name: str, outsider_sex: str, family_member: str):
family_member_instancec = Family().find_member_by_name(family_member)
if family_member_instancec:
Family().add_marriage_to_family(outside_member_name=outsider_name, outside_member_sex=outsider_sex,
family_member_instance=family_member_instancec)
# if __name__== "__main__": MakeFamily()