Each file in the dist directory describes a file or set of files to add to a distributable package. The content of the file is straight Python script code. Each of the files is loaded and executed, and at the end of the run, a tar archive is produced and compressed with gzip.
Before running, the first line from the file VERSION is read in. This line must contain the package name, a space, and the version number. The resulting archive will be named PACKAGE-VERSION.tar.gz.
The following objects are defined for use in the Python code. All variables may be modified, and additional ones may be created.
Name | Type | Description |
---|---|---|
file(name[, content]) | Function | Adds the named file to the list of files to copy into the package. If content is included, it is written to the resulting file, otherwise the named file is copied from the source directory. If the named file has already been named, the program aborts. |
files(list) | Function | Adds the list of files to be copied into the package. |
glob(pattern) | Function | Returns a list of files matching the given pattern |
nofile(name) | Function | Removes the named file from the package file list. No error occurrs if the file was not already in the list. |
nofiles(name) | Function | Removes the list of names from the package file list. |
os | Module | Standard OS module |
package | Variable | The package name read from the VERSION file. Setting this has no effect on the resulting package. |
re | Module | Standard regular expression module |
readlist(filename) | Function | Opens the file, reads its contents as a list of lines, and strips off all the trailing newlines and whitespace. |
string | Module | Standard string module |
version | Variable | The version number read from the VERSION file. Setting this has no effect on the resulting package. |