home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / python-support / python2.6 / rdflib / URLInputSource.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  1.2 KB  |  25 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from urllib2 import urlopen, Request
  5. from xml.sax.xmlreader import InputSource
  6. from rdflib import __version__
  7. headers = {
  8.     'Accept': 'application/rdf+xml,application/xhtml+xml;q=0.5',
  9.     'User-agent': 'rdflib-%s (http://rdflib.net/; eikeon@eikeon.com)' % __version__ }
  10.  
  11. class URLInputSource(InputSource, object):
  12.     
  13.     def __init__(self, system_id = None):
  14.         super(URLInputSource, self).__init__(system_id)
  15.         self.url = system_id
  16.         req = Request(system_id, None, headers)
  17.         file = urlopen(req)
  18.         self.setByteStream(file)
  19.  
  20.     
  21.     def __repr__(self):
  22.         return self.url
  23.  
  24.  
  25.