![]() |
#767 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Code:
from calibre_plugins.action_chains.actions.base import ChainAction class RefreshAction(ChainAction): name = 'Refresh GUI' def run(self, gui, settings, chain): gui.current_db().refresh() Last edited by ownedbycats; 12-27-2021 at 05:29 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#768 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#769 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I have it working now and I posted in Action Chains scripts.
Another question: Currently, the chain here halts the entire thing if I press 'no.' Is it possible to make it only apply to the next action in the chain? Background: Currently, I have two chains: "Send to Device" and "Send to Device + Add to TBR." They're identical except for a a single 'add to reading list' action. So instead of two chains, it makes sense to prompt for that one action. Putting it at the end works, but then that means I can't put my column re-sort module there. Last edited by ownedbycats; 12-29-2021 at 12:15 AM. |
![]() |
![]() |
![]() |
#770 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,197
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
Edit: A better approach is to use the Chain Variations feature which is designed for this kind of thing. It will alleviate the need to have a pop-up prompt, as it allows you to have multiple menu entries for the same chain. Last edited by capink; 12-29-2021 at 04:18 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#771 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
how would the variations work for this case? From what I understand, it changes the menu entry depending on...things, but whether I want to add a book to the TBR list is something I decide myself.
|
![]() |
![]() |
![]() |
#772 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,197
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
It should be as follows:
Now you should have two variants. Only one of them will pass the argument that satisfies the condition for running the 'add to reading list' action. Last edited by capink; 12-29-2021 at 04:55 PM. |
|
![]() |
![]() |
![]() |
#773 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I see how that works now.
![]() For the submenu/icon arguments, should I just use an empty string if I don't want it submenued? EDIT: Empty string works. Last edited by ownedbycats; 12-29-2021 at 06:22 PM. |
![]() |
![]() |
![]() |
#774 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Possible bug?
After restarting Calibre, the chains with variations temporarily disappear from the AC menu. They reappear after I open the config and save again. If it matters, it doesn't seem to delete keyboard shortcuts in use by them like when renaming a chain. I restart in debug mode and I notice this error in the log: Code:
Action Chains: Unable to create variant for chain (Send to Device) Traceback (most recent call last): File "calibre_plugins.action_chains.action", line 345, in create_all_menu_actions_for_chain File "calibre_plugins.action_chains.action", line 355, in create_variants_menu_actions File "calibre_plugins.action_chains.action", line 394, in variants_from_config AttributeError: 'ChainInterfaceAction' object has no attribute 'template_functions' Last edited by ownedbycats; 12-31-2021 at 01:33 PM. |
![]() |
![]() |
![]() |
#775 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,197
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
I added a new version to the first post. Try it and see if it helps with the error above.
|
![]() |
![]() |
![]() |
#776 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
That fixed it. thank you!
|
![]() |
![]() |
![]() |
#777 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,012
Karma: 75555555
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
New glitch noticed after updating to newest version:
On my 'view' chain, view_manager_last_view() != 'Physical Books' in conditions results in an action consistently failing. Removing it made it work again. I got this error in the evaluator: Code:
EXCEPTION: Interpreter: Internal error evaluating an expression: 'eval_() missing 1 required positional argument: 'locals'' - line number 2 Code:
from calibre_plugins.action_chains.templates import TemplateFunction class ViewManagerLastVIew(TemplateFunction): name = 'view_manager_last_view' arg_count = 0 def evaluate(self, formatter, kwargs, mi, locals): import calibre_plugins.view_manager.config as cfg gui = self.plugin_action.gui library_config = cfg.get_library_config(gui.current_db) return library_config.get(cfg.KEY_LAST_VIEW, '') Thankfully, current_virtual_library_name() works just as well (maybe better) for my purposes - but was something used in it deprecated or changed? Last edited by ownedbycats; 12-31-2021 at 11:44 PM. |
![]() |
![]() |
![]() |
#778 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,197
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Version 1.15.0 - 1 January 2022
Version 1.15.1 - 1 January 2022
|
![]() |
![]() |
![]() |
#779 |
Member
![]() Posts: 11
Karma: 10
Join Date: Dec 2021
Device: Kobo Libra 2
|
This plugin is a masterpiece!
Is it possible to use in action the bulk function to "Swap title and author"? (I didn't find a way!) Thx Mike |
![]() |
![]() |
![]() |
#780 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,013
Karma: 500000
Join Date: Jun 2015
Device: Rocketbook, kobo aura h2o, kobo forma, kobo libra color
|
I'm looking for a more selective selection.
Something like given this search and sort, select variations of:
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Editor Plugin] Editor Chains | capink | Plugins | 106 | 06-17-2025 05:36 PM |
Action Chains Resources | capink | Plugins | 77 | 06-16-2025 12:45 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 |