director.thirdparty.toposort module

director.thirdparty.toposort.toposort(data)[source]

Dependencies are expressed as a dictionary whose keys are items and whose values are a set of dependent items. Output is a list of sets in topological order. The first set consists of items with no dependences, each subsequent set consists of items that depend upon items in the preceeding sets.

director.thirdparty.toposort.toposort_flatten(data, sort=True)[source]

Returns a single list of dependencies. For any set returned by toposort(), those items are sorted and appended to the result (just to make the results deterministic).