6.13.1.8. Cache

Start python section to interscript/drivers/sources/cache.py[1 /1 ]
     1: #line 728 "source_drivers.ipk"
     2: from interscript.drivers.sources.base import source
     3: from interscript.drivers.sources.base import eof
     4: import string
     5: 
     6: class cache_source(source):
     7:   def __init__(self, name, master_frame, encoding='utf8'):
     8:     source.__init__(self, encoding)
     9:     self.name = name
    10:     self.saved = ''
    11:     macros = master_frame.get_persistent_frame('macros')
    12:     self.list = macros.get(name,[])
    13:     self.closed = 0
    14: 
    15:   def _raw_readline(self):
    16:     if len(self.list)>self.lines_read:
    17:       line = self.list[self.lines_read]
    18:     else:
    19:       raise eof
    20:     self.lines_read = self.lines_read + 1
    21:     return line
    22: 
    23:   def rewind_source(self):
    24:     self.lines_read = 0
    25: 
End python section to interscript/drivers/sources/cache.py[1]