/[ascend]/trunk/models/johnpye/extfn/extfntest.py
ViewVC logotype

Contents of /trunk/models/johnpye/extfn/extfntest.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 910 - (show annotations) (download) (as text)
Thu Oct 26 13:35:25 2006 UTC (13 years, 8 months ago) by johnpye
File MIME type: text/x-python
File size: 1117 byte(s)
In instantiate.c, made new blackbox code tolerant of blackboxes that don't need initialisation.
Removed some debug output.
Expanded 'extfntest.py' a little bit, for ease of testing.
Converted 'blackbox is experimental' warnings to one-time-only.
Minor change to way that webbrowser is invoked under linux.
1 #!/usr/bin/python
2 import platform
3 if platform.system() != "Windows":
4 import sys, re, dl
5 sys.setdlopenflags(dl.RTLD_GLOBAL|dl.RTLD_NOW)
6
7 import ascpy
8 L = ascpy.Library()
9
10 #--------------------------------
11 print "\n\n\n\nLOADING EXTERNAL TEST...\n\n\n"
12 L.load("johnpye/extfn/extfntest.a4c")
13
14 #--------------------------------
15 #print "\n\n\n\nLOADING INTERNAL TEST...\n\n\n"
16 #L.load("intfntest.a4c")
17
18 #--------------------------------
19 print "\n\n\n\nINSTANTIATING TEST...\n\n\n"
20 t = L.findType("extfntest")
21 #t = L.findType("intfntest")
22 sim = t.getSimulation("S")
23
24 print "\n--------------------------\n"
25
26 #--------------------------------
27 print "\n\n\n\nLISTING EXTERNAL METHODS...\n\n\n"
28 print chr(27)+"[31;1mEXTERNAL METHODS (!):"+chr(27)+"[0m"
29 ff = L.getExtMethods()
30 for f in ff:
31 fn = f.getName()
32
33 fh = f.getHelp()
34 if not fh:
35 fh = '[no help]'
36 else:
37 mlre = re.compile("\\n")
38 fh = re.sub(mlre,"\n ",fh)
39
40 print chr(27)+"[31;1m"+fn+chr(27)+"[31;2m: "+fh+chr(27)+"[0m"
41
42 #--------------------------------
43 print "\n\n\n\nBUILDING...\n\n\n"
44 sim.build()
45
46 sim.solve(ascpy.Solver('QRSlv'),ascpy.SolverReporter())

Properties

Name Value
svn:executable *

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