View Single Post
Old 02-08-2021, 09:45 AM   #1
lrpirlet
Connoisseur
lrpirlet began at the beginning.
 
Posts: 96
Karma: 40
Join Date: Mar 2020
Location: Belgium (sorry, I am from the Walloon side of the country and I speak french only)
Device: PW3, Kobo Libra H2O
RPDB is missing readline (calibre 5.10.1 under Windows 10)

I intend to learn learn python by writing a metadata source download.

I have written a script that download all the metadata from noosfere that I find important including resume, critics, cover's link, editor, serie, serie #, editor collection, editor collection #, original title... On Github: cal-noosfere... please be patient, I document in french, in English, sometimes both depending on the phase of the moon and I talk to my shadow...

In order to insert my script into calibre I need to make it an object that must be initiated by and must report to Calibre. Since I have no "feeling" about object programming, I decided to step through a working plugin via rpdp. That should be easy it is fully documented...

So I inserted at the begin of a well working plugin (kobo book) the following
Code:
    def identify(self, log, result_queue, abort, title=None, authors=None,
            identifiers={}, timeout=30):
        '''
        Note this method will retry without identifiers automatically if no
        match is found with identifiers.
        '''
        # lrp
        #
        from calibre.rpdb import set_trace
        set_trace()
        #
        # lrp
        matches = []
        log('identify - title: "%s" authors= "%s"'%(title, authors))

        # If we have a KoboBooks id then we do not need to fire a "search".
I started Calibre, started a metadata download with only kobo book enabled
and from a cmd terminal screen I issued

Code:
calibre-debug -c "from calibre.rpdb import cli; cli()"
the immediate answer was
Code:
Connecting to remote debugger on port 4444...
Connected to remote process
Traceback (most recent call last):
  File "runpy.py", line 194, in _run_module_as_main
  File "runpy.py", line 87, in _run_code
  File "site.py", line 82, in <module>
  File "site.py", line 77, in main
  File "site.py", line 49, in run_entry_point
  File "calibre\debug.py", line 270, in main
  File "<string>", line 1, in <module>
  File "calibre\rpdb.py", line 112, in cli
ModuleNotFoundError: No module named 'readline'
Some research on google seems to imply that this is a common problem under Windows 10 and solution would be to use pyreadline instead see https://stackoverflow.com/questions/...le-for-windows

Now, how do I install that into the "Calibre imbedded python"? I have not the intention to compile calibre, pip does not seems to be possible...

Another solution for me would be to use linux from my other slow computer, but that means to reinstall it on a larger disk. The space is so scarce that I cannot install python on it (I haven't dreamed to install Calibre yet)

Last but not least, after the __init__ to introduce the object to Calibre, is identify() the entry point to the plugin? If yes, may I guess that it is where I get the information about the book that needs metadata and the starting of the plugin work, while result_queue is where to send the metadata gathered???
lrpirlet is offline   Reply With Quote