home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_2877 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  3.0 KB  |  89 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import sys
  5. if sys.platform[:4] == 'java':
  6.     from java.lang import Exception
  7.  
  8. del sys
  9.  
  10. class SAXException(Exception):
  11.     
  12.     def __init__(self, msg, exception = None):
  13.         self._msg = msg
  14.         self._exception = exception
  15.         Exception.__init__(self, msg)
  16.  
  17.     
  18.     def getMessage(self):
  19.         return self._msg
  20.  
  21.     
  22.     def getException(self):
  23.         return self._exception
  24.  
  25.     
  26.     def __str__(self):
  27.         return self._msg
  28.  
  29.     
  30.     def __getitem__(self, ix):
  31.         raise AttributeError('__getitem__')
  32.  
  33.  
  34.  
  35. class SAXParseException(SAXException):
  36.     
  37.     def __init__(self, msg, exception, locator):
  38.         SAXException.__init__(self, msg, exception)
  39.         self._locator = locator
  40.         self._systemId = self._locator.getSystemId()
  41.         self._colnum = self._locator.getColumnNumber()
  42.         self._linenum = self._locator.getLineNumber()
  43.  
  44.     
  45.     def getColumnNumber(self):
  46.         return self._colnum
  47.  
  48.     
  49.     def getLineNumber(self):
  50.         return self._linenum
  51.  
  52.     
  53.     def getPublicId(self):
  54.         return self._locator.getPublicId()
  55.  
  56.     
  57.     def getSystemId(self):
  58.         return self._systemId
  59.  
  60.     
  61.     def __str__(self):
  62.         sysid = self.getSystemId()
  63.         if sysid is None:
  64.             sysid = '<unknown>'
  65.         
  66.         linenum = self.getLineNumber()
  67.         if linenum is None:
  68.             linenum = '?'
  69.         
  70.         colnum = self.getColumnNumber()
  71.         if colnum is None:
  72.             colnum = '?'
  73.         
  74.         return '%s:%s:%s: %s' % (sysid, linenum, colnum, self._msg)
  75.  
  76.  
  77.  
  78. class SAXNotRecognizedException(SAXException):
  79.     pass
  80.  
  81.  
  82. class SAXNotSupportedException(SAXException):
  83.     pass
  84.  
  85.  
  86. class SAXReaderNotAvailable(SAXNotSupportedException):
  87.     pass
  88.  
  89.