# - - - T x n y . _ _ i n i t _ _
def __init__ ( self, hier, stdFileName, altFileName ):
'''Read all the files, build the taxonomy and code system.
'''
First, establish all the invariants; see Section 18, “class TaxaTree: The taxonomic tree” and Section 24, “class AbTab: The symbol table for
codes”
for relevant constructors.
#-- 1 --
self.hier = hier
self.taxaTree = TaxaTree ( hier )
self.abTab = AbTab()
See Section 17.4, “Txny.__readStd(): Read the standard forms
file”.
#-- 2 --
# [ if stdFileName names a readable standard forms file
# valid against itself and self.hier ->
# self.taxaTree +:= taxa from that file
# self.abTab +:= entries for the bindings of all
# codes used in that file
# else ->
# Log() +:= error message(s)
# raise IOError ]
self.__readStd ( stdFileName )
See Section 17.15, “Txny.__readAlt(): Read the alternate forms
file”.
#-- 3 --
# [ if altFileName names a readable alternate forms file
# valid against itself, self.hier, and self.abTab ->
# self.taxaTree +:= entries for new taxa from that file
# self.abTab +:= bindings for new codes from that file
# else ->
# Log() +:= error message(s)
# raise IOError ]
self.__readAlt ( altFileName )
At this point all inputs have been read and are valid.
However, we must also insure that all the codes have
been defined. For this consistency check, see
Section 17.28, “Txny.__finalCheck(): Verify correctness of
the symbol table”.
#-- 4 --
# [ if self.abTab contains no undefined codes ->
# I
# else ->
# Log() +:= error message(s)
# raise IOError ]
self.__finalCheck()