View Single Post
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