footprints.priorities

Footprint utilities to handle the priority footprint’s attribute.

Module Attributes

footprints.priorities.top = <footprints.priorities.PrioritySet object>

Predefined ordered object.

Functions

footprints.priorities.set_after(priorityref, *args)[source]

Set args priority after specified priorityref.

footprints.priorities.set_before(priorityref, *args)[source]

Set args priority before specified priorityref.

Classes

class footprints.priorities.PriorityLevel(tagname, pset)[source]

Bases: object

Single level to be used inside footprints.

addafter(tag)[source]

Add a new priority after the current one.

addbefore(tag)[source]

Add a new priority before the current one.

as_dump()[source]

Return a nicely formated class name for dump in footprint.

bottom()[source]

Rerank as the bottom level priority.

delete()[source]

Removes itself from the priority set.

down()[source]

Loose one step in the ranking.

nextlevel()[source]

Return the next priority level in the set… if any.

prevlevel()[source]

Return the previous priority level in the set… if any.

property rank

Actual order level in the current set of priorities.

top()[source]

Rerank as the top level priority.

up()[source]

Gain one step in the ranking.

class footprints.priorities.PrioritySet(levels=None)[source]

Bases: object

Iterable class for handling unsortable priority levels.

extend(*levels)[source]

Extends the set of logical names for priorities. Existing levels are reranked at top priority as well as new one.

freeze(tag)[source]

Store the current ordered list of priorities with a tag.

freezed()[source]

Return a tuple of tags used for naming past freezings.

insert(tag=None, after=None, before=None)[source]

Insert a new priority after or before an other one (which the tag name is given).

level(tag)[source]

Return the PriorityLevel object of this set associated to the specified tag name.

levelbyindex(ipos)[source]

Returns the relative position of the priority named tag.

levelindex(tag)[source]

Returns the relative position of the priority named tag.

remove(tag)[source]

Remove the PriorityLevel item associated to the specified tag name.

rerank(tag, upd)[source]

Reranks the priority named tag according to upd shift. Eg: +1, -2, etc.

reset()[source]

Restore the frozen defaults as defined at the initialisation phase.

restore(tag)[source]

Restore previously frozen defaults under the specified tag.