mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-12-09 06:35:13 -05:00
Minor cleanups
This commit is contained in:
parent
6a8ed44d3e
commit
19367baec8
@ -36,6 +36,6 @@ the following rule in C{/etc/udev/rules.d/90-local.rules} ::
|
||||
You may have to adjust the GROUP and the location of the rules file to
|
||||
suit your distribution.
|
||||
"""
|
||||
__version__ = "0.3.3"
|
||||
__version__ = "0.3.4"
|
||||
__docformat__ = "epytext"
|
||||
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
||||
|
||||
@ -93,12 +93,10 @@ class Book(object):
|
||||
self.prefix = prefix
|
||||
self.root = root
|
||||
|
||||
def __repr__(self):
|
||||
def __str__(self):
|
||||
""" Return a utf-8 encoded string with title author and path information """
|
||||
return self.title.encode('utf-8') + " by " + \
|
||||
self.author.encode('utf-8') + " at " + self.path.encode('utf-8')
|
||||
|
||||
def __str__(self):
|
||||
return self.__repr__()
|
||||
|
||||
|
||||
def fix_ids(media, cache):
|
||||
|
||||
@ -235,8 +235,7 @@ class PRS500Device(Device):
|
||||
self.handle = self.device.open()
|
||||
self.handle.claim_interface(self.INTERFACE_ID)
|
||||
except USBError, err:
|
||||
print >> sys.stderr, err
|
||||
raise DeviceBusy()
|
||||
raise DeviceBusy(str(err))
|
||||
# Large timeout as device may still be initializing
|
||||
res = self.send_validated_command(GetUSBProtocolVersion(), timeout=20000)
|
||||
if res.code != 0:
|
||||
|
||||
@ -38,8 +38,9 @@ class DeviceError(ProtocolError):
|
||||
|
||||
class DeviceBusy(ProtocolError):
|
||||
""" Raised when device is busy """
|
||||
def __init__(self):
|
||||
ProtocolError.__init__(self, "Device is in use by another application")
|
||||
def __init__(self, uerr=""):
|
||||
ProtocolError.__init__(self, "Device is in use by another application:"\
|
||||
"\nUnderlying error:" + str(uerr))
|
||||
|
||||
class PacketError(ProtocolError):
|
||||
""" Errors with creating/interpreting packets """
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user