-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathguest.py
More file actions
29 lines (23 loc) · 778 Bytes
/
guest.py
File metadata and controls
29 lines (23 loc) · 778 Bytes
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
class Guest:
def __init__(self, name, surname, uuid, destination=None):
self.__name = name
self.__surname = surname
self.__uuid = uuid
self.__destination = destination
def get_uuid(self):
return self.__uuid
def add_destination(self, destination):
self.__destination = destination
def get_destination(self):
return self.__destination
@staticmethod
def get_guests():
file = open('guests.txt', 'r')
guests = []
while file.readable():
line = file.readline()
if len(line) < 4:
break
words = line.split(';')
guests.append(Guest(words[0], words[1], words[2], words[3][0:len(words[3])-1]))
return guests