Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 08-23-2022, 09:41 AM   #1
zisoft
Enthusiast
zisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolate
 
Posts: 29
Karma: 33985
Join Date: Oct 2010
Device: Pocketbook HD Touch 3
Support multiple devices in device plugin

I have developed an improved device driver for PocketBook devices. The device detection work fine with the VENDOR_ID and PRODUCT_ID settings.

Now it turned out that the driver works with other PocketBook devices as well. So I tried to build a base class for the functionality and derived classes for each device like so:

Code:
class POCKETBOOK_IMPROVED(USBMS, PocketBookImprovedDeviceConfig):
    ...

class POCKETBOOK632(POCKETBOOK_IMPROVED):
    name = 'PocketBook 632 device interface'
    ...

class POCKETBOOK1040(POCKETBOOK_IMPROVED):
    name = 'PocketBook 1040 device interface'
    ...
The device classes POCKETBOOK632, POCKETBOOK1040 are exposed in __init__.py

Now, when I install the zip file only the first class gets registered in Calibre.
It would be nice to have all the different device names be visible in Calibre's device list.

What steps do I need to accomplish this?
zisoft is offline   Reply With Quote
Old 08-23-2022, 09:47 AM   #2
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: 44,017
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can only load one plugin class from a given plugin. Just put your functionality into a single driver. Most drivers in calibre support multiple device models from a family, there is no need for separate classes.
kovidgoyal is offline   Reply With Quote
Old 08-23-2022, 09:48 AM   #3
zisoft
Enthusiast
zisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolatezisoft is generous with chocolate
 
Posts: 29
Karma: 33985
Join Date: Oct 2010
Device: Pocketbook HD Touch 3
Thanks for clearing this!
zisoft is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple libraries on portable device run from multiple computers amagrace Library Management 7 10-31-2018 12:00 AM
Multiple Windows users: their own plugin settings? Are plugin settings global? oj829 Plugins 2 12-07-2012 12:33 PM
Multiple libraries Multiple Devices Marianne527 Library Management 2 12-03-2012 04:04 PM
[Device Plugin] Kindle 2, 3, 4, Touch Device Interface MBP Update Mod cryzed Plugins 7 10-28-2012 04:58 PM
Multiple reader device support rgoulde Calibre 2 07-03-2009 03:53 PM


All times are GMT -4. The time now is 10:25 AM.


MobileRead.com is a privately owned, operated and funded community.