Table Of Contents

Previous topic

Profiling Your App

Next topic

Command Line Reference


Status:Work in progress


A platform to share gadgets which helps the development.

Developer could release their own gadgets on pypi. The gadgets will be auto-plugged into the TurboGears 2 toolbox through setuptools.

ToolBox itself is a TurboGears 2 Application. Developers could use the same skills to develop a toolbox gadget as they do to createa a TurboGears 2 application.


  • Gadget: The application working within toolbox. Some of them may allow you to embed them into your application.


  • Provide ‘paster toolbox’ command to start.
  • Provide a Gadget skeleton generator by paste script (not implement yet)
  • You could release your own gadgets on pypi.
  • Could detect if toolbox runs inside a project.
  • Able to select icons from Tango Icon

Basic Gadgets

ToolBox 2 Basic Gadgets are a minimum set of gadgets to provide some basic functions.

  • TGInfo gadget: browse tg2 related packages, similar to ‘paster tginfo’ command
  • TurboGears 2 API gadget: browse tg2 API
  • ToolBox 2 API gadget: browse ToolBox2 API
  • Design gadget (Project Browser), update from ToolBox template browser gadget.
  • Admin gadget (the successor to catwalk) from dbsprockets module


  • Setuptool-based plugin system

You could define gadget hooker in


- To specify the Gadget should be worked in a TurboGears 2 project,
  you could define attribute in Gadget::

 need_project = True

Write A Simple Gadget

Create a folder containing 2 files:


from setuptools import setup, find_packages

  description='TurboGears2 Toolbox Gadget',
  author='Fred Lin',
  hello = gadget:HelloGadget


from toolbox2.lib.base import Controller
from tg import expose

class HelloGadget(Controller):
    """TurboGears ToolBox Gadget.
       Show Hello World in ToolBox
    __label__ ="Hello"
    __version__ = "1.0"
    __author__ = "Fred Lin"
    __email__ = "mymail+tg2[at]"
    __copyright__ = "Copyright 2008 Fred Lin"
    __license__ = "MIT"
    __group__ = "Help"
    __icon__ = "places/start-here.png"
    need_project = False

    def index(self):
        return 'Hello ToolBox'



$ python develop


$ python install

to register your project to setuptools. Then you could run ‘paster toolbox’ to view your gadget!

Upload To Pypi


$ python register bdist_egg sdist --format=zip upload

to upload both egg and source code to pypi.

Remove Development Gadget


$ easy_install -m hello

Check ‘paster toolbox’ list and the hello gadget is gone.

Future Plans

  • Widget Browser gadget by ToscaWidget (Browse widgets)
  • upgrade MVC gadget with Source Highlight by ToscaWidget
  • upgrade MVC gadget with Editor function inspired by web2py
  • i18n Gadget
  • With Authorization
  • i18n
  • Model Designer Gadget rewrite with ToscaWidgets
  • Able to Custom tab
  • able to Manage tab
  • Able to custom app/tab