|
|
#1 |
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Jul 2014
Device: Moonreader (android)
|
Plugin test with mtp
Just doing some experiment but i get a little confused from this:
Code:
from calibre.devices.mtp.driver import MTP_DEVICE
class MYSYNC(MTP_DEVICE):
name = 'Android Sync' # Name of the plugin
description = 'bla bla bla'
supported_platforms = ['windows', 'linux'] # Platforms this plugin will run on
author = 'dontlookhere' # The author of this plugin
version = (0, 1, 0) # The version number of this plugin
minimum_calibre_version = (0, 7, 53)
calibre-customize -b mine/ I get this error: Code:
Traceback (most recent call last):
File "/usr/bin/calibre-customize", line 20, in <module>
sys.exit(main())
File "/usr/lib/calibre/calibre/customize/ui.py", line 662, in main
build_plugin(opts.build_plugin)
File "/usr/lib/calibre/calibre/customize/ui.py", line 624, in build_plugin
plugin = add_plugin(t.name)
File "/usr/lib/calibre/calibre/customize/ui.py", line 382, in add_plugin
'A builtin plugin with the name %r already exists' % plugin.name)
calibre.customize.ui.NameConflict: A builtin plugin with the name u'MTP Device Interface' already exists
|
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,618
Karma: 28549044
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You cannot inherit from a builtin driver class like that. The plugin loading system has no way to know which is the driver class, MTP_DEVICE or MSYNC
You need to inherit from the DevicePlugin class instead. If you really want to inherit from MTP_DEVICE then create a driver.py file in your plugin and do it in that, then simply import MSYNC into __init__.py like this from calibre_plugins.my_plugin_import_name.driver import MSYNC |
|
|
|
| Advert | |
|
|
|
|
#3 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,618
Karma: 28549044
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
And this commit should allow your __init__.py to work as well
https://github.com/kovidgoyal/calibr...a9f681b2234426 |
|
|
|
|
|
#4 | ||
|
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Jul 2014
Device: Moonreader (android)
|
Quote:
Quote:
|
||
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Abiword v3.0 ePub plugin output test | Doitsu | ePub | 0 | 05-10-2014 11:28 AM |
| Build 1.2 MTP support | Patricia1066 | Calibre | 3 | 09-06-2013 08:29 PM |
| Windows 8 MTP Problems | CardcaptorRLH85 | Devices | 2 | 12-07-2012 02:03 AM |
| Thank you for MTP support | blak4dr | Calibre | 3 | 09-22-2012 11:08 PM |
| MTP support: Testers needed | kovidgoyal | Calibre | 68 | 09-21-2012 04:54 AM |