forked from al1b/Calibre-KiPEO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
26 lines (18 loc) · 1.05 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
from calibre.customize import EditBookToolPlugin
from calibre.customize import InterfaceActionBase
from calibre.ebooks.oeb.polish.container import get_container
from reshaper import reshape_book
class KiPEOPlugin(EditBookToolPlugin, InterfaceActionBase):
name = 'Kindle Persian E-book Optimizer(KiPEO) plugin' # Name of the plugin
description = 'Optimize Perssian/Arabic E-books for Amazon Kindle'
supported_platforms = ['windows', 'osx', 'linux'] # Platforms this plugin will run on
author = 'Ali Bahraminezhad.' # The author of this plugin
version = (1, 0, 0) # The version number of this plugin
file_types = set(['epub', 'awz3']) # The file types that this plugin will be applied to
on_postprocess = True # Run this plugin after conversion is complete
minimum_calibre_version = (0, 7, 53)
def cli_main(self,argv):
fileName = argv[1]
container = get_container(fileName, tweak_mode=True)
reshape_book(container, True)
print('done.')