-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
46 lines (32 loc) · 949 Bytes
/
main.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
from FlatStack import Scene
import os, platform
def file_modified(filename):
if platform.system() == 'Windows':
return os.path.getmtime(filename)
else:
stat = os.stat(filename)
return stat.st_mtime
if __name__ == '__main__':
scene = Scene()
filename = 'cube.svg'
# scene.populate_db(filename)
scene.load_svg(filename)
# scene.apply()
#try:
# scene.parse_svg(filename)
#except:
# print('SVG Error')
modified = file_modified(filename)
while True:
scene.rate(100)
if file_modified(filename) > modified:
print('Modified! Reloading')
modified = file_modified(filename)
scene.clear()
try:
scene.load_svg(filename)
scene.populate_db(filename)
# scene.apply()
except Exception as e:
print(e)
print(str(e))