/[ascend]/trunk/pygtk/blocklist.py
ViewVC logotype

Contents of /trunk/pygtk/blocklist.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1853 - (show annotations) (download) (as text)
Thu Sep 11 06:13:47 2008 UTC (15 years, 9 months ago) by jpye
File MIME type: text/x-python
File size: 1093 byte(s)
Fixed detection of Graphviz on linux where pkg-config is available (should be always).
This will break detection of Graphviz on Windows though.
1 import ascpy
2
3 L = ascpy.Library()
4
5 L.load('johnpye/rankine.a4c')
6
7 D = L.getAnnotationDatabase()
8
9 M = L.getModules()
10
11 blocktypes = set()
12
13 for m in M:
14 T = L.getModuleTypes(m)
15 for t in T:
16 N = D.getNotes(t)
17 for n in N:
18 i = str(n.getId())
19 x = str(n.getText())
20 print "%s [%s::%s] %s" % (n.getLanguage(), n.getType(), n.getId(), n.getText())
21 if x[0:3] == "in:" or x[0:4] == "out:":
22 blocktypes.add(t)
23
24 print "block types:"
25 if not blocktypes:
26 print "NONE FOUND"
27 for t in blocktypes:
28 print t.getName()
29
30 print "-----"
31
32 T = L.findType("pump_simple")
33 print D.getNoteForVariable(T,ascpy.SymChar("inlet"),ascpy.SymChar("inline"));
34
35 print "-----"
36 blocktypes = set()
37
38 for m in M:
39 T = L.getModuleTypes(m)
40 for t in T:
41 # 'block' types are only those which are parametric.
42 #if not t.hasParameters():
43 # continue
44 x = str(D.getNoteForVariable(t,ascpy.SymChar("inlet"),ascpy.SymChar("inline")))
45 if x[0:max(3,len(x))] == "in:" or x[0:max(4,len(x))] == "out:":
46 blocktypes.add(t)
47
48 print "block types:"
49 if not blocktypes:
50 print "NONE FOUND"
51 for t in blocktypes:
52 print t.getName()
53

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22