diff --git a/src/calibre/ebooks/pml/output.py b/src/calibre/ebooks/pml/output.py index deace8df79..851a89db56 100644 --- a/src/calibre/ebooks/pml/output.py +++ b/src/calibre/ebooks/pml/output.py @@ -40,7 +40,7 @@ class PMLOutput(OutputFormatPlugin): pmlmlizer = PMLMLizer(ignore_tables=opts.linearize_tables) content = pmlmlizer.extract_content(oeb_book, opts) with open(os.path.join(tdir, 'index.pml'), 'wb') as out: - out.write(content.encode(self.opts.output_encoding, 'replace')) + out.write(content.encode(opts.output_encoding, 'replace')) self.write_images(oeb_book.manifest, tdir) diff --git a/src/calibre/ebooks/txt/output.py b/src/calibre/ebooks/txt/output.py index ffb4d6fee5..6cb854df10 100644 --- a/src/calibre/ebooks/txt/output.py +++ b/src/calibre/ebooks/txt/output.py @@ -46,7 +46,7 @@ class TXTOutput(OutputFormatPlugin): out_stream.seek(0) out_stream.truncate() - out_stream.write(txt.encode(self.opts.output_encoding, 'replace')) + out_stream.write(txt.encode(opts.output_encoding, 'replace')) if close: out_stream.close() diff --git a/src/calibre/gui2/widgets.py b/src/calibre/gui2/widgets.py index d6b9d7d8ed..08422a285b 100644 --- a/src/calibre/gui2/widgets.py +++ b/src/calibre/gui2/widgets.py @@ -257,6 +257,9 @@ class LocationView(QListView): if 0 <= row and row <= 3: self.model().location_changed(row) + def leaveEvent(self, event): + self.eject_button.hide() + def show_eject(self, location): self.eject_button.hide()