04-11-2020, 04:25 AM | #16 | |||
Grand Sorcerer
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Code:
ttags = [True,prefs['tags'].split(',')][len(prefs['tags']) > 0 or 0] # evaluates to 1|0 for tags|no tags Quote:
Quote:
BTW, one other free Python book I can highly recommend is Automate the Boring Stuff with Python by Al Sweigart, which is available online and as a paid e-book. |
|||
04-11-2020, 01:54 PM | #17 |
Groupie
Posts: 183
Karma: 266070
Join Date: Dec 2010
Device: Win7,Win10,Lubuntu,smartphone
|
Well, attached is a new version, with:
- Option 'no tags' removed--it couldn't even be reported, lacking a list of tags for reference. - Added a message (Qt) with buttons to choose on the fly if run only for reports (default -> OK) or to apply the changes (Cancel). That would be useful before choosing to add/remove tags from preferences. - Changed the versioning: this is v1_0, (implicitly making previous ones 0_x) - Automatically sort the tag list (easier to inspect/edit), besides trying to ensure that it works. Unfortunately, as it MUST be a comma-separated list, without spaces, the code is quite clumsy. A less unwieldy alternative would be appreciated. Spoiler:
* Query: are buttons of the message easy to understand, o rather counter-intuitive? Last edited by carmenchu; 04-11-2020 at 04:34 PM. |
Advert | |
|
04-11-2020, 02:35 PM | #18 | ||
Grand Sorcerer
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Quote:
Code:
msg.setStandardButtons(QMessageBox.Yes | QMessageBox.No) testmode = [0,1][msg.exec_()== QMessageBox.Yes] Last edited by Doitsu; 04-11-2020 at 03:39 PM. |
||
04-11-2020, 03:33 PM | #19 | |
Groupie
Posts: 183
Karma: 266070
Join Date: Dec 2010
Device: Win7,Win10,Lubuntu,smartphone
|
Quote:
And, BTW, is there an equally simple way to substite the default icon of the message box (quite horrid, at least in my win10) with the plug-in icon, for instance? If yes, I would wait to update the upload... *Query*: uploading a new file with the name, would result in updating the previous attachment, or must one attach again? My ignorance Good to know: but think of the irritation of having to manually add 3 more tags to 'a','br','b',... |
|
04-11-2020, 04:23 PM | #20 | |
Grand Sorcerer
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
No idea. I usually attach files with different file names. |
|
Advert | |
|
04-11-2020, 04:30 PM | #21 |
Groupie
Posts: 183
Karma: 266070
Join Date: Dec 2010
Device: Win7,Win10,Lubuntu,smartphone
|
Thanks! Attaching the corrected version.
|
05-14-2020, 02:44 PM | #22 | |
Guru
Posts: 677
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
So this strips <i class="calibreX"> to <i>? Occasionally, I see cases where the style makes it bold italic, not just italic. Generally that seems to be set on words in a longer bold passage: Code:
<p><b>Words in bold</b><i class=CalibreX">words bold italic</i><b> More bold</b></p> |
|
05-14-2020, 03:40 PM | #23 | |
Resident Curmudgeon
Posts: 76,474
Karma: 136564766
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
05-14-2020, 05:48 PM | #24 |
Bibliophagist
Posts: 40,588
Karma: 157444382
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
|
06-01-2020, 11:35 PM | #25 | |
Guru
Posts: 677
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Can I suggest you update the first post in the thread so it always has the latest version.
Wishlist for other "fixes": Calibre seems to always name the cover "titlepage.xhtml", which is really grating to me, since it's not the title page. I always rename it to cover.xhtml (except if there is already a cover.xhtml). Can that be an option? Seems that Calibre always adds "display: block;" to style definitions. Can that be removed optionally? The <body> tag is invariably <body class="calibre"> Can that be made just <body> and the style .calibre renamed "body"? Quote:
Has anyone ever asked Kovid why Calibre does these redundant styles? Does Calibre still do it? It's not hard to fix by S&R, but it does get tedious. But I can't see the structure of the file until I clean away all the cruft. Last edited by AlanHK; 06-02-2020 at 12:30 AM. |
|
05-09-2023, 12:15 AM | #26 |
Member
Posts: 13
Karma: 10
Join Date: Sep 2012
Location: Sri Lanka
Device: none
|
Tried to add the redundant1 plug-n, but got this error: InvalidPlugin:The plugin in ... redundanti8_v1.zip is invalid. It does not contain a top-level _init_.py file.
|
05-09-2023, 10:16 AM | #27 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
|
05-09-2023, 10:21 AM | #28 |
Grand Sorcerer
Posts: 28,042
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
And it shouldn't. Sigil plugins don't contain a top-level __init__.py file. Note that you also should not unzip, or alter the plugin archive in any way--including renaming the archive. Some browser download "helpers" rename files automatically.
EDIT: Ahh... as Kevin noted, it does indeed seem as if you are trying to install a Sigil plugin into calibre. That definitely will not work. |
05-09-2023, 01:07 PM | #29 |
Member
Posts: 13
Karma: 10
Join Date: Sep 2012
Location: Sri Lanka
Device: none
|
wups. Sorry, fellas.
|
09-24-2023, 06:30 AM | #30 |
Junior Member
Posts: 4
Karma: 10
Join Date: Jan 2023
Device: none
|
Is it possible to add an option in RedundantI to add more Calibre tags like body, headers, metadata and dc:identifier?
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pseudo classes to be deleted as unused classes | Leonatus | Sigil | 2 | 09-23-2018 10:12 AM |
Calibre conversion adding classes and screwing the layout? | 1v4n0 | Conversion | 6 | 01-29-2015 01:57 PM |
Calibre Inserting Its Own CSS Classes | Xopher H | Conversion | 2 | 08-02-2011 11:21 PM |
possible to change classes name,id,stylename that generated by calibre? | hard13 | Conversion | 2 | 02-24-2011 10:23 PM |
keeping or removing a div with multiple classes | JohnsonZA | Recipes | 1 | 09-25-2010 11:33 AM |