1 #!/usr/bin/env python 2 3 "Make the API documentation." 4 5 import pydoc 6 import os, sys 7 8 if __name__ == "__main__": 9 10 # The list of packages should coincide with that found in setup.py. 11 12 names = [ 13 "WebStack", "WebStack.__init__", 14 "WebStack.BaseHTTPRequestHandler", "WebStack.CGI", "WebStack.Generic", 15 "WebStack.JavaServlet", "WebStack.ModPython", "WebStack.Twisted", 16 "WebStack.Webware", 17 "WebStack.Adapters", "WebStack.Adapters.__init__", 18 "WebStack.Adapters.BaseHTTPRequestHandler", "WebStack.Adapters.CGI", 19 "WebStack.Adapters.Generic", "WebStack.Adapters.JavaServlet", 20 "WebStack.Adapters.ModPython", "WebStack.Adapters.Twisted", 21 "WebStack.Adapters.Webware", 22 "WebStack.Helpers", "WebStack.Helpers.__init__", 23 "WebStack.Helpers.Auth", "WebStack.Helpers.Environment", 24 "WebStack.Helpers.Request", "WebStack.Helpers.Response", 25 "WebStack.Resources", "WebStack.Resources.__init__", 26 "WebStack.Resources.Login", "WebStack.Resources.LoginRedirect" 27 ] 28 29 dirname = "apidocs" 30 31 # Set the PYTHONPATH to find the package. 32 33 sys.path.insert(0, os.getcwd()) 34 35 # Make the documentation directory if necessary. 36 37 if not os.path.exists(dirname): 38 print "Making", dirname 39 os.mkdir(dirname) 40 41 # Change into the directory - pydoc.writedoc depends on that. 42 43 os.chdir(dirname) 44 45 for name in names: 46 pydoc.writedoc(name, forceload=1) 47 48 # vim: tabstop=4 expandtab shiftwidth=4