09-04-2019, 12:55 AM | #31 |
just an egg
Posts: 1,599
Karma: 4798866
Join Date: Mar 2015
Device: Kindle, iOS
|
Greetings!
This wonderful plug-in is failing when I run it in Sigil 0.9.18 :( Here's the error message: Code:
Status: failed Traceback (most recent call last): File "/Applications/Sigil.app/Contents/plugin_launchers/python/launcher.py", line 135, in launch self.exitcode = target_script.run(container) File "/Users/oda/Library/Application Support/sigil-ebook/sigil/plugins/cssRemoveUnusedSelectors/plugin.py", line 600, in run css_to_change[sel_data[0]] = sel_data[4].cssText File "site-packages/css_parser/css/cssstylesheet.py", line 139, in _getCssText File "/Users/oda/Library/Application Support/sigil-ebook/sigil/plugins/cssRemoveUnusedSelectors/customCssutils.py", line 53, in do_CSSStyleSheet text = self._linenumnbers(self.prefs.lineSeparator.join(out)) AttributeError: 'MyCSSSerializer' object has no attribute '_linenumnbers' Error: 'MyCSSSerializer' object has no attribute '_linenumnbers' Last edited by odamizu; 09-04-2019 at 01:51 AM. |
09-04-2019, 01:37 AM | #32 | |
Grand Sorcerer
Posts: 5,611
Karma: 23187563
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
from Code:
text = self._linenumnbers(self.prefs.lineSeparator.join(out))
to: Code:
text = self._linenumbers(self.prefs.lineSeparator.join(out)) |
|
Advert | |
|
09-04-2019, 01:50 AM | #33 |
just an egg
Posts: 1,599
Karma: 4798866
Join Date: Mar 2015
Device: Kindle, iOS
|
|
09-04-2019, 04:42 AM | #34 |
Enthusiast
Posts: 34
Karma: 467802
Join Date: Apr 2016
Device: none
|
That was a systematic typo in cssutils that some overzealous would-be developer corrected in the upgrade to css-parser...
When I have the time I will add a new version of the plugin that will directly use the new serializer. In the meantime to Doitsu for the ready handmade patch. |
09-04-2019, 10:51 PM | #35 | ||
just an egg
Posts: 1,599
Karma: 4798866
Join Date: Mar 2015
Device: Kindle, iOS
|
Quote:
Quote:
|
||
Advert | |
|
09-07-2019, 05:47 PM | #36 |
Enthusiast
Posts: 34
Karma: 467802
Join Date: Apr 2016
Device: none
|
|
09-07-2019, 06:57 PM | #37 |
Grand Sorcerer
Posts: 27,621
Karma: 194727102
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Just curious: was there some serious jury-rigging you were doing to get cssutils to work (or were you including your own cssutils) or something? just curious why this typo didn't cause trouble before now. We made sure that all calls to import any part of cssutils were hijacked and silently redirected to the equivalent css_parser pieces when we made the change. That was done specifically so any plugins that used cssutils could still work (giving the dev time to change to css_parser at their leisure). Sorry that didn't seem to work for your plugin.
|
09-07-2019, 07:08 PM | #38 |
Sigil Developer
Posts: 7,743
Karma: 5446592
Join Date: Nov 2009
Device: many
|
wrCisco fixed the typo in css-parser when he ported his improvements over for us into css-parser. I had forgotten that typo worked "as is" in cssutils but since it was fixed in css-parser it created this plugin issue which he has now fixed!
|
09-07-2019, 07:43 PM | #39 |
Enthusiast
Posts: 34
Karma: 467802
Join Date: Apr 2016
Device: none
|
The plugin includes a sublcass of the cssutils's serializer, and in that subclass I had to copy some parent's methods in full along with the typo in order to add some lines of code in between to circumvent some issues with the old serializer.
Since the typo was in a private attribute, it's probably just me that's been hit by myself... |
09-07-2019, 08:08 PM | #40 |
Grand Sorcerer
Posts: 27,621
Karma: 194727102
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Ah... I get it now. Thanks! I'd forgotten you were the one who was helping Kevin and Kovid get css-parser up and going.
|
09-08-2019, 01:26 AM | #41 |
just an egg
Posts: 1,599
Karma: 4798866
Join Date: Mar 2015
Device: Kindle, iOS
|
|
06-25-2020, 10:37 AM | #42 |
Connoisseur
Posts: 56
Karma: 7130
Join Date: Apr 2015
Device: PRS-T3
|
Hi wrCisco,
Could you also add a feature that does the opposite, i.e. looks in the html/xhtml/xml files for classes that are used in these files, but do not have a corresponding defintion in the css file? I've downloaded several ebook from gutenberg.org, which did not provide definitions for all classes used in the html/... files. Since I guess that the creator intended to have a special formating of the corresponding text passages, but forgot to add the defintions to the css, it would be good to be informed about the missing defintions to be able to format these passages. Regards, McDummy |
06-25-2020, 12:16 PM | #43 | |
Bibliophagist
Posts: 36,873
Karma: 147879470
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
And yes, this is a commercial book I'm cleaning up for my wife.. If you want really bad examples, check for ebooks created by Vellum. |
|
06-25-2020, 12:39 PM | #44 | |
Running with scissors
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
|
Quote:
|
|
06-25-2020, 01:07 PM | #45 | ||
Bibliophagist
Posts: 36,873
Karma: 147879470
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
Quote:
|
||
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] KindleUnpack - The Plugin | DiapDealer | Plugins | 494 | 05-18-2024 02:34 AM |
[FileType Plugin] YVES Bible Plugin | ClashTheBunny | Plugins | 27 | 01-16-2023 01:25 AM |
Plugin not customizable: Plugin: HTML Output does not need customization | flyingfoxlee | Conversion | 2 | 02-24-2012 02:24 AM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |
New Plugin Type Idea: Library Plugin | cgranade | Plugins | 3 | 09-15-2010 12:11 PM |