-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path__init__.py
57 lines (49 loc) · 2.01 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Greg Riker <[email protected]>; 2014, Wulf C. Krueger <[email protected]>'
__docformat__ = 'restructuredtext en'
from calibre.customize import InterfaceActionBase
from calibre.utils.config import JSONConfig
class MarvinManagerPlugin(InterfaceActionBase):
name = 'Marvin XD'
description = 'Extended Driver for Marvin'
supported_platforms = ['linux', 'osx', 'windows']
author = 'Wulf C. Krueger'
# #mark ~~~ plugin version ~~~
version = (1, 2, 4)
# #mark ~~~ Minimum calibre version ~~~
minimum_calibre_version = (1, 29, 0)
actual_plugin = 'calibre_plugins.marvin_manager.action:MarvinManagerAction'
prefs = JSONConfig('plugins/Marvin XD')
def is_customizable(self):
return True
def config_widget(self):
'''
See devices.usbms.deviceconfig:DeviceConfig()
'''
self.cw = None
if self.actual_plugin_:
from calibre_plugins.marvin_manager.config import ConfigWidget
self.icon = getattr(self.actual_plugin, 'icon', None)
self.opts = getattr(self.actual_plugin, 'opts', None)
self.resources_path = getattr(self.actual_plugin, 'resources_path', None)
self.verbose = self.prefs.get('debug_plugin', False)
self.cw = ConfigWidget(self.actual_plugin_)
return self.cw
def save_settings(self, config_widget):
config_widget.save_settings()
if self.actual_plugin_:
self.actual_plugin_.rebuild_menus()
# For testing ConfigWidget, run from command line:
# cd ~/Documents/calibredev/Marvin_Manager
# calibre-debug __init__.py
if __name__ == '__main__':
try:
from PyQt5.Qt import QApplication
except ImportError:
from PyQt4.Qt import QApplication
from calibre.gui2.preferences import test_widget
app = QApplication([])
test_widget('Advanced', 'Plugins')