Mobileread
Calibre x Apple iBooks/Books interfacing / plugin
#1  olerite 12-10-2019, 05:28 PM
Hey Guys,

First of all I am sorry if that is a repeated issue, I have searched in the forum on the subject but did not find any related thread.

I am writing some python code to interface with apple's proprietary MacOS iBooks/Books applications (by editing the sqlite and plist databases), that replaces iTunes to manage ebooks.

So far I am able to add new ebooks, collections and series and update their metadata information as well. I already know how to delete and list from the catalog -- soon to be implemented as well.

A foreseeable goal would be to package it as a calibre plugin and give users back the ability to sync Calibre with ios devices through Apple iBooks/Books.

Does that make sense? What would be the best approach? I have started reading the docs on plugin development and calibre API, I am still trying to figure it out.

best regards
Reply 

#2  kovidgoyal 12-11-2019, 01:51 AM
You would create a GUI plugin, when the user clicks on it it would need to call

self.gui.device_manager.mount_device(kls=IBooksDri ver)

where IbooksDriver is a class that implements the driver. The interface such a class must implement is in devices/interface.py simply inherit from that class and implement the various methods.
Reply 

#3  moonman272 12-13-2019, 11:54 AM
If you make that i'd be alllll over it
Reply 

#4  olerite 12-20-2019, 05:53 PM
Working on it, I hope to call for alpha testers a couple of weeks after the holidays.
Reply 

#5  olerite 12-20-2019, 06:04 PM
Quote kovidgoyal
You would create a GUI plugin, when the user clicks on it it would need to call

self.gui.device_manager.mount_device(kls=IBooksDri ver)

where IbooksDriver is a class that implements the driver. The interface such a class must implement is in devices/interface.py simply inherit from that class and implement the various methods.
I am taking a look at the Fusion Books as an exemple, and it seems that they made it even simpler, without actually inherit from the interface.py class.

Anyway, I do still have some doubt on the GUI integration. Is if there is a way to automatically add the plugin icon to the menubar or its context menu option?

The ones I created using action_spec and create_action() are available to be added if I go to the customization preferences pane, but I am wondering if they can be added by any method of the GUI object, sparing the user of this effort.
Reply 

#6  BetterRed 12-20-2019, 06:33 PM
Most (all ???) GUI plugins give the user the choice of defining the toolbars and menus where the tool is to be shown - it's a multiple choice list, viz:

show attachment »

Added: you might only get that when a plugin is first installed, not when updating an existing plugin.

BR
Reply 

#7  olerite 01-06-2020, 09:56 AM
Quote BetterRed
Most (all ???) GUI plugins give the user the choice of defining the toolbars and menus where the tool is to be shown - it's a multiple choice list, viz:

show attachment »

Added: you might only get that when a plugin is first installed, not when updating an existing plugin.

BR
Hmmm, i am still on the development environment, where the plugin is installed using the command line, perhaps that is why it did not showed the option to add it to the interface... I will look into it again latter, when the plugin should be nearly ready for packaging and end-user tests.

Thanks for the input.
Reply 

#8  BetterRed 01-06-2020, 05:32 PM
Quote olerite
Hmmm, i am still on the development environment, where the plugin is installed using the command line, perhaps that is why it did not showed the option to add it to the interface...
<snip>


That's probably it, a brain cell is telling me that the "Add xxx to toolbars and menus" dialogue also doesn't pop when you add a plugin from a file.

BR
Reply 

Today's Posts | Search this Thread | Login | Register