home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- __license__ = 'GPL v3'
- __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
-
- class ProtocolError(Exception):
-
- def __init__(self, msg):
- Exception.__init__(self, msg)
-
-
-
- class TimeoutError(ProtocolError):
-
- def __init__(self, func_name):
- ProtocolError.__init__(self, 'There was a timeout while communicating with the device in function: ' + func_name)
-
-
-
- class DeviceError(ProtocolError):
-
- def __init__(self, msg = None):
- if msg is None:
- msg = 'Unable to find SONY Reader. Is it connected?'
-
- ProtocolError.__init__(self, msg)
-
-
-
- class UserFeedback(DeviceError):
- INFO = 0
- WARN = WARNING = 1
- ERROR = 2
-
- def __init__(self, msg, details, level):
- Exception.__init__(self, msg)
- self.level = level
- self.details = details
- self.msg = msg
-
-
-
- class DeviceBusy(ProtocolError):
-
- def __init__(self, uerr = ''):
- ProtocolError.__init__(self, 'Device is in use by another application:\nUnderlying error:' + str(uerr))
-
-
-
- class DeviceLocked(ProtocolError):
-
- def __init__(self):
- ProtocolError.__init__(self, 'Device is locked')
-
-
-
- class PacketError(ProtocolError):
- pass
-
-
- class FreeSpaceError(ProtocolError):
- pass
-
-
- class ArgumentError(ProtocolError):
- pass
-
-
- class PathError(ArgumentError):
-
- def __init__(self, msg, path = None):
- ArgumentError.__init__(self, msg)
- self.path = path
-
-
-
- class ControlError(ProtocolError):
-
- def __init__(self, query = None, response = None, desc = None):
- self.query = query
- self.response = response
- ProtocolError.__init__(self, desc)
-
-
- def __str__(self):
- if self.query and self.response:
- return 'Got unexpected response:\n' + 'query:\n' + str(self.query.query) + '\n' + 'expected:\n' + str(self.query.response) + '\n' + 'actual:\n' + str(self.response)
- if self.desc:
- return self.desc
- return 'Unknown control error occurred'
-
-
-