![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
|
Plugins
Hello, I thought I'd start a new thread about the Plugins.
I've finally been able to create a plugin that will work with the Windows Command Line. However, I'm running into one thing. If I modify the Hello World plugin to work on_import agains .lit files, I get the following error when loading a file: Loading plugin from C:\Users\Owner\AppData\Roaming\calibre\plugins\Hel lo World Plugin.zip Traceback (most recent call last): File "C:\Program Files\calibre\library.zip\calibre\customize\ui.py" , line 146, in _run_filetype_plugins File "<string>", line 20, in run File "calibre\ebooks\metadata\meta.pyo", line 87, in set_metadata AttributeError: 'MetaInformation' object has no attribute 'lower' |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,288
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
oops small typo in the hello world plugin:
change Code:
set_metadata(file, ext, mi) to set_metadata(file, mi, ext) |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
|
Quote:
Another question, though. Is there any way to have Calibre re-read the metadata from the file within the plugin? |
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,288
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#5 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
|
Ok. I have to admit that I'm stumped again.
I've got a metadata reader that shows up and appears to run when adding a file to calibre, but it isn't picking up the metadata from the file (a non-drm lit file). I'm afraid I need to ask for some pointers again. |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,288
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
This plugin is identical to the built in lit metadata plugin. If that is failing to pick up metadata, this will too.
|
![]() |
![]() |
![]() |
#8 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
|
Quote:
I deliberately started with the same setup as your current lit metadata code. I figured once I can get that running as my own plugin, then I can work on customizing it. My first step was just to make sure I could get the plugin running at all. Last edited by junkml; 01-04-2009 at 09:07 AM. |
|
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,288
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Ah ok, now I understand. I'm somewhat swamped in work at the moment. Could you opena aticket and attach your plugin and I'll get around to figuring out why it doesn't work in the next couple of days.
|
![]() |
![]() |
![]() |
#10 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
|
Quote:
Thanks again! |
|
![]() |
![]() |
![]() |
#11 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
|
Kovid, noticed that version 4.126 is out, and says the status for the ticket on the metadata plugin is closed.
Is there something else that has to be changed with the .py file attached to the ticket, in order for it to work? I use that script, but there is still nothing coming in for the metadata, even though the built-in plugin for .lit metadata works. Sorry to keep pestering you, but this is the last little piece I need to get working. Thanks. |
![]() |
![]() |
![]() |
#12 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,288
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yeah the problem should have been fixed in 126. At least your plugin was working for me. Try insering a print statement at the start of the run method and see if you get any output when running calibredb add
|
![]() |
![]() |
![]() |
#13 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
|
Quote:
I did a print on ftype, stream, and get_metadata(stream, ftype), and this is what it output: C:\Users\Owner\Documents\My Library>calibredb add "c:\users\owner\documents\my library\open.lit" Loading plugin from C:\Users\Owner\AppData\Roaming\calibre\plugins\New LIT metadata.zip lit <open file u'c:\\users\\owner\\documents\\my library\\open.lit', mode 'rb' at 0x03622480> <open file u'c:\\users\\owner\\documents\\my library\\open.lit', mode 'r+b' at 0x03622CA0> If I enable the built-in lit metadata reader, it still brings in the metadata. |
|
![]() |
![]() |
![]() |
#14 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,288
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Add a
print mi where mi is the result of the get_metadata call |
![]() |
![]() |
![]() |
#15 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
|
Quote:
edit: I take that back. Looking at the output again, the print statement BEFORE "print mi" shows up, but then nothing. So the print statement after "print mi" never happened. But, there was no error showing at the command line. Last edited by junkml; 01-05-2009 at 09:53 PM. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Metadata Download Plugins | TogTogTogTog | Plugins | 5 | 11-25-2018 12:32 AM |
DRM plugins | jjansen | Plugins | 9 | 12-01-2012 06:22 PM |
Metadata download plugins | newbino | Plugins | 3 | 07-31-2010 11:25 PM |
Download Plugins | turdette | Plugins | 1 | 01-07-2010 06:25 PM |
Plugins? | Mitchll | Plugins | 0 | 12-27-2008 02:36 PM |