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 / syntax / serializers / AbstractSerializer.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  1.3 KB  |  27 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from rdflib import URIRef
  5.  
  6. class AbstractSerializer(object):
  7.     
  8.     def __init__(self, store):
  9.         self.store = store
  10.         self.encoding = 'UTF-8'
  11.         self.base = None
  12.  
  13.     
  14.     def serialize(self, stream, base = None, encoding = None, **args):
  15.         '''Abstract method'''
  16.         pass
  17.  
  18.     
  19.     def relativize(self, uri):
  20.         base = self.base
  21.         if base is not None and uri.startswith(base):
  22.             uri = URIRef(uri.replace(base, '', 1))
  23.         
  24.         return uri
  25.  
  26.  
  27.