Next / Previous / Contents / Shipman's homepage

25. leader(): Produce a leader element

This element can be used to fill either a fixed or arbitrary horizontal area inside a block. The fill is whitespace by default, but can be any value of the leader-pattern attribute. See Section 4.19, “leader(): Generate a leader”.

fohelpers.py
# - - -   l e a d e r

def leader(length=None, pattern=None):
    '''Create a leader element.
    '''
    #-- 1 --
    lengthDict = ({}
                  if length is None
                  else dash(leaderLength=length))

    #-- 2
    leaderPattern = ('space'
                     if pattern is None
                     else pattern )

    #-- 3
    return E.leader(lengthDict, dash(leaderPattern=leaderPattern))