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 / sparql / Unbound.pyc (.txt) < prev   
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  1.4 KB  |  31 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from rdflib.sparql import _questChar
  5.  
  6. class Unbound:
  7.     '''A class to encapsulate a query variable. This class should be used in conjunction with L{BasicGraphPattern<graphPattern.BasicGraphPattern>}.'''
  8.     
  9.     def __init__(self, name):
  10.         """
  11.         @param name: the name of the variable (without the '?' character)
  12.         @type name: unicode or string
  13.         """
  14.         if isinstance(name, basestring):
  15.             self.name = _questChar + name
  16.             self.origName = name
  17.         else:
  18.             raise SPARQLError('illegal argument, variable name must be a string or unicode')
  19.         return isinstance(name, basestring)
  20.  
  21.     
  22.     def __repr__(self):
  23.         retval = '?%s' % self.origName
  24.         return retval
  25.  
  26.     
  27.     def __str__(self):
  28.         return self.__repr__()
  29.  
  30.  
  31.