View Single Post
Old 01-05-2014, 01:31 AM   #4
geekraver
Addict
geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.geekraver ought to be getting tired of karma fortunes by now.
 
Posts: 364
Karma: 1035291
Join Date: Jul 2006
Location: Redmond, WA
Device: iPad Mini,Kindle Paperwhite
Thanks Kovid. I'll look into that approach later. Right now I'm using the title, but I'm not getting very far at all. It doesn't seem my plugin is being called at all. It is loaded successfully, and shows up as a metadata source when downloading metadata, but I see no output from the print statements. My __init__.py is below; can you see what I might be doing wrong?

Code:
from calibre.ebooks.metadata.sources.base import Source

class Magazines(Source):

    name = 'Magazines'
    description = _('Download metadata for various magazines')
    version = (0, 1, 0)
    author = 'Graham Wheeler'
    minimum_calibre_version = (0, 9, 0)

    capabilities = frozenset(['identify'])
    touched_fields = frozenset ([
        'comments'
        ])
    has_html_comments = True


    def identify(self, log, result_queue, abort, title=None, authors=None,
                 identifiers={}, timeout=30):

        print 'In identify: %s ' % title
        from calibre_plugins.magazines.worker import Worker

        # Search for results in different thread, as searching takes time and blocks...
        worker = Worker(result_queue, log, title, authors, self, cfg.getOption(cfg.KEY_MAX_DOWNLOADS))
        worker.start()

        while not abort.is_set():
            worker.join(0.2)

            if not worker.is_alive():
                break

        print 'Out of worker: %s' % result_queue.qsize()

        return None
geekraver is offline   Reply With Quote