/[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 692 - (show annotations) (download) (as text)
Thu Jun 22 02:45:47 2006 UTC (14 years, 5 months ago) by johnpye
File MIME type: text/x-python
File size: 1070 byte(s)
Fixed up behaviour of default ASCENDLIBRARY in python interface (for the case
where you're using ascpy without using the PyGTK GUI).
Removed some debug output when loading external libraries.
Fixed up the 'extfntest' example & SConscript file.
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("test_extfntest")
21 #t = L.findType("test_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()

Properties

Name Value
svn:executable *

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