6.3.1.2.2. Source Base Class

6.3.1.2.2. Source Base Class

Interscript source drivers provide all the facilities required of standard python file objects opened for input.
Start python section to interscript/drivers/sources/base.py[2]
     5: #line 35 "source_drivers.ipk"
     6: #---------------------------------------------------------
     7: # source base
     8: class source:
     9:   def __init__(self, **kwds):
    10:     self.lines_read = 0
    11:     self.mode = 'r'
    12:     for k in kwds.keys():
    13:       self.__dict__[k]=kwds[k]
    14:     self.closed = 1
    15: 
    16:   def get_source_name(self):
    17:     return self.name
    18: 
    19:   def get_lines_read(self):
    20:     return self.lines_read
    21: 
    22:   def readlines():
    23:     if self.closed:
    24:       raise eof
    25:     lines = []
    26:     try:
    27:       while 1:
    28:         lines.append(self.readline())
    29:     except:
    30:       pass
    31:     return lines
    32: 
    33:   def isatty(self):
    34:     return 0
    35: 
    36:   def close(self):
    37:     self.closed = 1
    38: 
    39:   def flush(self):
    40:     pass
    41: 
End python section to interscript/drivers/sources/base.py[2]