From: Kevin A. <ka...@us...> - 2005-12-29 20:48:51
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27312 Modified Files: documentation.py Log Message: changed spec to objspec Index: documentation.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/documentation.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** documentation.py 29 Dec 2005 20:36:25 -0000 1.1 --- documentation.py 29 Dec 2005 20:48:43 -0000 1.2 *************** *** 1,6 **** import inspect, os, time, inspect import wx ! from PythonCard import dialog, spec --- 1,13 ---- + """ + __version__ = "$Revision$" + __date__ = "$Date$" + """ + + # the start of some functions to help generate documentation for PythonCard + import inspect, os, time, inspect import wx ! from PythonCard import dialog *************** *** 23,34 **** return listX ! def getEventsList(spec): ! events = [e.name for e in spec.getEvents()] events.sort() return events ! def getMethodsList(object): listX = [] ! methods = inspect.getmembers(object, inspect.ismethod) for m in methods: if m[0][0] in "abcdefghijklmnopqrstuvwxyz": --- 30,41 ---- return listX ! def getEventsList(objspec): ! events = [e.name for e in objspec.getEvents()] events.sort() return events ! def getMethodsList(obj): listX = [] ! methods = inspect.getmembers(obj, inspect.ismethod) for m in methods: if m[0][0] in "abcdefghijklmnopqrstuvwxyz": *************** *** 36,39 **** --- 43,47 ---- return listX + def dumpDocs(self): result = dialog.directoryDialog(None, 'Create documention in:', '') *************** *** 46,50 **** w = self name = w.__class__.__name__ ! spec = w._spec doc = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">' --- 54,58 ---- w = self name = w.__class__.__name__ ! objspec = w._spec doc = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">' *************** *** 57,61 **** doc += '<table border="1">\n' doc += '<tr><td><b>Name<b></td><td><b>Default value</b></td></tr>\n' ! for a in getAttributesList(spec.getRequiredAttributes()): doc += "<tr><td>%s</td><td>%s</td></tr>\n" % (a[0], a[1]) doc += '</table>' --- 65,69 ---- doc += '<table border="1">\n' doc += '<tr><td><b>Name<b></td><td><b>Default value</b></td></tr>\n' ! for a in getAttributesList(objspec.getRequiredAttributes()): doc += "<tr><td>%s</td><td>%s</td></tr>\n" % (a[0], a[1]) doc += '</table>' *************** *** 64,68 **** doc += '<table border="1">\n' doc += '<tr><td><b>Name<b></td><td><b>Default value</b></td></tr>\n' ! for a in getAttributesList(spec.getOptionalAttributes()): doc += "<tr><td>%s</td><td>%s</td></tr>\n" % (a[0], a[1]) doc += '</table>' --- 72,76 ---- doc += '<table border="1">\n' doc += '<tr><td><b>Name<b></td><td><b>Default value</b></td></tr>\n' ! for a in getAttributesList(objspec.getOptionalAttributes()): doc += "<tr><td>%s</td><td>%s</td></tr>\n" % (a[0], a[1]) doc += '</table>' *************** *** 73,77 **** ## doc += '\n\n<h2>Events:</h2>\n' ## doc += '<table border="1">\n' ! ## for e in getEventsList(spec): ## doc += "<tr><td>%s</td></tr>\n" % e ## doc += '</table>' --- 81,85 ---- ## doc += '\n\n<h2>Events:</h2>\n' ## doc += '<table border="1">\n' ! ## for e in getEventsList(objspec): ## doc += "<tr><td>%s</td></tr>\n" % e ## doc += '</table>' *************** *** 125,129 **** # document each widget name = w.__class__.__name__ ! spec = w._spec doc = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">' --- 133,137 ---- # document each widget name = w.__class__.__name__ ! objspec = w._spec doc = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">' *************** *** 136,140 **** doc += '<table border="1">\n' doc += '<tr><td><b>Name<b></td><td><b>Default value</b></td></tr>\n' ! for a in getAttributesList(spec.getRequiredAttributes()): doc += "<tr><td>%s</td><td>%s</td></tr>\n" % (a[0], a[1]) doc += '</table>' --- 144,148 ---- doc += '<table border="1">\n' doc += '<tr><td><b>Name<b></td><td><b>Default value</b></td></tr>\n' ! for a in getAttributesList(objspec.getRequiredAttributes()): doc += "<tr><td>%s</td><td>%s</td></tr>\n" % (a[0], a[1]) doc += '</table>' *************** *** 143,147 **** doc += '<table border="1">\n' doc += '<tr><td><b>Name<b></td><td><b>Default value</b></td></tr>\n' ! for a in getAttributesList(spec.getOptionalAttributes()): doc += "<tr><td>%s</td><td>%s</td></tr>\n" % (a[0], a[1]) doc += '</table>' --- 151,155 ---- doc += '<table border="1">\n' doc += '<tr><td><b>Name<b></td><td><b>Default value</b></td></tr>\n' ! for a in getAttributesList(objspec.getOptionalAttributes()): doc += "<tr><td>%s</td><td>%s</td></tr>\n" % (a[0], a[1]) doc += '</table>' *************** *** 149,153 **** doc += '\n\n<h2>Events:</h2>\n' doc += '<table border="1">\n' ! for e in getEventsList(spec): doc += "<tr><td>%s</td></tr>\n" % e doc += '</table>' --- 157,161 ---- doc += '\n\n<h2>Events:</h2>\n' doc += '<table border="1">\n' ! for e in getEventsList(objspec): doc += "<tr><td>%s</td></tr>\n" % e doc += '</table>' |