I spent my last two weekends working with ancient web technologies. Anne decided she wanted to update her Happy Faces web to attract more face painting business. I agreed to create a form for customers to inquire about rates and availability. The hosting service only offered Python 2.4, CGI, and sendmail.
I really did not want to write a script that I knew others had written. I just wanted to make a pretty little form to help Anne. I found one library that almost worked. I knew I could write a better library, and I would not trust any library without a test suite. I decided to write my own that would manage the request and response form, sending emails, and storing them if sendmail failed. I wrote a simple means to define a schema of what fields are in the form and how to validate them. The test module even provides a test web server that runs the CGIs you place in the root directory. This was a fine meditative exercise, but I would not describe it as fun.
I posted my CGI contact library on Launchpad for anyone who finds they need to work with historical technology.
I recently created https://launchpad.net/lp-release-manager-tools for some videos I am making about how to use Launchpad. One aspect of creating a release is to upload the source tarball and a detached gpg signature verifying it. This is somewhat ironic, since lp-release-manager-tools exists to automate repetitive tasks that release managers do in Launchpad. I really do not like creating the signature. I cannot remember how to do it. I need to read the instruction on the form to upload the tarball each time. So I added a feature to my example project that any project hat uses python distutils can copy to make the signature with the source tarball.
I subclassed the sdist command and added an extra step to create the detached signature of the tarball. I then register the new command as signed_dist. This is the content of my setup.py:
from distutils.core import setup
from distutils.command.sdist import sdist
"""Sign the source archive with a detached signature."""
description = "Sign the source archive after it is generated."
gpg_args = [
'gpg', '--armor', '--sign', '--detach-sig', self.archive_files]
gpg = subprocess.Popen(
gpg_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
description="Launchpad release manager API scripts.",
maintainer="Curtis C. Hovey",