Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 05-01-2010, 11:52 PM   #1
burliest
Junior Member
burliest began at the beginning.
 
burliest's Avatar
 
Posts: 3
Karma: 10
Join Date: May 2010
Device: iPhone
self.author in MetadataSource plugin

I started writing a metadata download plugin according to the documentation in the user manual, but I'm having some trouble with the self.author value. It looks like a naming conflict between the author of the plugin and the author of the book. Has anyone else run into this and already solved it?

This code demonstrates the issue. The value for self.title is the book title, but the value for self.author in this example is "Wrong Author" instead of the book author:

Code:
import traceback

from calibre.ebooks.metadata.fetch import MetadataSource

class AuthorConflictPlugin(MetadataSource):
    
    name = 'foo'
    author = 'Wrong Author'
    supported_platforms = ['windows']
    metadata_type = 'basic'

    def fetch(self):
        try:
            raise Exception(self.title, self.author)  # value is Wrong Author
        except Exception as e:
            self.exception = e
            self.tb = traceback.format_exc()
burliest is offline   Reply With Quote
Old 05-02-2010, 12:49 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Use self.book_author instead of self.author
kovidgoyal is offline   Reply With Quote
Advert
Old 05-02-2010, 01:24 AM   #3
burliest
Junior Member
burliest began at the beginning.
 
burliest's Avatar
 
Posts: 3
Karma: 10
Join Date: May 2010
Device: iPhone
That worked. Thank you.
burliest is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get to Know-an Author with Noahan Author Interview series! NoahMGillman Self-Promotions by Authors and Publishers 22 12-19-2010 09:45 PM
New Plugin Type Idea: Library Plugin cgranade Plugins 3 09-15-2010 12:11 PM
The 50 best author vs. author put-downs of all time Madam Broshkina Lounge 4 05-03-2010 05:13 AM
Author(s) & Author Sort BobF Calibre 11 01-02-2009 05:01 PM
Referencer plugin IanHelgesen iRex 6 12-22-2008 09:24 PM


All times are GMT -4. The time now is 05:22 AM.


MobileRead.com is a privately owned, operated and funded community.