6.10.10.1. The input frame

6.10.10.1. The input frame

Note the horrid hack: the reg_list is a list of pairs, the second entry is a method which should be bound to this frame, but the frame isn't built yet. So the caller must pass an empty list, and populate it after the frame is constructed.

MUCH WORSE: doing this creates a circular reference, preventing the frame being destroyed!

This has to be fixed.

Start python section to interscript/frames/inputf.py[2]
    37: #line 80 "input_frame.ipk"
    38: class input_frame:
    39: 
    40:   def __init__(self, pass_frame, src, reg_list, weaver, userdict, depth):
    41:     # the display
    42:     self.pass_frame = pass_frame
    43:     self.master = pass_frame.master
    44:     self.process = self.master.process
    45:     self.global_frame = self.process.global_frame
    46: 
    47:     self.weaver = weaver
    48:     self.weaver_stack = []
    49: 
    50:     self.depth = depth
    51:     self.source = src
    52:     self.userdict = userdict
    53:     self.reg_list = reg_list
    54:     self.read_buffer = []
    55: 
    56:     self.tangler_stack = []
    57:     self.tangler = None
    58:     self.line_offset = 0
    59:     self.original_filename = src.get_source_name()
    60:     self.weaver.set_original_filename(self.original_filename)
    61:     self.head_offset = 0
    62:     self.verbosity = pass_frame.verbosity
    63:     self.tabwidth = self.master.tabwidth
    64: 
    65:     self.cont_re = re.compile('^$|^ (.*)$')
    66:     self.any_line_re = re.compile('^(.*)$')
    67: 
    68:     if self.verbosity>=6:
    69:       print 'initialising input frame',src.get_source_name()
    70:     self.post_methods()
    71: 
    72:   def __del__(self):
    73:     if self.verbosity>=6:
    74:       print 'frame',self.source.name,'deleting'
    75: 
End python section to interscript/frames/inputf.py[2]


6.10.10.1.1. Post user methods
6.10.10.1.2. close
6.10.10.1.3. Process file data