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 06-06-2024, 11:17 AM   #1366
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,124
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by Zillion_ View Post
Hello,

since recently I'm getting the following error when running Chains from the main Calibre window, which call Editor change which include other Editor chains (worked fine before).
Any idea what's wrong please ? I've tried editing the chains and removing actions one by one but it doesn't help...
Spoiler:


calibre, version 7.12.0
ERROR: Unhandled exception: <b>TypeError</b>:cannot pickle 'ChainInterfaceAction' object

calibre 7.12 embedded-python: True
Windows-10-10.0.19045-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19045')
Python 3.11.5
Windows: ('10', '10.0.19045', 'SP0', 'Multiprocessor Free')
Interface language: None
EXE path: C:\Program Files\Calibre2\calibre.exe
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (2, 12, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (2, 12, 0) && Action Chains (1, 20, 4) && Amazon.com Multiple Countries (1, 0, 0) && Annotations (1, 17, 13) && BOL_NL (5, 1, 3) && Baen (1, 1, 0) && Barnes & Noble (1, 5, 5) && CalibreSpy (1, 0, 92) && Count Pages (1, 13, 6) && Editor Chains (1, 1, 7) && EpubSplit (3, 7, 0) && Fantastic Fiction (1, 7, 0) && Favourites Menu (1, 3, 1) && FictionDB (1, 4, 2) && Find Duplicates (1, 10, 9) && Generate Cover (2, 3, 4) && Goodreads (1, 8, 1) && Goodreads More Tags (1, 2, 1) && ISFDB3 (1, 4, 0) && Job Spy (1, 0, 239) && KFX metadata reader (from KFX Input) (2, 12, 0) && From KFX (2, 12, 0) && KFX Input (2, 12, 0) && Set KFX metadata (from KFX Output) (2, 8, 0) && KFX Output (2, 8, 0) && Kindle hi-res covers (0, 5, 1) && KindleUnpack - The Plugin (0, 83, 1) && Kobo Books (1, 9, 2) && Last Modified (0, 8, 5) && Manage Series (1, 5, 2) && Modify ePub (1, 8, 3) && Open With (1, 8, 3) && Prettify Cover (1, 6, 0) && Quality Check (1, 13, 10) && Quick Preferences (1, 7, 1) && Reading List (1, 15, 4) && Reformat plugin (2, 4, 0) && Resize Cover (1, 2, 1) && Save To Format (0, 0, 6) && Search The Internet (1, 11, 2) && Skoob Books (1, 5, 5) && SmartEject (2, 5, 0) && TextDiff (1, 2, 4) && User Category (1, 6, 1) && View Manager (1, 10, 3)
Traceback (most recent call last):
File "calibre_plugins.action_chains.action", line 452, in run_chain
File "calibre_plugins.action_chains.chains", line 457, in run
File "calibre_plugins.action_chains.chains", line 239, in _run_loop
File "calibre_plugins.action_chains.chains", line 209, in _run_loop
File "calibre_plugins.editor_chains.action_chains", line 416, in run
File "calibre_plugins.editor_chains.headless", line 53, in run_editor_chain
File "calibre_plugins.editor_chains.chains", line 354, in run
File "calibre_plugins.editor_chains.chains", line 219, in _run_loop
File "calibre_plugins.editor_chains.chains", line 196, in _run_loop
File "calibre_plugins.editor_chains.actions.chain_calle r", line 150, in run
File "copy.py", line 146, in deepcopy
File "copy.py", line 231, in _deepcopy_dict
File "copy.py", line 146, in deepcopy
File "copy.py", line 231, in _deepcopy_dict
File "copy.py", line 172, in deepcopy
File "copy.py", line 271, in _reconstruct
File "copy.py", line 146, in deepcopy
File "copy.py", line 231, in _deepcopy_dict
File "copy.py", line 161, in deepcopy
TypeError: cannot pickle 'ChainInterfaceAction' object
Try version attached and report whether it solves the issue.

Last edited by capink; 06-10-2024 at 08:20 AM. Reason: Remove zip attachment
capink is offline   Reply With Quote
Old 06-10-2024, 03:53 AM   #1367
Zillion_
Enthusiast
Zillion_ began at the beginning.
 
Posts: 29
Karma: 10
Join Date: Jul 2023
Device: KindleOasis10thGen
Thumbs up Thanks !

Yes indeed, that fixes it !
Many thanks, capink

Zillion_ is offline   Reply With Quote
Old 06-27-2024, 10:09 AM   #1368
noahkiss
Junior Member
noahkiss began at the beginning.
 
Posts: 2
Karma: 10
Join Date: May 2024
Device: Kobo Clara Colour, Kindle Oasis
Question

hey all, sorry for the silly question. I've tried searching here and reviewing the template page, but I'm still stuck.

All I'm trying to do is find any $title which contains a colon or a hyphen, and move the second half to a custom #subtitle field.

Right now I have the find & replace working fine - the regex I use is two-stage (I don't know how to do it in one stage with the search and replace action) where I search for .+ ?[:-] (.+) and put the first match into the #subtitle field, then do a second search for (.+) ?[:-] .+ and replace the $title field with the first match, to remove the subtitle.

I'm trying to move these two saved searches into an action chain, though, and therefore I'd like to be able to just run it on any selection in my library. With the way I have it configured, though, this causes issues on books which don't have a [:-] in the title, due to how search & replace seems to work (if no capture groups exist, \1 just matches the whole search, so the full title will be transferred into #subtitle).

Anyway, what I'm trying to do now is to use a template scope to filter the action to only run on titles which contain [:-].

The problem I'm having is that I guess I'm just dumb and I can't figure out how exactly to just use a template to limit to a subset of my current scope. There's a contains(), but that seems to just give back text. I've tried downloading and reviewing a few chains posted here that have scopes, but it doesn't make much sense to me. I guess I haven't wrapped my brain around exactly how calibre templates work.

I'm sure this can all be done in one step, the main thing I have difficulty understanding is how incoming and outgoing variables are handled, or basically the 'state' of everything that I'm acting on.

Thanks for reading!

Last edited by noahkiss; 06-27-2024 at 10:13 AM. Reason: trying to fix formatting
noahkiss is offline   Reply With Quote
Old 06-27-2024, 02:19 PM   #1369
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,124
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by noahkiss View Post
Anyway, what I'm trying to do now is to use a template scope to filter the action to only run on titles which contain [:-].
You don't need to use templates for this. You can use Basic scope with the following search:

Code:
title:~.+:.+
Attached Thumbnails
Click image for larger version

Name:	Screenshot_20240627_211649.jpg
Views:	23
Size:	74.5 KB
ID:	209211  
capink is offline   Reply With Quote
Old Yesterday, 06:24 PM   #1370
tkshorty
Junior Member
tkshorty began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jun 2024
Device: Koba Aura
Hi all,

I am pretty sure that there is a really simple way to do this if you know Python and the calibre classes. Sadly I don't
So here is what I want to do:
1. display a message after a chain is completed and user has to press ok to close the message
2. display a message after a chain is completed and user has to press ok to close the message or message closes automatically after X seconds
3. query the user with a yes / no question and call a chain depending on answer (without using a new custom field to do that)
tkshorty is offline   Reply With Quote
Old Yesterday, 07:37 PM   #1371
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,124
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by tkshorty View Post
Hi all,

I am pretty sure that there is a really simple way to do this if you know Python and the calibre classes. Sadly I don't
So here is what I want to do:
1. display a message after a chain is completed and user has to press ok to close the message
2. display a message after a chain is completed and user has to press ok to close the message or message closes automatically after X seconds
3. query the user with a yes / no question and call a chain depending on answer (without using a new custom field to do that)
You can do no.1 and no.3 with this custom module. To add the module, go to Action Chains > Manage Modules > add > copy/paste. After which a new custom action called "Confirm" will be added, and can be used to splash a yes/no message with a customized message.

As for no.2 you simply add another "Run Python Code" action, with the following code:

Code:
import time

def run(gui, settings, chain):
    time.sleep(5)
Replace the digit in red with how many seconds you want.
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 04:49 AM.


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