mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-12-10 23:25:01 -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
|
You may have to adjust the GROUP and the location of the rules file to
|
||||||
suit your distribution.
|
suit your distribution.
|
||||||
"""
|
"""
|
||||||
__version__ = "0.3.3"
|
__version__ = "0.3.4"
|
||||||
__docformat__ = "epytext"
|
__docformat__ = "epytext"
|
||||||
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
||||||
|
|||||||
@ -93,12 +93,10 @@ class Book(object):
|
|||||||
self.prefix = prefix
|
self.prefix = prefix
|
||||||
self.root = root
|
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 " + \
|
return self.title.encode('utf-8') + " by " + \
|
||||||
self.author.encode('utf-8') + " at " + self.path.encode('utf-8')
|
self.author.encode('utf-8') + " at " + self.path.encode('utf-8')
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return self.__repr__()
|
|
||||||
|
|
||||||
|
|
||||||
def fix_ids(media, cache):
|
def fix_ids(media, cache):
|
||||||
|
|||||||
@ -235,8 +235,7 @@ class PRS500Device(Device):
|
|||||||
self.handle = self.device.open()
|
self.handle = self.device.open()
|
||||||
self.handle.claim_interface(self.INTERFACE_ID)
|
self.handle.claim_interface(self.INTERFACE_ID)
|
||||||
except USBError, err:
|
except USBError, err:
|
||||||
print >> sys.stderr, err
|
raise DeviceBusy(str(err))
|
||||||
raise DeviceBusy()
|
|
||||||
# Large timeout as device may still be initializing
|
# Large timeout as device may still be initializing
|
||||||
res = self.send_validated_command(GetUSBProtocolVersion(), timeout=20000)
|
res = self.send_validated_command(GetUSBProtocolVersion(), timeout=20000)
|
||||||
if res.code != 0:
|
if res.code != 0:
|
||||||
|
|||||||
@ -38,8 +38,9 @@ class DeviceError(ProtocolError):
|
|||||||
|
|
||||||
class DeviceBusy(ProtocolError):
|
class DeviceBusy(ProtocolError):
|
||||||
""" Raised when device is busy """
|
""" Raised when device is busy """
|
||||||
def __init__(self):
|
def __init__(self, uerr=""):
|
||||||
ProtocolError.__init__(self, "Device is in use by another application")
|
ProtocolError.__init__(self, "Device is in use by another application:"\
|
||||||
|
"\nUnderlying error:" + str(uerr))
|
||||||
|
|
||||||
class PacketError(ProtocolError):
|
class PacketError(ProtocolError):
|
||||||
""" Errors with creating/interpreting packets """
|
""" Errors with creating/interpreting packets """
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user