Next / Previous / Contents / Shipman's homepage

38. leader()

This function generates a leader element. If no length is specified, the resulting leader is stretchable; otherwise we use the leader-length attribute to specify the fixed length. The default pattern is space, meaning that it is rendered as whitespace.
# - - -   l e a d e r

def leader(s, length=None, pattern=None):
    '''Produce a leader element.
    if length is None:  d = {}
    else:               d = dash(leaderLength=str(length))

    #-- 2
    if pattern is None:  pat = 'space'
    else:                pat = pattern

    #-- 3
    s.leaf('leader', d, dash(leaderPattern=pat))