Xunius / Menotexport

Python solution to export annotations from your Mendeley library.
GNU General Public License v3.0
123 stars 20 forks source link

Add a timeout when extracting pdf highlights #20

Open vinnyricciardi opened 6 years ago

vinnyricciardi commented 6 years ago

This is a great and useful project - thanks for making it! I noticed that for certain pdfs Menotexport hangs at extracthl2.extractHighlights2. I fixed a local copy of this script to include a timeout using the Timeout package. It fixed my issue. Would you like me to contribute this addition to your project?

Xunius commented 6 years ago

Thanks for the feedback!

I've seen it slows down sometimes but never seen it hangs, but it would be a good choice to time it out and add the failed pdf to the fail list in such cases. I also think it would be better to set the default time out period to be relatively long as people tend to use this as a one-time tool, so I feel slower execution time is more tolerable than not getting the results. And finally, is it possible to implement this without introducing extra external package?