Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 08-10-2022, 09:19 AM   #1
lrpirlet
Connoisseur
lrpirlet began at the beginning.
 
Posts: 93
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
What is the calibre shutdown (exit) process?

I have developed a plugin based on webengine_demo_plugin.zip.

This plugin, noosfere_util, allows to manually select the metadata from one of the editions of the book in noosfere site.

To do that I open a web browser in a separate process, go to the page of the book, find the reference. Noosfere_util then sends the reference to main calibre using temporary files. I synchronize both main calibre and noosfere_util via temporary files. Later I use noosfere DB metadata plugin to upload the metadata I want.

Everything seems to work ok... provided I suppress any access to main calibre while noosfere_util gui is active. If I press the closing X of the main calibre gui, before I terminate the noosfere_util, then I get "The main calibre program" process still running and NO gui anymore to stop it... If I run calibre in debug mode, and kill main calibre before noosfere_util, "The main calibre program" process is gone while the debug process console is hidden somewhere...

If I try to restart calibre, it complains about not being able to contact calibre, please restart calibre...

I guess (I hope) there is a call to to an abort procedure in every plugin, or a signal is emitted when main calibre is shutdown... But I cannot find it (I may be blind )

Thank in advance for any hint.

Last edited by lrpirlet; 08-10-2022 at 11:02 AM.
lrpirlet is offline   Reply With Quote
Old 08-10-2022, 11:17 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,859
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
There isnt any. You should prevent the user from quitting calibre by popping up a modal dialog there as well. I added some signals for you here: https://github.com/kovidgoyal/calibr...9ec4226bc55912
kovidgoyal is offline   Reply With Quote
Advert
Old 08-10-2022, 12:40 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,859
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Oh and just for fun from the next calibre release you will be able to use Qt WebEngine from the main calibre program as well.
kovidgoyal is offline   Reply With Quote
Old 08-11-2022, 06:53 AM   #4
lrpirlet
Connoisseur
lrpirlet began at the beginning.
 
Posts: 93
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
Smile Thanks

Thanks a lot...

I sort of though about a modal kind of noosfere web-browser. I was using sleep() to sync so that control would NOT have been transferred to the main calibre gui... But that prevented me to "self.gui.library_view.select_rows([book_id])" to get and display in the main calibre the actual metadata...

However, you gave me the idea to pop up a small dialog over the close button of the main calibre (if that is possible). This dialog would disappear at the close of the noosfere web browser...

Anyway, thanks for the signal, I'll use it to try to kill the web browser before main calibre completes shutdown.
lrpirlet is offline   Reply With Quote
Old 08-12-2022, 12:31 AM   #5
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
I had not looked at your plugins before as they are for a French site, and that isn't very useful to me. But, while trying to work out what you are doing, I noticed that you are missing two methods.

The first is "get_book_url". This is used by calibre to convert the identifier to a URL. It is used in the detail pane so that you can click on the link to open the browser to view the book in the page. The link is also shown when downloading the metadata so you can open page. It should return a tuple with the identifier name, the identifier and the URL. This would also mean you don't need URL in the comments. And, having "get_book_url" missing is also causing a problem. If you have an "nsfr_id" identifier for a book, you cannot delete other identifiers from the book details pane.

The other is "id_from_url". This takes a URL and extracts the identifier details. It can be used in the metadata editor. If you have the URL of the books page in the clipboard, when you click on the paste button to the left of the identifiers field in the metadata editor.
davidfor is offline   Reply With Quote
Advert
Old 08-13-2022, 10:29 AM   #6
lrpirlet
Connoisseur
lrpirlet began at the beginning.
 
Posts: 93
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
Thumbs up THANKS very nice comments...

Quote:
But, while trying to work out what you are doing
Hi davidfor

Thanks for your comments. As you may have read in my profile, I used to be a computer (DEC, Compaq, HP) hardware engineer...

My knowledge about High level languages was null even if i may say that I understand the working and the internals of an OS such as VMS, Ultrix, OSF, Tru64 and by analogy, linux, windows... I can navigate an OS crash dump (provided I have both the sources and the symbols... BUT

I have a hard time when I want to read the sources of a huge package such as calibre (do not mistake me, I like reverse engineer it). I think I have not found yet how the navigate this type of code.

SO thanks a lot for pointing those "get_book_url" and "id_from_url"... I will take a look...

Better still, if you have other remarks, please do not hesitate, let me know. (well, anyway, I make no promisses and I will decide what I want to implement)
lrpirlet is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Terminate process in ThreadedJob terminates calibre main process xxyzz Development 7 08-10-2021 11:34 PM
How to exit calibre? SvenLotus Calibre 4 09-17-2019 09:49 AM
Intermittent Calibre shutdown with Kobo PeterT Devices 4 05-19-2015 08:19 PM
How to properly exit Calibre wahoo123 Calibre 4 11-26-2012 11:07 AM
Calibre and Windows Shutdown deannah Calibre 5 03-01-2012 10:14 PM


All times are GMT -4. The time now is 10:24 AM.


MobileRead.com is a privately owned, operated and funded community.