585: #line 777 "input_frame.ipk"
586: def enqueue_input(self,file, count, line):
587: """Enqueue a line with cross reference information
588: into the input stream."""
589: self.read_buffer.append((file,count,line))
590:
591: def dequeue_input(self):
592: "Read a line out of the input stream"
593: data = self.read_buffer[0]
594: del self.read_buffer[0]
595: return data
596:
597:
598: def line(self, number, filename):
599: "Reset interscript's source reference data"
600: self.inpt.original_file = filename
601: self.inpt.line_offset = number - inpt.src.get_lines_read()
602:
603: def readline(self):
604: while 1:
605: if self.read_buffer:
606: return self.dequeue_input()
607: try:
608: line = self.source.readline()
609: self.real_filename = self.source.get_source_name()
610: self.real_count = self.source.get_lines_read()
611: self.original_count = self.real_count + self.line_offset
612: line = string.rstrip(line)
613: self.line = string.expandtabs(line,self.tabwidth)
614: return (self.original_filename,self.original_count,self.line)
615: except KeyboardInterrupt:
616:
617: self.process.update_files = 0
618: raise KeyboardInterrupt
619: except eof:
620: if 'input' in self.process.trace:
621: print 'readline: EOF'
622: self.line = None
623: raise eoi
624: else:
625: print 'program error in readline:',sys.exc_info()
626: self.process.update_files = 0
627: