05-13-2022, 05:17 AM | #856 | |
Member
Posts: 11
Karma: 10
Join Date: Dec 2021
Device: Kobo Libra 2
|
Quote:
"calibre, version 5.42.0 ERROR: Invalid Python code: The code you created is not valid Python code, with error: 'NoneType' object has no attribute 'split'" Could you please help me? MP |
|
05-13-2022, 10:17 AM | #857 | |
Chalut o/
Posts: 410
Karma: 145324
Join Date: Dec 2017
Device: Kobo
|
Quote:
What language do you use? I update the code modules with a smal fix, but I am really, really intrigued to know more about how this bug happened. |
|
Advert | |
|
05-13-2022, 11:38 AM | #858 |
Member
Posts: 11
Karma: 10
Join Date: Dec 2021
Device: Kobo Libra 2
|
|
05-13-2022, 01:58 PM | #859 |
Chalut o/
Posts: 410
Karma: 145324
Join Date: Dec 2017
Device: Kobo
|
|
05-13-2022, 03:25 PM | #860 |
Wizard
Posts: 1,090
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
|
I can confirm the bug happens to me as well. Also can confirm that your fix solves the problem.
The reason for the bug is that set_translators.lang returns None for people who have English language as their interface language. Both yourself and Terisa de Morgan have languages other than English (languages that need translators), so the bug cannot be caught on your systems. You can test this yourself by temporarily switching to English. |
Advert | |
|
05-13-2022, 04:48 PM | #861 | |
Grand Sorcerer
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Quote:
|
|
05-14-2022, 05:01 PM | #862 | |
Chalut o/
Posts: 410
Karma: 145324
Join Date: Dec 2017
Device: Kobo
|
Quote:
I found it strange because sometimes I test my plugin/module in others languages but I had never seen that because when I switch to English, I use "English (United Kingdom)" which returns en_GB, but there is another "English" (the true default) which gives None. I take note of this subtility. Also, edit my code to not raise a execption with this case. try catch a exception is a emergency solution, not the default or valide way. Last edited by un_pogaz; 05-14-2022 at 05:09 PM. |
|
05-15-2022, 01:32 PM | #863 |
Zealot
Posts: 106
Karma: 4486
Join Date: Mar 2020
Location: Netherlands
Device: i-pad
|
Hi, I've been using action chains for a while now and I have a question, I've been searching online all day, been looking at the template functions, but I can't figure out how they work without an example that make sense.
I just can't find the answer to this question. We all know AO3 is a mess when it comes to tags. So I've created a separate column for them (#ao3tags). Some of them I actually want to use within my column (#genre) others I just want to leave as be. How to I move a number of specific tags from one column to the other with leaving the rest untouched? For example you have the tags Code:
car, tram, train, bike, bus, boat, ferry, cat, dog, Code:
^tram$|^train$|^bus$|^ferry$ Code:
#ao3tags Code:
#genre Obviously you won't see these tags in a fanfic, but it illustrates the purpose. I've tried using the search and replace, but the problem is that it not only amends and moves the tags I want, but also the ones I don't want in my 2nd column. Can this be done using template functions, and if so can you code different replacements within the same template? |
05-15-2022, 01:46 PM | #864 |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Off the top of my head, you can do this in search & replace.
Search field: template Search template: program: list_intersection($#ao3tags, 'tram, train, bus, ferry', ',') Search for: (^.*$) Replace with: \1 Destination field: #genre Mode: Append to field The template produces a list of acceptable values (the second parameter) from tags. The rest S&R appends that list to #genre. Duplicates will be removed in that process. EDIT: You didn't say if you want to use Action Chains Single Field Edit. If you do then this template should work Code:
program: a = list_intersection($ao3tags, 'tram, train, bus, ferry', ','); list_union($#genre, a, ',') Last edited by chaley; 05-15-2022 at 02:03 PM. Reason: Corrected the tag name, added template suitable for single field edit |
05-15-2022, 03:21 PM | #865 | |
Zealot
Posts: 106
Karma: 4486
Join Date: Mar 2020
Location: Netherlands
Device: i-pad
|
Quote:
|
|
05-16-2022, 04:14 PM | #866 |
Zealot
Posts: 106
Karma: 4486
Join Date: Mar 2020
Location: Netherlands
Device: i-pad
|
So I have a question why is it not possible to amend listed items in items editor, under predefined values?
Every time, I want to change it/add a value, I get asked to discard the values and I have to start all over again. Is there a way to change this, so you can amend the list rather then discard it? |
06-25-2022, 09:03 AM | #867 |
Zealot
Posts: 106
Karma: 4486
Join Date: Mar 2020
Location: Netherlands
Device: i-pad
|
Remove all tags but leave X, Y, Z
So I find action chains very useful, but right now I'm stuck on something. I've use the chains to amend certain tags to something a bit more generic. So for example, I've changed all categories from Supergirl, Supercorp, Danvers into Arrowverse, and Clexa, 100, Ranya into the 100 etc. etc. But there are still tags that are useless such as 'more tags will be added', 'other' or tags that actually belong to the characters rather then category, which I've also tackled with the action chains. But in the end I want Action Chains to remove all tags from category but leave 'the 100' and 'Arrowverse'
I've found a way to remove 'all' tags or remove 'certain' tags but not 'all but' X, Y, Z. Could use your help on this one. |
06-25-2022, 09:24 AM | #868 | |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: list_intersection($tags, 'X, Y, Z', ',') |
|
06-25-2022, 10:09 AM | #869 | |
Zealot
Posts: 106
Karma: 4486
Join Date: Mar 2020
Location: Netherlands
Device: i-pad
|
Quote:
Works perfect except for one little snag, where I had to circumvent an ' in one of the tags with a \ like in regex. Last edited by ackomb; 06-25-2022 at 10:54 AM. |
|
06-25-2022, 04:57 PM | #870 |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Another way to handle that is to use " as a string delimiter instead of '. Example: "a, b'c, d" is valid without the escapes. If the string contains both " and ' characters then you must escape one of them.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Editor Plugin] Editor Chains | capink | Plugins | 82 | 04-02-2024 10:56 AM |
Action Chains Resources | capink | Plugins | 54 | 01-29-2024 11:24 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 |