conductor.native.lib.dependency_list module

class conductor.native.lib.dependency_list.DependencyList

Bases: object

A list of files with lazy deduplication.

Every time the private entrylist is accessed with an accessor such as len or iter, the _clean flag is checked. If it’s dirty we deduplicate and set it clean. It becomes dirty again if files are added. Since adding a single directory can cause many contained files to be removed during deduplication, we set the next iterator to zero.

add(*files, **kw)

Add one or more files.

Files will be added according to the must_exist check. Duplicate files and directories that contain other files may be added and no deduplication will happen at this time.

common_path()

Find the common path among entries.

This is useful for determining output directory when many renders are rendering to different places.

In the case where only single path exists, it is not possible to tell from its name whether it is a file or directory. We don’t want this method to touch the filesystem, that should be someone else’s problem. A trailing slash would be a hint, but the absence of a trailing slash does not mean its a regular file. Therefore, in the case of a single file we return it ASIS and the caller can then stat to find out for sure.

If no files exist return None.

If the filesystem root is the common path, return os.sep.

glob()
next()

Get the next element.

Deduplicate just in time.