mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from trunk
This commit is contained in:
commit
ab16d1c0a8
@ -828,7 +828,15 @@ class ITUNES(DriverBase):
|
||||
if DEBUG:
|
||||
logger().info("ITUNES.get_file(): exporting '%s'" % path)
|
||||
|
||||
outfile.write(open(self.cached_books[path]['lib_book'].location().path).read())
|
||||
try:
|
||||
outfile.write(open(self.cached_books[path]['lib_book'].location().path).read())
|
||||
except:
|
||||
# Clean up
|
||||
logger().info(" unable to extract books from iDevices")
|
||||
logger().info(" deleting empty ", outfile.name)
|
||||
outfile.close()
|
||||
os.remove(outfile.name)
|
||||
raise UserFeedback("Unable to extract books from iDevices", details=None, level=UserFeedback.WARN)
|
||||
|
||||
def open(self, connected_device, library_uuid):
|
||||
'''
|
||||
|
@ -120,7 +120,6 @@ class USER_DEFINED(USBMS):
|
||||
self.plugin_needs_delayed_initialization = False
|
||||
|
||||
def windows_sort_drives(self, drives):
|
||||
|
||||
if len(drives) < 2: return drives
|
||||
e = self.settings().extra_customization
|
||||
if not e[self.OPT_SWAP_MAIN_AND_CARD]:
|
||||
@ -143,4 +142,18 @@ class USER_DEFINED(USBMS):
|
||||
drives[1] = t
|
||||
return tuple(drives)
|
||||
|
||||
def osx_sort_names(self, names):
|
||||
if len(names) < 2: return names
|
||||
e = self.settings().extra_customization
|
||||
if not e[self.OPT_SWAP_MAIN_AND_CARD]:
|
||||
return names
|
||||
main = names.get('main', None)
|
||||
card = names.get('carda', None)
|
||||
|
||||
if main is not None and card is not None:
|
||||
names['main'] = card
|
||||
names['carda'] = main
|
||||
|
||||
return names
|
||||
|
||||
|
||||
|
@ -165,17 +165,18 @@ class MultiCompleteComboBox(EnComboBox):
|
||||
|
||||
def showPopup(self):
|
||||
c = self.le._completer
|
||||
v = unicode(c.currentCompletion())
|
||||
v = c.currentCompletion()
|
||||
c.setCompletionPrefix('')
|
||||
c.complete()
|
||||
if c.model().rowCount() < tweaks['completion_change_to_ascii_sorting']:
|
||||
i = 0;
|
||||
while c.setCurrentRow(i):
|
||||
cr = unicode(c.currentIndex().data().toString())
|
||||
if cr.startswith(v):
|
||||
c.popup().setCurrentIndex(c.currentIndex())
|
||||
break
|
||||
i += 1
|
||||
cs = c.caseSensitivity()
|
||||
i = 0
|
||||
while c.setCurrentRow(i):
|
||||
cr = c.currentIndex().data().toString()
|
||||
if cr.startsWith(v, cs):
|
||||
c.popup().setCurrentIndex(c.currentIndex())
|
||||
return
|
||||
i += 1
|
||||
c.setCurrentRow(0)
|
||||
|
||||
def update_items_cache(self, complete_items):
|
||||
self.lineEdit().update_items_cache(complete_items)
|
||||
|
Loading…
x
Reference in New Issue
Block a user