Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-06-2024, 07:32 PM   #1291
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,755
Karma: 62032371
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
From smarteject_plugin.py is the option to display a prompt if the user attempts to ejected with unsynced books on a Reading List:


Code:
        if 'Reading List' in self.gui.iactions and prefs['checkreadinglistsync']:
            rl_plugin = self.gui.iactions['Reading List']
            list_names = rl_plugin.get_list_names(exclude_auto=True)
            all_list_names = rl_plugin.get_list_names(exclude_auto=False)
            auto_list_names = list(set(all_list_names) - set(list_names))
            if self.gui.device_manager.is_device_connected:
                sync_total = rl_plugin._count_books_for_connected_device()
                rl_plugin.sync_now_action.setEnabled(bool(sync_total > 0) or len(auto_list_names) > 0)
                if sync_total > 0:
                    if question_dialog(self.gui, _("Sync Reading List?"), _("There are books that need syncing according to Reading List.<p>Sync Books?"), show_copy_button=False):
                        rl_plugin.sync_now(force_sync=True)
                        return
Would it be possible to use something like this in Action Chains? For simplicity, just halt the chain and inform user if there's unsynced books.

Last edited by ownedbycats; 03-06-2024 at 07:44 PM.
ownedbycats is offline   Reply With Quote
Old 03-07-2024, 03:39 PM   #1292
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,106
Karma: 1954138
Join Date: Aug 2015
Device: Kindle
I am not really familiar with syncing in calibre, because the closed nature of kindle and the inability to manage collections, means it is better for me to just email one book at a time. But in principle, that code above could be adapted to a custom action or a "Run Python Code" action. For anyone interested, to halt the chain, instead of returning the function, you should call:

Code:
raise chain.UserInterrupt
capink is offline   Reply With Quote
Advert
Old 03-14-2024, 10:25 PM   #1293
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,106
Karma: 1954138
Join Date: Aug 2015
Device: Kindle
New test version

Version 1.20.0
  • Update: Experimental: Run chains in jobs.

The main change here is that some chains can be run as calibre jobs. Chains containing any of the following actions cannot not run as jobs:
  • Calibre Actions.
  • Selection Modifier.
  • Search Using Templates.
  • Chain Caller.

The main reason for this is that these actions make changes to the GUI, and so they can only be run in the main thread.

Note that this feature is experimental and requires setting the following plugin tweak:
Code:
action_chains_experimental = True

Last edited by capink; 04-09-2024 at 03:44 AM.
capink is offline   Reply With Quote
Old 03-14-2024, 11:07 PM   #1294
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,039
Karma: 6422750
Join Date: Sep 2020
Device: Calibre E-book viewer
Looking good, though I get this error when trying to choose an icon image not available in the current listing:

Spoiler:
Traceback (most recent call last):
File "calibre_plugins.action_chains.gui.__init__", line 266, in image_combo_index_changed
File "calibre_plugins.action_chains.gui.__init__", line 277, in update_icon
RuntimeError: wrapped C/C++ object of type ImageComboBox has been deleted


If I choose an icon that has been used before, i. e., already listed in the chains dialog, all goes well. Also, I've noticed that a conflicting setting that I had disabled from JS+ plugin doesn't affect icon displaying anymore. I re-enabled that setting just to see if that new icon combo location had any positive effect on that. It has! However, the error I mentioned had happened before I re-enabled temporarily that setting.

I haven't tested yet the new feature to run actions as jobs.
This on Windows 10 21H1, Calibre 7.7
Comfy.n is offline   Reply With Quote
Old 03-14-2024, 11:34 PM   #1295
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,755
Karma: 62032371
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
What're the advantages of run as job?
ownedbycats is offline   Reply With Quote
Advert
Old 03-15-2024, 12:05 AM   #1296
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,039
Karma: 6422750
Join Date: Sep 2020
Device: Calibre E-book viewer
possibly useful to monitor job logs, depending on the log's verbosity level, I guess.
other than that, I too would like to know

Count TOC nodes runs well with the new option enabled:

Starting job: Run chain: Count TOC nodes
Chain ran successfully
Comfy.n is offline   Reply With Quote
Old 03-15-2024, 03:54 AM   #1297
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,765
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
What're the advantages of run as job?
Jobs run on a separate thread so the GUI isn't blocked, which is good for long running actions.
chaley is offline   Reply With Quote
Old 03-15-2024, 10:50 AM   #1298
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,106
Karma: 1954138
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by Comfy.n View Post
Looking good, though I get this error when trying to choose an icon image not available in the current listing:
You mean when you click on "Add New Image"? I am not able to replicate this. Was it only once? Can you post steps to re-produce that error?

Quote:
Originally Posted by Comfy.n View Post
Also, I've noticed that a conflicting setting that I had disabled from JS+ plugin doesn't affect icon displaying anymore. I re-enabled that setting just to see if that new icon combo location had any positive effect on that. It has! However, the error I mentioned had happened before I re-enabled temporarily that setting.
There is a change I made to how icons are displayed. I was not sure it was going to solve your issue since I don't understand what JS did to cause the problem in the first place.
capink is offline   Reply With Quote
Old 03-15-2024, 10:51 AM   #1299
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,106
Karma: 1954138
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by chaley View Post
Jobs run on a separate thread so the GUI isn't blocked, which is good for long running actions.
Yes. That is the only reason you would need to run a chain as a job. If your chains take only seconds to run, it does not make sense to run them as jobs.
capink is offline   Reply With Quote
Old 03-15-2024, 10:51 AM   #1300
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,039
Karma: 6422750
Join Date: Sep 2020
Device: Calibre E-book viewer
I'm going to post a small video, shortly
Comfy.n is offline   Reply With Quote
Old 03-15-2024, 11:50 AM   #1301
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,039
Karma: 6422750
Join Date: Sep 2020
Device: Calibre E-book viewer
I've tried to demonstrate two events:

- one triggers the message after cancelling the choose icon dialog
- the other happens after the icon gets chosen

And I also notice that an unselected line on the chains dialog has the 'Add New Image' selection kind of incorrectly, not sure. I'd think a more proper behaviour would be having this line displayed as blank (no icon).

I had also instances of Calibre exiting ungracefully out of the blank, after the icon is chosen in that dialog - that's why I wasn't able to generate a useful debug log.
Attached Files
File Type: avi 20240315_1239_55_2.avi (3.42 MB, 16 views)
Comfy.n is offline   Reply With Quote
Old 03-15-2024, 12:11 PM   #1302
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,106
Karma: 1954138
Join Date: Aug 2015
Device: Kindle
OK. That did not happen to me with Linux. Anyways, I will post a new version later tonight with a persistent editor. If it does not work, will put the icon combo back into the Action Dialog.
capink is offline   Reply With Quote
Old 03-15-2024, 12:19 PM   #1303
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,039
Karma: 6422750
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by capink View Post
OK. That did not happen to me with Linux. Anyways, I will post a new version later tonight with a persistent editor. If it does not work, will put the icon combo back into the Action Dialog.
well I had already disabled "for good" that conflicting setting, not missing it very much... Either way is fine!
Comfy.n is offline   Reply With Quote
Old 03-15-2024, 12:56 PM   #1304
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,106
Karma: 1954138
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by Comfy.n View Post
well I had already disabled "for good" that conflicting setting, not missing it very much... Either way is fine!
The fix for icon displaying is separate and should work either way.
capink is offline   Reply With Quote
Old 03-15-2024, 01:22 PM   #1305
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,106
Karma: 1954138
Join Date: Aug 2015
Device: Kindle
Here is a new version. Try it out and see whether it helps with the icon problem.

Last edited by capink; 03-15-2024 at 02:13 PM.
capink is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Action Chains Resources capink Plugins 62 05-17-2024 12:54 AM
[Editor Plugin] Editor Chains capink Plugins 90 04-29-2024 12:21 PM
[GUI Plugin] Noosfere_util, a companion plugin to noosfere DB lrpirlet Plugins 2 08-18-2022 03:15 PM
[GUI Plugin] Save Virtual Libraries To Column (GUI) chaley Plugins 14 04-04-2021 05:25 AM


All times are GMT -4. The time now is 03:59 AM.


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