forked from tdostilio/Race_Game
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathLiDAR.py
37 lines (32 loc) · 1.16 KB
/
LiDAR.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
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])
)