forked from CEFgoose/GEM5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshapes.py
93 lines (75 loc) · 3.05 KB
/
shapes.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import sys
import os
#---define resource path for compiled build
def resource_path(relative_path):
""" Get absolute path to resource, works for dev and for PyInstaller """
try:
# PyInstaller creates a temp folder and stores path in _MEIPASS
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
return os.path.join(base_path, relative_path)
#---shapes for editor table & settings previews
# CIRCLE=("static/shapes/circle.png")
# SQUARE=("static/shapes/square.png")
# TRIANGLE =("static/shapes/triangle.png")
# PENTAGON=("static/shapes/pentagon.png")
# HEXAGON =("static/shapes/hexagon.png")
# HEPTAGON=("static/shapes/heptagon.png")
# OCTAGON=("static/shapes/octagon.png")
# NONAGON =("static/shapes/nonagon.png")
# DECAGON=("static/shapes/decagon.png")
# #---sghapes for shape select widget buttons
# CIRCLEBUTTON=("static/shapes/circleButton.png")
# SQUAREBUTTON=("static/shapes/squareButton.png")
# TRIANGLEBUTTON =("static/shapes/triangleButton.png")
# PENTAGONBUTTON=("static/shapes/pentagonButton.png")
# HEXAGONBUTTON =("static/shapes/hexagonButton.png")
# HEPTAGONBUTTON=("static/shapes/heptagonButton.png")
# OCTAGONBUTTON=("static/shapes/octagonButton.png")
# NONAGONBUTTON =("static/shapes/nonagonButton.png")
# DECAGONBUTTON=("static/shapes/decagonButton.png")
#---resource paths for images for compiled build
CIRCLE = resource_path('circle.png')
SQUARE = resource_path('square.png')
TRIANGLE = resource_path('triangle.png')
PENTAGON = resource_path('pentagon.png')
HEXAGON = resource_path('hexagon.png')
HEPTAGON = resource_path('heptagon.png')
OCTAGON = resource_path('octagon.png')
NONAGON = resource_path('nonagon.png')
DECAGON = resource_path('decagon.png')
CIRCLEBUTTON = resource_path('circleButton.png')
SQUAREBUTTON = resource_path('squareButton.png')
TRIANGLEBUTTON = resource_path('triangleButton.png')
PENTAGONBUTTON = resource_path('pentagonButton.png')
HEXAGONBUTTON = resource_path('hexagonButton.png')
HEPTAGONBUTTON = resource_path('heptagonButton.png')
OCTAGONBUTTON = resource_path('octagonButton.png')
NONAGONBUTTON = resource_path('nonagonButton.png')
DECAGONBUTTON = resource_path('decagonButton.png')
VIEW_ICON=resource_path('viewing.png')
HIDDEN_ICON=resource_path('hidden.png')
GEM_ICON=resource_path('gem.png')
#---display shaped dictionary for easy assignment from shape name
allShapes={}
allShapes['circle']=CIRCLE
allShapes['triangle']=TRIANGLE
allShapes['square']=SQUARE
allShapes['pentagon']=PENTAGON
allShapes['hexagon']=HEXAGON
allShapes['heptagon']=HEPTAGON
allShapes['octagon']=OCTAGON
allShapes['nonagon']=NONAGON
allShapes['decagon']=DECAGON
#---button shapes dict for easy assignment from shape name
allButtonShapes={}
allButtonShapes['circle']=CIRCLEBUTTON
allButtonShapes['triangle']=TRIANGLEBUTTON
allButtonShapes['square']=SQUAREBUTTON
allButtonShapes['pentagon']=PENTAGONBUTTON
allButtonShapes['hexagon']=HEXAGONBUTTON
allButtonShapes['heptagon']=HEPTAGONBUTTON
allButtonShapes['octagon']=OCTAGONBUTTON
allButtonShapes['nonagon']=NONAGONBUTTON
allButtonShapes['decagon']=DECAGONBUTTON