Next / Previous / Contents / Shipman's homepage

6.11. UniData.__init__()

unidata.py
# - - -   U n i D a t a . _ _ i n i t _ _

    def __init__(self):
        '''Constructor.
        '''

The first step is to digest the entire XML input file into tree form. This step may raise an IOError or OSError exception if the file is not available.

unidata.py
        #-- 1
        # [ if IN_FILE is readable and valid XML ->
        #     doc  :=  an et.ElementTree representing it
        #     root  :=  the root of that ElementTree
        #   else ->
        #     raise an exception ]
        doc = et.parse(IN_FILE)
        root = doc.getroot()

The logic that extracts the entity groups is Section 6.12, “UniData._readGroups(): Process entity group data”.

unidata.py
        #-- 2
        # [ self._groupMap  :=  as invariant from root
        #   self._entSetMap  :=  as invariant from root ]
        self._readGroups(root)

For the logic that extracts the code blocks, see Section 6.13, “UniData._readBlocks(): Extract code block data”.

unidata.py
        #-- 3
        # [ self._blockMap  :=  as invariant from root ]
        self._readBlocks(root)

See Section 6.14, “UniData._readChars(): Process character data” for the processing of the character definitions.

unidata.py
        #-- 4
        # [ self._cpMap  :=  as invariant from root ]
        self._readChars(root)