home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import sys
- import pythoncom
-
- class COMException(pythoncom.com_error):
-
- def __init__(self, description = None, scode = None, source = None, helpfile = None, helpContext = None, desc = None, hresult = None):
- if not scode:
- pass
- scode = hresult
- if scode and scode != 1:
- if scode >= -32768 and scode < 32768:
- scode = -2147024896 | scode & 65535
-
-
- self.scode = scode
- if not description:
- pass
- self.description = desc
- if scode == 1 and not (self.description):
- self.description = 'S_FALSE'
- elif scode and not (self.description):
- self.description = pythoncom.GetScodeString(scode)
-
- self.source = source
- self.helpfile = helpfile
- self.helpcontext = helpContext
- pythoncom.com_error.__init__(self, scode, self.description, None, -1)
-
-
- def __repr__(self):
- return '<COM Exception - scode=%s, desc=%s>' % (self.scode, self.description)
-
-
- Exception = COMException
-
- def IsCOMException(t = None):
- if t is None:
- t = sys.exc_info()[0]
-
-
- try:
- return issubclass(t, pythoncom.com_error)
- except TypeError:
- return t is pythoncon.com_error
-
-
-
- def IsCOMServerException(t = None):
- if t is None:
- t = sys.exc_info()[0]
-
-
- try:
- return issubclass(t, COMException)
- except TypeError:
- return 0
-
-
-