-
Notifications
You must be signed in to change notification settings - Fork 0
/
Car.py
43 lines (32 loc) · 1.09 KB
/
Car.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
import datetime
import Loggers
class Car:
def __init__(self, entry_time=datetime.datetime.now(), exit_time=None, ticket_number=0):
self.entry_time = entry_time
self.exit_time = exit_time
self.ticket_number = ticket_number
self.logger = Loggers.car_logger
self.logger.info("Car created with entry time {}, ticket number {}".format(self.entry_time, self.ticket_number))
@property
def get_entry_time(self):
return self.entry_time
@get_entry_time.setter
def set_entry_time(self, entry_time):
self.entry_time = entry_time
@property
def get_exit_time(self):
return self.exit_time
@set_entry_time.setter
def set_exit_time(self, exit_time):
self.exit_time = exit_time
@property
def get_ticket_number(self):
return self.ticket_number
@get_ticket_number.setter
def set_ticket_number(self, value):
self.ticket_number = value
if __name__ == '__main__':
car_test = Car()
print(car_test.ticket_number)
car_test.ticket_number = 5
print(car_test.ticket_number)