6.10.9.1. Construct input object

6.10.9.1. Construct input object

We construct an disk source driver by taking the first command line argument as a disk file name. We construct an input frame, and attach the source driver to it.
Start python section to interscript/frames/passf.py[2]
    46: #line 76 "pass_frame.ipk"
    47: 
    48:     basename = file
    49:     if string.find(file,'.') != -1:
    50:       basename = string.join(string.split(file,'.')[:-1],'.')
    51: 
    52:     weaver = auto_weaver(self, basename, self.autoweave)
    53:     userdict = {
    54:       'echo_input':self.echo_input,
    55:       'verbosity':self.verbosity
    56:       }
    57: 
    58:     try:
    59:       input_file =named_file_source(self,file, self.master.source_prefix)
    60: 
    61:     except source_open_error, filename:
    62:       if self.verbosity>1:
    63:         print 'Cannot Open File',filename,'for input (ignored)'
    64:       raise
    65:     except KeyboardError:
    66:       raise
    67:     except:
    68:       print "Program error opening",file
    69:       traceback.print_exc()
    70:       raise
    71: 
    72:     self.include_files.append((1,'interscript',file))
    73:     inpt = input_frame(
    74:       self,
    75:       input_file,
    76:       [],
    77:       weaver,
    78:       userdict,
    79:       1)
    80:     inpt.set_warning_character(python='@')
    81:     if self.verbosity>=3:
    82:       print 'input from',inpt.source.get_source_name()
    83: 
    84:     inpt.file_pass()
    85:     # at this point, inpt, weaver, userdict, input_file
    86:     # should all be released (even if 'pass_frame' is held onto,
    87:     # these symbols are defined in the __init__ function frame)
    88: 
    89:   def get_pass_frame(self):
    90:     return self
    91: 
    92:   def get_new_test_number(self):
    93:     self.testno = self.testno + 1
    94:     return self.testno
    95: 
    96:   def get_new_sequence_number(self):
    97:     self.sequence = self.sequence + 1
    98:     return self.sequence
    99: 
End python section to interscript/frames/passf.py[2]