Next / Previous / Contents / Shipman's homepage

8.1. FlowTree.__init__(): Constructor

The constructor builds only two elements: the root and its first child, layout-master-set.

fohelpers.py
# - - -   F l o w T r e e . _ _ i n i t _ _

    def __init__(self):
        '''Constructor
        '''
        #-- 1 --
        # [ self.root  :=  a new root et.Element
        #   self.doc  :=  a new et.ElementTree with that root ]
        self.root = E.root(xmlns=FO_NAMESPACE)
        self.doc = et.ElementTree(self.root)

        #-- 2 --
        # [ self.root  +:=  a new layout-master-set child
        #   self.masters  :=  that child ]
        self.masters = subElement(self.root,
            E("layout-master-set") )