Firstly, what is the error?
But, what I actually have problems with:
Code:
{id:id_aux[id] for id in lis_aux_id}
Firstly, I can't see where and hence what "id_aux".
Then, "lis_aux_id" appears to be a list of strings. It was created in the loop immediately above with append. It looks like it is just a collection of the string "WRITING THIS TEXT" which doesn't make sense to use it as an index above.
And there are some indentation problems. Mixing tabs and spaces can work in Python 2, but, isn't valid in Python 3. And personally, I find it confuses things enough so that I'm not exactly sure what is at what level of indentation above.
The calibre related stuff seems to be correct. It matches with what I have used.
It would probably easiest if you post the plugin. That gives the full context. And we can run it if we want to.