![]() |
#226 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
There was a regression in checking templates. Check the new version in the first post, and please report back.
|
![]() |
![]() |
![]() |
#227 |
Interested in the matter
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
|
|
![]() |
![]() |
Advert | |
|
![]() |
#228 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
Code:
program:
add(re(raw_field('#my_int_column'), 'None', 0), 1)
Update: As of calibre 5.13, template language supports several operator types including arithmetic operators. So people using calibre version >= 5.13 can replace the above code with this: Code:
program:
re($$#testint,'None','0') + 1
Last edited by capink; 05-03-2021 at 08:19 PM. |
|
![]() |
![]() |
![]() |
#229 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,000
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Running a chain (by accident, admittedly) with "Open with: Book format" (default application) errors if the book doesn't have the specified format.
Code:
Traceback (most recent call last): File "calibre_plugins.action_chains.action", line 237, in run_chain File "calibre_plugins.action_chains.chain_tools", line 120, in run_loop File "calibre_plugins.action_chains.chain_tools", line 100, in run_loop File "calibre_plugins.action_chains.actions.open_with", line 309, in run File "calibre\gui2\__init__.py", line 1297, in open_local_file File "ntpath.py", line 452, in normpath TypeError: expected str, bytes or os.PathLike object, not NoneType Last edited by ownedbycats; 12-31-2020 at 05:30 AM. |
![]() |
![]() |
![]() |
#230 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
I will look at this and try to handle it more gracefully. But I suggest you set the following condition on the chain to disable it for books that do not have the appropriate format:
Code:
template: Edit1: Modified template to add another test for selection count. Edit2: Remove redundant if statement. Last edited by capink; 01-19-2021 at 10:37 AM. Reason: simplify template |
![]() |
![]() |
Advert | |
|
![]() |
#231 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,000
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Thank you.
To save you a bit of extra testing, I got a different error opening a book cover when there is none: Code:
calibre, version 5.8.1 ERROR: Unhandled exception: <b>IndexError</b>:tuple index out of range calibre 5.8.1 [64bit] embedded-python: True is64bit: True Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.19041') Python 3.8.5 Windows: ('10', '10.0.19041', '', 'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: Action Chains (0, 5, 3) && Barnes & Noble (1, 2, 16) && Calibre Power Search Plugin (1, 7, 0) && Comments Cleaner (1, 3, 1) && Count Pages (1, 11, 0) && Embed Comic Metadata (1, 5, 2) && EpubCheck (0, 2, 3) && EpubMerge (2, 11, 0) && Extract ISBN (1, 5, 0) && FanFicFare (3, 27, 2) && Fantastic Fiction (1, 4, 0) && Favourites Menu (1, 0, 5) && Find Duplicates (1, 8, 3) && Generate Cover (2, 0, 1) && GetFileName (0, 1, 1) && Goodreads (1, 5, 1) && Import List (1, 5, 4) && Job Spy (1, 0, 189) && Kindle hi-res covers (0, 5, 0) && Kobo Books (1, 8, 0) && Kobo Utilities (2, 11, 8) && KoboTouchExtended (3, 4, 2) && Library Codes (1, 0, 50) && Manage Series (1, 2, 11) && Modify ePub (1, 6, 2) && Open With (1, 5, 13) && Quality Check (1, 11, 0) && Reading List (1, 7, 1) && Save To Format (0, 0, 6) && Save Virtual Libraries To Column (2, 0, 1) && Save Virtual Libraries To Column GUI (2, 3, 0) && Search The Internet (1, 8, 1) && SmartEject (2, 3, 0) && Sum Column (0, 3, 1) && View Manager (1, 6, 0) Traceback (most recent call last): File "calibre_plugins.action_chains.actions.open_with", line 283, in run File "calibre_plugins.action_chains.actions.open_with", line 246, in get_file_path calibre_plugins.action_chains.actions.open_with.OpenError: ('Cannot open with', 'Book has no cover') During handling of the above exception, another exception occurred: Traceback (most recent call last): File "calibre_plugins.action_chains.action", line 237, in run_chain File "calibre_plugins.action_chains.chain_tools", line 120, in run_loop File "calibre_plugins.action_chains.chain_tools", line 100, in run_loop File "calibre_plugins.action_chains.actions.open_with", line 288, in run File "calibre\db\legacy.py", line 872, in func File "calibre\db\view.py", line 145, in get_property IndexError: tuple index out of range Last edited by ownedbycats; 12-31-2020 at 02:47 PM. |
![]() |
![]() |
![]() |
#232 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Thanks for your reports, fixed for next release.
|
![]() |
![]() |
![]() |
#233 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,000
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Something I've discovered:
Windows has a limit of 2047 characters in a single command-line prompt. This mostly comes into effect when sending a lot of books to an "open with" action. (This is why I usually run Power Search first, then send the files to Ransack.) Code:
Traceback (most recent call last): File "calibre_plugins.action_chains.action", line 237, in run_chain File "calibre_plugins.action_chains.chain_tools", line 120, in run_loop File "calibre_plugins.action_chains.chain_tools", line 100, in run_loop File "calibre_plugins.action_chains.actions.open_with", line 319, in run File "calibre_plugins.action_chains.actions.open_with", line 361, in launch_app File "subprocess.py", line 854, in __init__ File "subprocess.py", line 1307, in _execute_child FileNotFoundError: [WinError 206] The filename or extension is too long Last edited by ownedbycats; 12-31-2020 at 07:34 PM. |
![]() |
![]() |
![]() |
#234 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
I don't really want to get into platform specific fixes. Maybe will look at this later to see if simple fixes exist. Problem I cannot test on Windows so difficult to do anything.
This link seems to have some solutions, one of them is changing a registry key. Give it a go and see if it helps. |
![]() |
![]() |
![]() |
#235 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,013
Karma: 500000
Join Date: Jun 2015
Device: Rocketbook, kobo aura h2o, kobo forma, kobo libra color
|
windows command line limit: Unix has similar limits I think. Maybe an option (like xargs) to split up the arguments and run the command multiple times? Likely this isn't always a good idea, so I think it needs to be an option. (Or maybe a way to do it slowly?)
|
![]() |
![]() |
![]() |
#236 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,013
Karma: 500000
Join Date: Jun 2015
Device: Rocketbook, kobo aura h2o, kobo forma, kobo libra color
|
I've got a couple of action chains that for various reasons are not able to process every book in the set.
I'd like a way to end the chain with a search for the entire set, but only select the books the chain was able to process, so the user can see the results. It would kind of like need two searches. Like, @fixthese:true and then select marked:updated edit: maybe I can already do this? doing more testing. edit2: One of the chains, I don't know how to do the search, because the last action in the search removes the tag the search is based on. So I'd need tags:updateme or marked:true or something like that. Last edited by compurandom; 01-01-2021 at 10:12 AM. |
![]() |
![]() |
![]() |
#237 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
Last edited by capink; 01-01-2021 at 10:56 AM. |
|
![]() |
![]() |
![]() |
#238 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
|
|
![]() |
![]() |
![]() |
#239 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,013
Karma: 500000
Join Date: Jun 2015
Device: Rocketbook, kobo aura h2o, kobo forma, kobo libra color
|
|
![]() |
![]() |
![]() |
#240 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
If you want all the books, tick the option of all books modified by chain without choosing a search, then in the next action mark them with whatever you want, and then use another selection modifier (or the custom template based search I posted before) that searches for your marked books.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |