提供: OLPC

This page contains pointers to a collection of idioms which I rely on to accomplish tasks quickly and with predictable results.

verbose python tracebacks
import cgitb; cgitb.enable(format="plain")
verbosity controls on logging
pythonic relations
See my relation module and Alloy (which was my inspiration, though I've made nothing more than a poor knockoff).
relational error logging
See and
email-based error reporting
from pdb import set_trace as debug ... debug()
rpm makefiles
See rpm-packaging as well as individual projects like olpc-netutils along with my Fedora packaging bibliography.
pymeta parser-based controllers
triagebot is based on a model-view-controller architecture where the controller object is assembled at runtime based on data collected with a metaclass.
pymeta makes it easy to pick the right response to complicated input.
python gdb macros
python memory profiling
guppy + Tomeu's memory leak testing writeup.
tree-based python context management
puritan's and
custom dbus decorators
sds stub
ipython for exploring interprocess communication
IPython is wonderfully helpful for exploring xml-rpc and dbus interfaces.
code to make pylint happy
rainbow's can be automatically checked for many errors by pylint because it passes all data explicitly through function calls.
C error handling
nss-rainbow uses a dash of code-generation and a lot of convention to be very consistent about error detection and handling.
C warning flags & Makefile tips
nss-rainbow's Makefile gets a number of things right, though it can still be improved in several ways.
scripts for user creation
provision users on new machines in a scripted fashion.
program with git
Puritan and other parts of our build system show some silly things you can do with git if you are so inclined.
localize shell code
xs-upserv - just for kicks: a localized Makefile
  • ログイン
  • Login with OpenID
About OLPC
About the laptop
About the tablet
OLPC wiki