To keep tw2.core as minimal as possible, features needed only for development are in a separate package, tw2.devtools. The features in devtools are:
- Widget browser
- Widget library quick start
The browser essentially enumerates the tw2.widgets entrypoint. When browsing a module, it iterates through the public names in the module, and displays any that is a Widget subclass. It also imports samples.py for demo widgets. This can contain page_options - a dict that gives attributes for the body tag in the containing page.
The parameters that are displayed are: all the required parameters, plus non-required parameters that are defined on anything other than the Widget base class. Variables are never shown.
To create a widget library, issue:
$ paster create -t tw2.library tw2.mylib
This creates an empty template that gets you started.