Next / Previous / Contents / Shipman's homepage

12.1. PageDim.__init__>

fohelpers.py
# - - -   P a g e D i m . _ _ i n i t _ _

    def __init__(self, pageBox, pageMargins=None, frameMargins=None,
                 bodyMargins=None):
        '''Constructor
        '''
        self.pageBox = pageBox

The next three lines use a common Python idiom meaning, in the first example: if pageMargins is not None, set self.pageMargins to that value; otherwise set it to a new MarginSet instance with all zero values.

fohelpers.py
        self.pageMargins = pageMargins or MarginSet()
        self.frameMargins = frameMargins or MarginSet()
        self.bodyMargins = bodyMargins or MarginSet()