diff --git a/src/calibre/devices/android/driver.py b/src/calibre/devices/android/driver.py index 4316741755..54ea5c4cd2 100644 --- a/src/calibre/devices/android/driver.py +++ b/src/calibre/devices/android/driver.py @@ -21,7 +21,7 @@ class ANDROID(USBMS): 0x0bb4 : { 0x0c02 : [0x100], 0x0c01 : [0x100]}, # Motorola - 0x22b8 : { 0x41d9 : [0x216], 0x2d67 : [0x100]}, + 0x22b8 : { 0x41d9 : [0x216], 0x2d67 : [0x100], 0x41db : [0x216]}, 0x18d1 : { 0x4e11 : [0x0100, 0x226], 0x4e12: [0x0100, 0x226]}, diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index c7334b1585..6c432fcb2f 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -1048,18 +1048,25 @@ class Manifest(object): self._data = None return property(fget, fset, fdel, doc=doc) - def unload_data_from_memory(self): + def unload_data_from_memory(self, memory=None): if isinstance(self._data, (str, bytes)): - from calibre.ptempfile import PersistentTemporaryFile - pt = PersistentTemporaryFile('_oeb_base_mem_unloader') - pt.write(self._data) - pt.close() - def loader(*args): - with open(pt.name, 'rb') as f: - ans = f.read() - os.remove(pt.name) - return ans - self._loader = loader + if memory is None: + from calibre.ptempfile import PersistentTemporaryFile + pt = PersistentTemporaryFile(suffix='_oeb_base_mem_unloader.img') + pt.write(self._data) + pt.close() + def loader(*args): + with open(pt.name, 'rb') as f: + ans = f.read() + os.remove(pt.name) + return ans + self._loader = loader + else: + def loader2(*args): + with open(memory, 'rb') as f: + ans = f.read() + return ans + self._loader = loader2 self._data = None diff --git a/src/calibre/ebooks/oeb/output.py b/src/calibre/ebooks/oeb/output.py index 123d485b00..b1de3b97a1 100644 --- a/src/calibre/ebooks/oeb/output.py +++ b/src/calibre/ebooks/oeb/output.py @@ -48,5 +48,6 @@ class OEBOutput(OutputFormatPlugin): os.makedirs(dir) with open(path, 'wb') as f: f.write(str(item)) + item.unload_data_from_memory(memory=path) diff --git a/src/calibre/library/custom_columns.py b/src/calibre/library/custom_columns.py index 812a8a9ba3..052143a5f6 100644 --- a/src/calibre/library/custom_columns.py +++ b/src/calibre/library/custom_columns.py @@ -189,8 +189,6 @@ class CustomColumns(object): if label is not None: self.conn.execute('UPDATE custom_columns SET label=? WHERE id=?', (label, num)) - self.custom_column_num_map[num]['label'] = label - self.custom_column_label_map[label] = self.custom_column_num_map[num] changed = True if is_editable is not None: self.conn.execute('UPDATE custom_columns SET is_editable=? WHERE id=?', @@ -317,7 +315,8 @@ class CustomColumns(object): editable=True, display={}): if datatype not in self.CUSTOM_DATA_TYPES: raise ValueError('%r is not a supported data type'%datatype) - normalized = datatype not in ('datetime', 'comments', 'int', 'bool') + normalized = datatype not in ('datetime', 'comments', 'int', 'bool', + 'float') is_multiple = is_multiple and datatype in ('text',) num = self.conn.execute( ('INSERT INTO '