forked from x2ever/Autonomous-Car-Simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLiDAR.py
More file actions
28 lines (24 loc) · 984 Bytes
/
LiDAR.py
File metadata and controls
28 lines (24 loc) · 984 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
import inspect
import sys
import platform
from Authority import AuthorityExecption
class LiDAR:
def __init__(self):
self.__data = None
@property
def data(self):
return self.__data
@data.setter
def data(self, new_data):
if platform.system() == 'Windows':
if inspect.stack()[1][1].split('\\')[-1] == 'Game.py':
self.__data = new_data
else:
sys.tracebacklimit = 0
raise AuthorityExecption('Not allowed File %s is trying to change LiDAR.data at \'%s\'' % (inspect.stack()[1][1].split('\\')[-1], inspect.stack()[1][0]))
else:
if inspect.stack()[1][1].split('/')[-1] == 'Game.py':
self.__data = new_data
else:
sys.tracebacklimit = 0
raise AuthorityExecption('Not allowed File %s is trying to change LiDAR.data at \'%s\'' % (inspect.stack()[1][1].split('/')[-1], inspect.stack()[1][0]))