Next / Previous / Contents / Shipman's homepage

9. writeProductFiles: Write all product files

nomcompile3
# - - -   w r i t e P r o d u c t F i l e s

def writeProductFiles ( txny ):
    '''Write all the various outputs.

      [ txny is a Txny instance ->
          if output-files(Args()) can be opened new for writing ->
            output-files(Args())  :=  representations of hier and txny
          else ->
            sys.stderr  +:=  error messages
            output-files(Args())  :=  (anything) ]
    '''

There are four product files.

nomcompile3
    #-- 1 --
    # [ if file tree-file(Args()) can be opened new for writing ->
    #     that file  :=  flat tree file representing txny
    #   else ->
    #     Log()  +:=  error message(s)
    #     stop execution ]
    writeTreeFile ( txny )

    #-- 2 --
    # [ if files abbr-file(Args()) and coll-file(Args()) can be
    #   opened new for writing ->
    #     file abbr-file(Args())  :=  flat abbreviation file
    #                                 representing txny
    #     file coll-file(Args())  :=  flat collisions file
    #                                 representing txny
    #   else ->
    #     Log()  +:=  error message(s)
    #     stop execution ]
    writeAbbrFiles ( txny )

    #-- 3 --
    # [ if file xml-file(Args()) can be opened new for writing ->
    #     file xml-file(Args))  :=  an XML representation of txny
    #   else ->
    #     Log()  +:=  error message(s)
    #     stop execution ]
    writeXMLFile ( txny )