36.1.7 Directory Objects

class Directory( database, cab, basedir, physical, logical, default, component, [componentflags])
Create a new directory in the Directory table. There is a current component at each point in time for the directory, which is either explicitly created through start_component, or implicitly when files are added for the first time. Files are added into the current component, and into the cab file. To create a directory, a base directory object needs to be specified (can be None), the path to the physical directory, and a logical directory name. default specifies the DefaultDir slot in the directory table. componentflags specifies the default flags that new components get.

start_component( [component[, feature[, flags[, keyfile[, uuid]]]]])
Add an entry to the Component table, and make this component the current component for this directory. If no component name is given, the directory name is used. If no feature is given, the current feature is used. If no flags are given, the directory's default flags are used. If no keyfile is given, the KeyPath is left null in the Component table.

add_file( file[, src[, version[, language]]])
Add a file to the current component of the directory, starting a new one if there is no current component. By default, the file name in the source and the file table will be identical. If the src file is specified, it is interpreted relative to the current directory. Optionally, a version and a language can be specified for the entry in the File table.

glob( pattern[, exclude])
Add a list of files to the current component as specified in the glob pattern. Individual files can be excluded in the exclude list.

remove_pyc( )
Remove .pyc/.pyo files on uninstall.

See Also:

Directory Table
File Table
Component Table
FeatureComponents Table

See About this document... for information on suggesting changes.