![]() |
#1 |
Member
![]() Posts: 11
Karma: 10
Join Date: Jun 2014
Device: kindle fire hd
|
my first plugin did not work
I have tried the hello world plugin , but it didn't work.
I have set up the environment variable: calibre_develop_from. D:\Development\Calibredev>dir 25/07/2014 11:57 1,070 __init__.py D:\Development\Calibredev>calibre-customize -b . Plugin updated: Hello World Plugin (1, 0, 0) I added a txt file to calibre , and converted into epub file. I hope to change the metadata during the converting, just like what the hello world plugin did. but it didn't change anything. the following is the hello world plugin : any one can kindly help me to do the first plugin? thanks in advance. import os from calibre.customize import FileTypePlugin class HelloWorld(FileTypePlugin): name = 'Hello World Plugin' # Name of the plugin description = 'Set the publisher to Hello World for all new conversions' supported_platforms = ['windows', 'osx', 'linux'] # Platforms this plugin will run on author = 'Acme Inc.' # The author of this plugin version = (1, 0, 0) # The version number of this plugin file_types = set(['epub', 'txt']) # 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 run(self, path_to_ebook): from calibre.ebooks.metadata.meta import get_metadata, set_metadata file = open(path_to_ebook, 'r+b') ext = os.path.splitext(path_to_ebook)[-1][1:].lower() mi = get_metadata(file, ext) mi.publisher = 'Hello World' set_metadata(file, mi, ext) return path_to_ebook |
![]() |
![]() |
![]() |
#2 |
Member
![]() Posts: 11
Karma: 10
Join Date: Jun 2014
Device: kindle fire hd
|
actually, I want to develop a plugin with the following function:
1: it can get meta from txt file and update the calibre metadata. 2:it can update the metadata when I select one file and click a button. who can kindly guide to complete this plugin? thanks. Stephen |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 11
Karma: 10
Join Date: Jun 2014
Device: kindle fire hd
|
I set up the environment variable , but echoing it not working.
what's wrong with it? Stephen C:\Users\Administrator>echo $CALIBRE_DEVELOP_FROM $CALIBRE_DEVELOP_FROM C:\Users\Administrator>set ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\Administrator\AppData\Roaming asl.log=Destination=file CALIBRE_DEVELOP_FROM=d:\development\calibre\src |
![]() |
![]() |
![]() |
#4 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
|
|
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Member
![]() Posts: 11
Karma: 10
Join Date: Jun 2014
Device: kindle fire hd
|
thanks so much for your posting.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] KindleUnpack - The Plugin | DiapDealer | Plugins | 527 | 08-15-2025 01:36 PM |
Calibre's collections plugin didn't work | atp | Library Management | 4 | 03-12-2012 08:01 PM |
Plugin not customizable: Plugin: HTML Output does not need customization | flyingfoxlee | Conversion | 2 | 02-24-2012 02:24 AM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |
New Plugin Type Idea: Library Plugin | cgranade | Plugins | 3 | 09-15-2010 12:11 PM |