|
|
#767 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,306
Karma: 13781972
Join Date: Oct 2018
Device: Kobo 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 06:29 PM. |
|
|
|
|
|
#768 | |
|
Grumpy old git
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,062
Karma: 3789385
Join Date: Jan 2010
Location: UK
Device: Reader
|
Quote:
|
|
|
|
|
|
|
#769 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,306
Karma: 13781972
Join Date: Oct 2018
Device: Kobo 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 01:15 AM. |
|
|
|
|
|
#770 | |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 678
Karma: 211740
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 05:18 AM. |
|
|
|
|
|
|
#771 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,306
Karma: 13781972
Join Date: Oct 2018
Device: Kobo 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 | |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 678
Karma: 211740
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 05:55 PM. |
|
|
|
|
|
|
#773 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,306
Karma: 13781972
Join Date: Oct 2018
Device: Kobo 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 07:22 PM. |
|
|
|
|
|
#774 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,306
Karma: 13781972
Join Date: Oct 2018
Device: Kobo 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 02:33 PM. |
|
|
|
|
|
#775 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 678
Karma: 211740
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 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,306
Karma: 13781972
Join Date: Oct 2018
Device: Kobo Aura HD
|
That fixed it. thank you!
|
|
|
|
|
|
#777 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,306
Karma: 13781972
Join Date: Oct 2018
Device: Kobo 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; 01-01-2022 at 12:44 AM. |
|
|
|
|
|
#778 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 678
Karma: 211740
Join Date: Aug 2015
Device: Kindle
|
Version 1.15.0 - 1 January 2022
Version 1.15.1 - 1 January 2022
|
|
|
|
|
|
#779 |
|
Junior Member
![]() Posts: 1
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 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 698
Karma: 294342
Join Date: Jun 2015
Device: kobo aura h2o, kobo forma
|
I'm looking for a more selective selection.
Something like given this search and sort, select variations of:
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [GUI Plugin] Manga plugin | mastertea | Plugins | 2 | Yesterday 08:44 AM |
| [GUI Plugin] KindleUnpack - The Plugin | DiapDealer | Plugins | 470 | 10-26-2021 09:15 AM |
| [GUI Plugin] Save Virtual Libraries To Column (GUI) | chaley | Plugins | 14 | 04-04-2021 06:25 AM |
| [GUI Plugin] Wordpress | frescogamba | Plugins | 11 | 04-06-2015 10:09 PM |
| [GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 01:27 PM |