| 
			
			 | 
		#16 | 
| 
			
			
			
			 Sigil Developer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,072 
				Karma: 6361556 
				Join Date: Nov 2009 
				
				
				
				Device: many 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			That is a python 3 error message when a bytes object is added to a string object.  My guess is that the prefs are being read in as bytes for some reason and can't be directly concatenated without a call to decode.  But this is only a wild guess.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#17 | |
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,763 
				Karma: 24088559 
				Join Date: Dec 2010 
				
				
				
				Device: Kindle PW2 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 If you're still getting the error message, please post the stylesheet that caused the error message.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#18 | 
| 
			
			
			
			 Member 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 16 
				Karma: 1422 
				Join Date: Mar 2016 
				
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Is the last version, I downloaded it tonight, I deleted and reinstalled it but I got the same message. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	The CSS is: https://www.dropbox.com/s/d2n6iv1815...stili.css?dl=0 PS thanks for the fast reply  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#19 | 
| 
			
			
			
			 Sigil Developer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,072 
				Karma: 6361556 
				Join Date: Nov 2009 
				
				
				
				Device: many 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Is the b byte indicator needed here?  See plugin.py 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Code: 
	def get_css_output_prefs(bk):
    prefs = bk.getPrefs()
    prefs.defaults['indent'] = "\t" #2 * ' '
    prefs.defaults['indentClosingBrace'] = False
    prefs.defaults['keepEmptyRules'] = True
    prefs.defaults['omitLastSemicolon'] = False
    prefs.defaults['omitLeadingZero'] = False
    prefs.defaults['blankLinesAfterRules'] = 1 * b'\n'
    prefs.defaults['formatUnknownRules'] = False
    return prefs
 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#20 | 
| 
			
			
			
			 Connoisseur 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 50 
				Karma: 605108 
				Join Date: Apr 2016 
				
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Yes, that 'b' is the problem. Already fixed on github but I didn't find the time to upload a new release yet (I'll do it this evening).  
		
	
		
		
		
		
		
		
		
		
		
		
	
	In the meanwhile, in order to bypass the problem, you can just open the preferences dialog and click on "save and continue" (incorrect string type is only on default values, and the plugin uses them only when no preferences file exists).  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#21 | 
| 
			
			
			
			 Connoisseur 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 50 
				Karma: 605108 
				Join Date: Apr 2016 
				
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Just uploaded version 0.2.2 with the fix.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#22 | 
| 
			
			
			
			 Connoisseur 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 50 
				Karma: 605108 
				Join Date: Apr 2016 
				
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Just uploaded v0.2.3 of the plugin to guarantee compatibility with Sigil v0.9.7, that changes reading mode of stylesheet files.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#23 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,891 
				Karma: 207182180 
				Join Date: Jan 2010 
				
				
				
				Device: Nexus 7, Kindle Fire HD 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			For what it's worth, the .decode() bit was never working correctly on Linux even before Sigil v0.9.7. I had to remove .decode() from two places to get cssRemoveUnusedSelectors v0.2.2 to work with Sigil 0.9.6 on Linux (similar to your 0.2.3 modification). I never got around to mentioning that. Sorry. I can verify that v0.2.3 does work "out of the box" on Sigil v0.9.7 on Linux, though. Thanks.
		 
		
	
		
		
		
		
		
		
		
		
		
		
		
			Last edited by DiapDealer; 10-30-2016 at 01:50 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#24 | 
| 
			
			
			
			 Connoisseur 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 50 
				Karma: 605108 
				Join Date: Apr 2016 
				
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Strange. To me it always worked correctly on Ubuntu. Anyway, glad that the new version is OK, thanks for testing.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#25 | 
| 
			
			
			
			 Connoisseur 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 50 
				Karma: 605108 
				Join Date: Apr 2016 
				
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Uploaded the version 0.3.0 of the plugin, which can parse xml files in epub (not only xhtml), has a more robust handling of css namespaces and is licensed as free software (GPLv3).
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#26 | 
| 
			
			
			
			 A Hairy Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,397 
				Karma: 20212733 
				Join Date: Dec 2012 
				Location: Charleston, SC today 
				
				
				Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Hi, the plugin gave an error notice to the following css styles: 
		
	
		
		
			Code: 
	color:RGB(0,124,196) Code: 
	.HC      {color:RGB(239,50,36); font-size:1.1em; line-height:1.5}
.HC em   {color:RGB(136,137,140)}
.HC span {color:RGB(0,124,196)} 
.HC img  {max-width:20px; max-height:23px}
Last edited by Turtle91; 05-19-2018 at 05:54 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#27 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,763 
				Karma: 24088559 
				Join Date: Dec 2010 
				
				
				
				Device: Kindle PW2 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#28 | 
| 
			
			
			
			 Connoisseur 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 50 
				Karma: 605108 
				Join Date: Apr 2016 
				
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Yes, that seems to be a bug in cssutils that does a case sensitive match with 'rgb(', 'rgba(' and relatives, while it should be ASCII case insensitive. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	I'll file a bug report to cssutils. In the meantime the workaround is, as suggested by Doitsu, to use only lowercase characters for color functions. (I think that the patch in cssutils should be something like this... In cssutils/css/value.py, in method _setCssText of class ColorValue: Code: 
	noalp = Sequence(Prod(name='FUNCTION',
                      match=lambda t, v: t == types.FUNCTION and
                                              v in ('rgb(', 'hsl('),
...
witha = Sequence(Prod(name='FUNCTION',
                      match=lambda t, v: t == types.FUNCTION and
                                              v in ('rgba(', 'hsla('),
Code: 
	noalp = Sequence(Prod(name='FUNCTION',
                      match=lambda t, v: t == types.FUNCTION and
                                              v.lower() in ('rgb(', 'hsl('),
...
witha = Sequence(Prod(name='FUNCTION',
                      match=lambda t, v: t == types.FUNCTION and
                                              v.lower() in ('rgba(', 'hsla('),
Thanks for the bug report!  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#29 | 
| 
			
			
			
			 A Hairy Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,397 
				Karma: 20212733 
				Join Date: Dec 2012 
				Location: Charleston, SC today 
				
				
				Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			That did the trick! Thanks!!
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#30 | 
| 
			
			
			
			 Bibliophagist 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 48,175 
				Karma: 174315444 
				Join Date: Jul 2010 
				Location: Vancouver 
				
				
				Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Sounds much like what one instructor told a class I was in, "The CSS specification says 'All CSS style sheets are case-insensitive' and goes on to say 'element names are case-insensitive in HTML, but case-sensitive in XML' so don't use anything but lowercase unless absolutely needed since I will guarantee that it will bite you in the butt." 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Admittedly, his favourite t-shirt read "Murphy was a raving optimist".  
		 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
            
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| [GUI Plugin] KindleUnpack - The Plugin | DiapDealer | Plugins | 527 | 08-15-2025 02:36 PM | 
| [FileType Plugin] YVES Bible Plugin | ClashTheBunny | Plugins | 27 | 01-16-2023 02:25 AM | 
| Plugin not customizable: Plugin: HTML Output does not need customization | flyingfoxlee | Conversion | 2 | 02-24-2012 03:24 AM | 
| [GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 01:27 PM | 
| New Plugin Type Idea: Library Plugin | cgranade | Plugins | 3 | 09-15-2010 01:11 PM |