6.3.1.4. URL input

6.3.1.4. URL input

This driver accepts a URL. Since it uses the Python urllib library, it has the same limitations. From the manual:
Start python section to interscript/drivers/sources/url.py[1]
     1: #line 185 "source_drivers.ipk"
     2: # gets input from a URL
     3: from interscript.drivers.sources.base import source
     4: from interscript.drivers.sources.base import eof
     5: class url_source(source):
     6:   def __init__(self,filename):
     7:     source.__init__(self)
     8:     self.name = filename
     9:     self.file = urllib.urlopen(filename)
    10:     self.closed = 0
    11: 
    12:   def __del__(self):
    13:     self.file.close()
    14: 
    15:   def readline(self):
    16:     line = self.file.readline()
    17:     if len(line)==0: raise eof
    18:     self.lines_read = self.lines_read + 1
    19:     return line
    20: 
    21:   def get_filename(self):
    22:     return self.name
    23: 
End python section to interscript/drivers/sources/url.py[1]