forked from mph-/lcapy-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makesvg.py
72 lines (44 loc) · 1.61 KB
/
makesvg.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
from lcapygui.ui.uimodelbase import UIModelBase
from lcapygui.components.sketch import Sketch
from lcapygui.components.cpt_maker import gcpt_make_from_type
def cpt_sketch_make(cpt, dstyle):
Sketch.create(cpt.sketch_key, cpt.sketch_net, dstyle)
def make1(thing, dstyle):
gcpt = gcpt_make_from_type(thing.cpt_type, kind=thing.kind)
print(gcpt.sketch_key, '\t', gcpt.sketch_net)
cpt_sketch_make(gcpt, dstyle)
if thing.kind:
# Don't make other connections; make_connections
# chooses which to make.
return
kinds = gcpt.kinds
styles = gcpt.styles
for kind in kinds:
if styles == {}:
gcpt = gcpt_make_from_type(thing.cpt_type, kind=kind)
print(gcpt.sketch_key, '\t', gcpt.sketch_net)
cpt_sketch_make(gcpt, dstyle)
else:
for style in styles:
gcpt = gcpt_make_from_type(
thing.cpt_type, kind=kind, style=style)
print(gcpt.sketch_key, '\t', gcpt.sketch_net)
cpt_sketch_make(gcpt, dstyle)
def make(thing):
if thing.cpt_type == 'DW':
return
for dstyle in ('american', 'british', 'european'):
make1(thing, dstyle)
def make_connections():
for thing in UIModelBase.connection_map.values():
make(thing)
def make_components():
for thing in UIModelBase.component_map.values():
make(thing)
def make_cpt(cpt_type):
make(UIModelBase.component_map[cpt_type])
def make_all():
make_connections()
make_components()
# make_all()
print('Do not forget to install for these changes to take affect.')