Pass none for library_uuid when opening a device in contexts where no library is available

This commit is contained in:
Kovid Goyal 2011-03-09 09:20:47 -07:00
parent 4c180ba4cf
commit 859e3caa53
2 changed files with 3 additions and 4 deletions

View File

@ -30,7 +30,6 @@ def strftime(epoch, zone=time.gmtime):
def get_connected_device(): def get_connected_device():
from calibre.customize.ui import device_plugins from calibre.customize.ui import device_plugins
from calibre.devices.scanner import DeviceScanner from calibre.devices.scanner import DeviceScanner
import uuid
dev = None dev = None
scanner = DeviceScanner() scanner = DeviceScanner()
scanner.scan() scanner.scan()
@ -48,7 +47,7 @@ def get_connected_device():
for d in connected_devices: for d in connected_devices:
try: try:
d.open(str(uuid.uuid4())) d.open()
except: except:
continue continue
else: else:

View File

@ -6,7 +6,7 @@ Provides a command-line and optional graphical interface to the SONY Reader PRS-
For usage information run the script. For usage information run the script.
""" """
import StringIO, sys, time, os, uuid import StringIO, sys, time, os
from optparse import OptionParser from optparse import OptionParser
from calibre import __version__, __appname__ from calibre import __version__, __appname__
@ -213,7 +213,7 @@ def main():
for d in connected_devices: for d in connected_devices:
try: try:
d.open(str(uuid.uuid4())) d.open(None)
except: except:
continue continue
else: else: