01-03-2009, 12:21 PM | #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' |
01-03-2009, 01:27 PM | #2 |
creator of calibre
Posts: 44,542
Karma: 24495948
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 | |
|
01-03-2009, 01:56 PM | #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? |
|
01-03-2009, 02:33 PM | #4 |
creator of calibre
Posts: 44,542
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
01-03-2009, 02:42 PM | #5 |
Addict
Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
|
|
Advert | |
|
01-03-2009, 11:21 PM | #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. |
01-04-2009, 12:25 AM | #7 |
creator of calibre
Posts: 44,542
Karma: 24495948
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.
|
01-04-2009, 09:59 AM | #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 10:07 AM. |
|
01-04-2009, 01:49 PM | #9 |
creator of calibre
Posts: 44,542
Karma: 24495948
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.
|
01-04-2009, 02:27 PM | #10 | |
Addict
Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
|
Quote:
Thanks again! |
|
01-05-2009, 08:45 PM | #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. |
01-05-2009, 09:06 PM | #12 |
creator of calibre
Posts: 44,542
Karma: 24495948
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
|
01-05-2009, 10:08 PM | #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. |
|
01-05-2009, 10:18 PM | #14 |
creator of calibre
Posts: 44,542
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Add a
print mi where mi is the result of the get_metadata call |
01-05-2009, 10:44 PM | #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 10:53 PM. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Metadata Download Plugins | TogTogTogTog | Plugins | 5 | 11-25-2018 01:32 AM |
DRM plugins | jjansen | Plugins | 9 | 12-01-2012 07:22 PM |
Metadata download plugins | newbino | Plugins | 3 | 08-01-2010 12:25 AM |
Download Plugins | turdette | Plugins | 1 | 01-07-2010 07:25 PM |
Plugins? | Mitchll | Plugins | 0 | 12-27-2008 03:36 PM |