mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-03-02 19:23:40 +01:00
Minor cleanups
This commit is contained in:
parent
6a8ed44d3e
commit
19367baec8
4 changed files with 7 additions and 9 deletions
|
|
@ -36,6 +36,6 @@
|
|||
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 @@ def __init__(self, node, prefix="xs1:", root="/Data/media/"):
|
|||
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 @@ def open(self) :
|
|||
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 @@ def __init__(self):
|
|||
|
||||
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…
Reference in a new issue