Spammifying Sprockets in Python

Release 0.00

Me, ’cause I wrote it

June 2, 2005

Me, ’cause I’m self-employed.

Abstract This document describes how to spammify sprockets. It is a useful example of a Python HOWTO document. It is not dependent on any particular sprocket implementation, and includes a Python-based implementation in the sprunkit module.

Contents

1 What is Sprocket Spammification? 1 2 Why Use Python? 1 3 Software Requirements 1 4 spam — Short description, for section title and table of contents 2

4.1 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 4.2 Spam Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

A This is an Appendix 2

Spammifying sprockets from Python is both fun and entertaining. Applying the techniques described here, you can also fill your hard disk quite effectively.

1 What is Sprocket Spammification?

You have to ask? It’s the only thing to do to your sprockets!

2 Why Use Python?

Python is an excellent language from which to spammify your sprockets since you can do it on any platform.

3 Software Requirements

You need to have the following software installed:

• Python 1.9.

• Some sprocket definition files.

• At least one sprocket system implementation.

Note that the sprunkit is provided with this package and implements ActiveSprockets in Python.

4 spam — Short description, for section title and table of contents

The spam module defines operations for handling cans of Spam. It knows the four generally available Spam varieties and understands both can sizes.

Because spamification requires Unix process management, the module is only available on genuine Unix systems.

The spam module defines the following functions:

open(filename[, mode[, buffersize]])

Open the file filename as a can of Spam. The optional mode and buffersize arguments specify the read/write mode ('r' (default) or 'w') and the buffer size (default: system dependent).

cansize

The default can size, in ounces. Legal values are 7 and 12. The default varies per supermarket. This variable should not be changed once the open() function has been called.

exception error Exception raised when an operation fails for a Spam specific reason. The exception argument is a string describing the reason of the failure.

4.1 Example

The following example demonstrates how to open a can of spam using the spam module.

      >>> import spam
      >>> can = spam.open('/etc/passwd')
      >>> can.empty()
      >>> can.close()

4.2 Spam Objects

Spam objects, as returned by open() above, have the following methods:

empty()

Empty the can into the trash.

A This is an Appendix

To create an appendix in a Python HOWTO document, use markup like this:

\appendix
\section{This is an Appendix}
To create an appendix in a Python HOWTO document, ....
\section{This is another}
Just add another \section{}, but don't say \appendix again.

\overline{3}