6.10.8. Master Frame

6.10.8. Master Frame

There is a _master frame_ for each master document file read by Interscript. It contains data for the document which persists between passes on the source. For example the master table of contents is part of the master frame. Information in the master frame is often collected during pass and set into the frame at the end of the pass so it can be used by the next pass: the table of contents is such an example.

Conceptually, if multiple master documents are processed by interscript, elaboration of each document is performed in a separate thread. The master frame contains thread local data, whereas the process frame is shared by all threads.

At the 'document' level, the failure to generate a document correctly is at most fatal to that thread of control because documents are in some senses independent. However, when multiple documents form a project, inter-document dependencies may dictate abortion of the whole processes if one of the master threads fails.

Start python section to interscript/frames/masterf.py[1]
     1: #line 23 "master_frame.ipk"
     2: from interscript.frames.passf import pass_frame
     3: from interscript.drivers.sources.disk import parse_source_filename
     4: import pickle
     5: 
     6: class master_frame:
     7:   def __init__(self,process,argument_frame):
     8:     self.process = process
     9:     for k in argument_frame.__dict__.keys():
    10:       if process.verbosity > 4:
    11:         print 'setting MASTER',k,'as',argument_frame.__dict__[k]
    12:       setattr(self,k,argument_frame.__dict__[k])
    13:     self.ids = {}
    14:     self.iflist = []
    15:     self.flist = []
    16:     self.fdict = {}
    17:     self.toc = []
    18:     self.include_files = []
    19:     self.classes = {}
    20:     self.functions = {}
    21:     self.sequence_limit = -1
    22:     self.tests = {}
    23:     self.persistent_frames = {}
    24:     self.cache_name =parse_source_filename(
    25:         self.filename+'.cache', self.source_prefix) [3]
    26:     print 'cache=',self.cache_name
    27:     try:
    28:       cache = open(self.cache_name,'r')
    29:       self.persistent_frames = pickle.load(cache)
    30:       cache.close()
    31:       del cache
    32:       print 'loaded master frame from cache'
    33:     except: pass
    34: 
End python section to interscript/frames/masterf.py[1]


6.10.8.1. Run the passes