MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Plugins (https://www.mobileread.com/forums/forumdisplay.php?f=237)
-   -   Plugin to run on import of all file types (https://www.mobileread.com/forums/showthread.php?t=255318)

annoywife 02-01-2015 10:25 AM

Plugin to run on import of all file types
 
I have a Calibre plugin that I want to run when any file is imported into Calibre. The only plugin type I have found on http://manual.calibre-ebook.com/plugins.html that will run when a file is imported is a FileTypePlugin, but it looks like the file types for which the plugin will run must be manually keyed into the plugin code.

Is there a way to construct a FileTypePlugin so that it runs when any file type is imported by Calibre? Alternatively, is there another type of plugin that could accomplish this goal?

Thanks for your help.

kovidgoyal 02-01-2015 10:30 AM

No, there is noway to run a plugin on any file import. Just add all the file types to your plugin, surely you aren't planing on storing an infinite number of file types.

annoywife 02-01-2015 11:24 AM

Thanks - not a huge deal. Just wanted to avoid the eventual frustration of adding some new file type, seeing that the plugin didn't run as expected, trying to troubleshoot, and then eventually realizing "oh, right, I have to manually key this new extension into the plugin."

Thanks again. And don't call me Shirley :)

eschwartz 02-01-2015 07:08 PM

What about using BOOK_EXTENSIONS from calibre.ebooks? If only the usual ebook formats will be needed...


All times are GMT -4. The time now is 08:46 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.