dabodoc Commit
Revision 24
Date: 2005-10-04 16:27:31 -0700 (Tue, 04 Oct 2005)
Author: paul

Changed:
U   trunk/api/makeDaboApiDoc.py
U   trunk/book/README
U   trunk/book/book-dist.py

Log:
Expanded information now prints at the bottom of the page for properties,
events, and methods.



Diff:
Modified: trunk/api/makeDaboApiDoc.py
===================================================================
--- trunk/api/makeDaboApiDoc.py 2005-10-04 21:25:39 UTC (rev 23)
+++ trunk/api/makeDaboApiDoc.py 2005-10-04 23:27:31 UTC (rev 24)
@@ -4,6 +4,7 @@
 import sys
 import dabo
 dabo.ui.loadUI("wx")
+import dabo.dEvents as dEvents
 from getDaboModules import getDaboClasses
 
 ## This is my new attempt at API documentation, which doesn't use epydoc and 
@@ -47,10 +48,10 @@
                                html += """     <tr>
 """
                        if definedHere:
-                               html += """             <td><b><a 
href="#prop_%(item)s">%(item)s</a></b></td>
+                               html += """             <td><b><a 
href="#%(name)s_%(item)s">%(item)s</a></b></td>
 """ % locals()
                        else:
-                                       html += """             <td><a 
href="#prop_%(item)s">%(item)s</a></td>
+                                       html += """             <td><a 
href="#%(name)s_%(item)s">%(item)s</a></td>
 """ % locals()
 
                html += """
@@ -59,16 +60,109 @@
 <hr>
 """
                return html
+
+
                
        # Property, Event, Method Listings:
-       html += getListing("Properties", cls.getPropertyList(refresh=True))
-       html += getListing("Events", cls.getEventList())
-       html += getListing("Methods", cls.getMethodList(refresh=True))
+       propList = cls.getPropertyList(refresh=True)
+       eventList = cls.getEventList()
+       methodList = cls.getMethodList(refresh=True)
 
+       html += getListing("Properties", propList)
+       html += getListing("Events", eventList)
+       html += getListing("Methods", methodList)
+
+       # Expanded entries - properties:
+       html += """
+<br><br><br>
+<h2>Properties</h2>
+<table border="0" width="100%" cellpadding="20" cellspacing="0">
+"""
+       for prop in propList:
+               d = cls.getPropertyInfo(prop)
+               if d["doc"] is None:
+                       d["doc"] = ""
+               d["doc"] = "<br>".join(d["doc"].split("\n"))
+
+               html += """
+       <tr>
+               <td valign="top">
+                       <b><a name="Properties_%(name)s">%(name)s</a></b><br>
+                       %(doc)s
+               </td>
+       </tr>
+""" % d
+       html += """
+</table>
+"""
+
+       # Expanded entries - events:
+       html += """
+<br><br><br>
+<h2>Events</h2>
+<table border="0" width="100%" cellpadding="20" cellspacing="0">
+"""
+       for event in eventList:
+               e = dEvents.__dict__[event]
+               d = {"name": event,
+                    "doc": e.__doc__}
+               if d["doc"] is None:
+                       d["doc"] = ""
+               d["doc"] = "<br>".join(d["doc"].split("\n"))
+
+               html += """
+       <tr>
+               <td valign="top">
+                       <b><a name="Events_%(name)s">%(name)s</a></b><br>
+                       %(doc)s
+               </td>
+       </tr>
+""" % d
+       html += """
+</table>
+"""
+
+       # Expanded entries - methods:
+       html += """
+<br><br><br>
+<h2>Methods</h2>
+<table border="0" width="100%" cellpadding="20" cellspacing="0">
+"""
+       for method in methodList:
+               m = None
+               for o in cls.__mro__:
+                       try:
+                               m = o.__dict__[method]
+                       except KeyError:
+                               continue
+                       break
+               if m is None:
+                       continue
+               d = {"name": method,
+                    "doc": m.__doc__}
+               if d["doc"] is None:
+                       d["doc"] = ""
+               d["doc"] = "<br>".join(d["doc"].split("\n"))
+
+               html += """
+       <tr>
+               <td valign="top">
+                       <b><a name="Methods_%(name)s">%(name)s()</a></b><br>
+                       %(doc)s
+               </td>
+       </tr>
+""" % d
+       html += """
+</table>
+"""
+
        return html
 
 if os.path.exists("./daboApiDoc"):
-       sys.exit("Please move existing ./daboApiDoc out of the way first.")
+       for f in os.listdir("./daboApiDoc"):
+               os.remove(os.path.join("./daboApiDoc", f))
+       os.rmdir("./daboApiDoc")        
+       #sys.exit("Please move existing ./daboApiDoc out of the way first.")
 
 os.mkdir("./daboApiDoc")
 os.chdir("./daboApiDoc")

Modified: trunk/book/README
===================================================================
--- trunk/book/README   2005-10-04 21:25:39 UTC (rev 23)
+++ trunk/book/README   2005-10-04 23:27:31 UTC (rev 24)
@@ -61,6 +61,7 @@
    The default build process expects to the stylesheets to be in
    tools/xsl/.
 
+   ## pkm: apt-get install docbook-xsl
 
 2. Use XSLT to transform the book.
 

Modified: trunk/book/book-dist.py
===================================================================
--- trunk/book/book-dist.py     2005-10-04 21:25:39 UTC (rev 23)
+++ trunk/book/book-dist.py     2005-10-04 23:27:31 UTC (rev 24)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python
 
 import sys
 import os
@@ -11,7 +11,7 @@
 cwd = os.getcwd()
 if not os.path.exists('book') \
    or not os.path.exists('Makefile'):
-  die('Please run this from the Subversion book source directory\n')
+  die('Please run this from the Dabo book source directory\n')
   
 if not os.getenv('JAVA_HOME'):
   die('JAVA_HOME is not set correctly.\n')
@@ -24,12 +24,12 @@
 os.system('DESTDIR=. make book-clean install-book-html ' + \
           'install-book-html-chunk install-book-pdf')
 
-tarball = os.path.join(cwd, 'svnbook.tar.gz')
+tarball = os.path.join(cwd, 'dabobook.tar.gz')
 
 try:
-  os.chdir('./usr/share/doc/subversion')
-  os.rename('book', 'svnbook')
-  os.system('tar cvfz ' + tarball + ' svnbook')
+  os.chdir('./usr/share/doc/dabo')
+  os.rename('book', 'dabobook')
+  os.system('tar cvfz ' + tarball + ' dabobook')
 finally:
   os.chdir(cwd)
   shutil.rmtree('./usr')
@@ -37,4 +37,4 @@
 if not os.path.exists(tarball):
   die('Hrm.  It appears the tarball was not created.\n')
 
-print 'Your tarball sits in ./svnbook.tar.gz.  Enjoy!'
+print 'Your tarball sits in ./dabobook.tar.gz.  Enjoy!'




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to