/[ascend]/trunk/models/johnpye/listnotes.py
ViewVC logotype

Annotation of /trunk/models/johnpye/listnotes.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 897 - (hide annotations) (download) (as text)
Tue Oct 24 11:05:18 2006 UTC (15 years, 9 months ago) by johnpye
File MIME type: text/x-python
File size: 542 byte(s)
Adding 'NOTES' support to C++ interface. 'johnpye/thermalequilibrium2.a4c' is the example case.
listnotes.py performs listing via a python external script method.
annotation.h and annotation.cpp implement the C++ wrapper referenced by SWIG.
library.{h,cpp} modified to provide access to the AnnotationDatabase.
Typemapping modified in ascpy.i in attempt to get a more maintainable wrapping.
Added annotation.cpp to build.
Updated copyright header and formatting of notate.{c,h}.
Improved ErrMsg_BracesEOF error message fn.
Updated copyright header and formatting of braced.{c,h}
Some misc debug output removed esp in simulation.cpp, conopt.c, importhandler.c.

1 johnpye 897 import ascpy
2     import extpy
3     browser = extpy.getbrowser()
4    
5     def listnotes(self):
6     """ make a list of NOTES for the present model """
7     self = ascpy.Registry().getInstance('context')
8    
9     db = browser.library.getAnnotationDatabase()
10     notes = db.getNotes(self.getType())
11    
12     for i in range(1,len(notes)):
13     mm = notes[i].getMethod()
14     ii = notes[i].getId()
15     tt = notes[i].getText()
16     s = "type = %s, method = %s, id = %s, text = %s" % (notes[i].getType(), mm, ii, tt)
17     print "NOTES:",s
18     browser.reporter.reportNote(s)
19    
20     extpy.registermethod(listnotes)

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