#!/usr/bin/python # # Urwid reference documentation generation program # Copyright (C) 2004-2007 Ian Ward # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Urwid web site: http://excess.org/urwid/ import pydoc import urwid.curses_display import urwid.raw_display import urwid.web_display import urwid.html_fragment import urwid import types html_template = """
') for obj, name, flag in [ (None,"User interface wrappers",None), (urwid.raw_display.Screen, "raw_display.Screen",None), (urwid.curses_display.Screen, "curses_display.Screen",None), (urwid.web_display.Screen,"web_display.Screen",None), (None,"Top-level widgets",None), (urwid.Frame, "Frame", "B"), (urwid.Filler, "Filler", "B"), (urwid.ListBox, "ListBox", "B"), (None,"Decorations", None), (urwid.WidgetWrap, "WidgetWrap", "FB"), (urwid.AttrWrap, "AttrWrap", "FB"), (urwid.Padding, "Padding", "FB"), (urwid.Divider, "Divider", "F"), (urwid.LineBox, "LineBox", "FB"), (urwid.SolidFill, "SolidFill", "B"), (None,"Composite widgets", None), (urwid.Columns, "Columns", "FB"), (urwid.Pile, "Pile", "FB"), (urwid.GridFlow, "GridFlow", "F"), (urwid.BoxAdapter,"BoxAdapter", "F"), (urwid.Overlay,"Overlay", "B"), (None, None, None), (None,"Content widgets", None), (urwid.Text, "Text", "F"), (urwid.Edit, "Edit", "F"), (urwid.IntEdit, "IntEdit", "F"), (urwid.Button, "Button", "F"), (urwid.CheckBox, "CheckBox", "F"), (urwid.RadioButton, "RadioButton", "F"), (None, "Graphics",None), (urwid.BarGraph, "BarGraph","B"), (urwid.GraphVScale, "GraphVScale","B"), (urwid.ProgressBar, "ProgressBar","F"), (urwid.BigText, "BigText","X"), (urwid.get_all_fonts, "get_all_fonts",None), (None,"Abstract widgets & interfaces",None), (WidgetInterface, "Widget interface definition",None), (urwid.Widget, "Widget",None), (urwid.BoxWidget, "BoxWidget",None), (urwid.FlowWidget, "FlowWidget",None), (urwid.FixedWidget, "FixedWidget",None), (ListWalkerInterface, "List Walker interface definition",None), (urwid.ListWalker, "ListWalker", None), (None,"ListBox list walkers",None), (urwid.PollingListWalker, "PollingListWalker",None), (urwid.SimpleListWalker, "SimpleListWalker",None), (None, None, None), (None,"Canvas painting", None), (urwid.Canvas, "Canvas", None), (urwid.TextCanvas, "TextCanvas", None), (urwid.CompositeCanvas, "CompositeCanvas", None), (urwid.SolidCanvas, "SolidCanvas", None), (urwid.CanvasCombine, "CanvasCombine", None), (urwid.CanvasJoin, "CanvasJoin", None), (urwid.CanvasOverlay, "CanvasOverlay", None), (None,"Custom formatting rules", None), (urwid.TextLayout,"TextLayout", None), (urwid.StandardTextLayout,"StandardTextLayout", None), (None,"Character encoding", None), (urwid.set_encoding,"set_encoding", None), (urwid.get_encoding_mode,"get_encoding_mode", None), (urwid.supports_unicode,"supports_unicode", None), (None,"Screen capture", None), (urwid.html_fragment.screenshot_init, "html_fragment.screenshot_init", None), (urwid.html_fragment.screenshot_collect, "html_fragment.screenshot_collect", None), (urwid.html_fragment.HtmlGenerator, "html_fragment.HtmlGenerator", None), (None,"Web Application Interface", None), (urwid.web_display.is_web_request, "web_display.is_web_request", None), (urwid.web_display.set_preferences, "web_display.set_preferences", None), (urwid.web_display.handle_short_request, "web_display.handle_short_request", None), ]: if name is None: contents.append(' | ')
elif obj is None:
contents.append(' %s ' % name)
doc.append('%s' % name ) else: lname = name if type(obj) != types.ClassType: #dirty hack doc.append('function %s [back to top]' % (name,name) ) thtm = flagd[flag] lname = lname.replace(" ","_") contents.append('' +
'%s %s ' %
(lname,name,thtm) )
doc.append( html.document( obj, name ) )
contents.append(" |