![]() |
#16 | |||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,635
Karma: 23190435
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. |
|||
![]() |
![]() |
![]() |
#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 03:34 PM. |
![]() |
![]() |
![]() |
#18 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,635
Karma: 23190435
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 02:39 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',... |
|
![]() |
![]() |
![]() |
#20 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,635
Karma: 23190435
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
No idea. I usually attach files with different file names. |
|
![]() |
![]() |
![]() |
#21 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 183
Karma: 266070
Join Date: Dec 2010
Device: Win7,Win10,Lubuntu,smartphone
|
Thanks! Attaching the corrected version.
|
![]() |
![]() |
![]() |
#22 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 673
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> |
|
![]() |
![]() |
![]() |
#23 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,663
Karma: 134319570
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#24 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 38,882
Karma: 153006036
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
|
![]() |
![]() |
![]() |
#25 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 673
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-01-2020 at 11:30 PM. |
|
![]() |
![]() |
![]() |
#26 |
Member
![]() Posts: 12
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.
|
![]() |
![]() |
![]() |
#27 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
Join Date: Nov 2009
Device: many
|
|
![]() |
![]() |
![]() |
#28 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,818
Karma: 198099188
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. |
![]() |
![]() |
![]() |
#29 |
Member
![]() Posts: 12
Karma: 10
Join Date: Sep 2012
Location: Sri Lanka
Device: none
|
wups. Sorry, fellas.
|
![]() |
![]() |
![]() |
#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?
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pseudo classes to be deleted as unused classes | Leonatus | Sigil | 2 | 09-23-2018 09:12 AM |
Calibre conversion adding classes and screwing the layout? | 1v4n0 | Conversion | 6 | 01-29-2015 12:57 PM |
Calibre Inserting Its Own CSS Classes | Xopher H | Conversion | 2 | 08-02-2011 10:21 PM |
possible to change classes name,id,stylename that generated by calibre? | hard13 | Conversion | 2 | 02-24-2011 09:23 PM |
keeping or removing a div with multiple classes | JohnsonZA | Recipes | 1 | 09-25-2010 10:33 AM |