View Single Post
Old 07-15-2025, 09:44 AM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,423
Karma: 27757236
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Looks generally fine. Couple of minor notes:
1) Use PersistentTemporaryFile from calibre.ptemfile rather than the stdlib tempfile module
2) Instead of except: use except Exception: other you catch things like keyboardinterrupts and so on
3) use with rather than try..finally

Yes a separate tab is fine. And yes this is MTP only, the USBMS based kindle driver already handles apnx itself.
kovidgoyal is offline   Reply With Quote