Next / Previous / Contents / Shipman's homepage

29. class MarginSet

An instance of this class represents a set of four margin sizes.

fosox.py
# - - - - -   c l a s s   M a r g i n S e t

class MarginSet(object):
    '''Represents a set of four margin sizes.

      Exports:
        MarginSet(top="0.0in", bot="0.0in", left="0.0in",
                  right="0.0in"):
          [ arguments are valid XSL-FO dimensions ->
              return a new MarginSet instance representing top
              margin (top), bottom margin (bot), left margin
              (left), and right margin (right) ]
        .top, .bot, .left, .right:  [ as passed to constructor ]
        .dict():
          [ return a dict whose keys are "margin-top", etc.,
            with corresponding values from self.top, etc. ]
        .__str__():    [ return self as a string ]
    '''

29.1. MarginSet.__init__()

fosox.py
# - - -   M a r g i n S e t . _ _ i n i t _ _

    def __init__(self, top="0.0in", bot="0.0in", left="0.0in",
                 right="0.0in"):
        '''Constructor.
        '''
        self.top = top
        self.bot = bot
        self.left = left
        self.right = right