| 
			
			 | 
		#121 | 
| 
			
			
			
			 Chalut o/ 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 486 
				Karma: 678910 
				Join Date: Dec 2017 
				
				
				
				Device: Kobo 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Yes, exactly. 
		
	
		
		
		
		
		
		
		
		
		
		
		
			I have seen in the code comments/doc that the label is the raw name of the column, the prefix being applied only later, which must that Code: 
	if self.is_custom:
        return '#' + self.label
else:
        return self.label
However, on the GUI side, Yes, all works and the name is well prefixed Well, it's only very marginal and obscure, and plugins like 'Manage Series' modify its fields without case. So I think somewhere along the way there and back, we lost a part without realizing it, since the car still runs perfectly. Oops? Last edited by un_pogaz; 01-24-2022 at 06:06 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#122 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525 
				Karma: 8065948 
				Join Date: Jan 2010 
				Location: Notts, England 
				
				
				Device: Kobo Libra 2 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
| 
			
			 | 
		#123 | |
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,216 
				Karma: 1995558 
				Join Date: Aug 2015 
				
				
				
				Device: Kindle 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
  .
		 | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#124 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Released 5.99.4 which fixes reported issues and also implements automatic dark/light mode transition on Windows. Now if you change the system theme calibre will change along with it. This was already implemented for macOS now windows has it too.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#125 | 
| 
			
			
			
			 Chalut o/ 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 486 
				Karma: 678910 
				Join Date: Dec 2017 
				
				
				
				Device: Kobo 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Well, that such an "error" since V2 (I checked) seems to me aberrant. 
		
	
		
		
		
		
		
		
		
		
		
		
		
			We're talking about Calibre, it's monstrous. There must be a reason. After a lot of thinking, I came to the conclusion that this "inconsistency" was there to detect the series indexes, like this: Code: 
	is_float
    cc.label == 'size' or data['datatype'] == 'float' and cc.is_custom and cc.label != 'series_index'
is_series_index
    cc.label == 'series_index' or data['datatype'] == 'float' and not cc.is_custom and not cc.label == 'size')
And to get the name (with prefix of custom), we need to make something a little bigger Code: 
	if self.is_custom or cc.is_float and cc.label not in ['size', 'series_index']:
    return '#' + self.label
else:
    return self.label
'key' created previously, in a different context with differents functions. So if you ever iterate all the field on GUI.db.field_metadata but only process the value (like .values() ), poof, your lost the TRUE identifier of this is a custom. ... Finally, if it's really a bug/blunder: No, don't fixe it. Do like all dev: It's not a bug, it's a feature *magic*. Because otherwise we will not be able to detect if the field is a "true" float or a series_index, as I just did. And I will modify my code to have a private bool that will remember that a custom custom, it will be easier. Last edited by un_pogaz; 01-25-2022 at 07:17 AM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
| 
			
			 | 
		#126 | 
| 
			
			
			
			 Groupie 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 173 
				Karma: 1497966 
				Join Date: Jul 2021 
				
				
				
				Device: N/A 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Hi, Kovid, 
		
	
		
		
		
		
		
		
		
		
		
		
		
			calibre 5.99.4 In a plugin using your Dialog class (from calibre.gui2.widgets2 import Dialog), I still get the error you just corrected in the post 110. After some debug of my code, I found that it is because I use bytearray(self.saveGeometry()) in a dict of dict, instead of a simple dict. I don't know if it worth for you to correct it, in anycase I can work this around easily. example of code : Code: 
	self.windoPos = {}
self.windowPos['geometry'] = bytearray(self.saveGeometry())
gui_prefs.set('main_window', self.windowPos)
Spoiler: 
 With calibre 5.32, it's working OK and gives this structure in the json: Spoiler: 
 If i change the code to Code: 
	gui_prefs.set('main_window' + '-geometry', bytearray(self.saveGeometry()))
Thank you! Last edited by lomkiri; 01-25-2022 at 09:51 AM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#127 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I dont think thats because of geometry, its because of the dockarea being an enum which is not JSON serializable. what you need to do is 
		
	
		
		
		
		
		
		
		
		
		
		
	
	self.windowPos['dockarea'] = whatever.value  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#128 | |
| 
			
			
			
			 Chalut o/ 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 486 
				Karma: 678910 
				Join Date: Dec 2017 
				
				
				
				Device: Kobo 
				
				
				 | 
	
	
	
		
		
			
			 
				
				New kiwidude icons loader
			 
			Quote: 
	
 All you need to do to make it compatible is, inside the genesis function add self.plugin_path as second argument. Code: 
	set_plugin_icon_resources(self.name, self.plugin_path, resources=[]) I can't try to change the theme of my PC, so if anyone is willing to give me feedback. Thanks you EDIT: Oops, first try, fail. I re-up a new version that work really. Last edited by un_pogaz; 01-25-2022 at 01:33 PM.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#129 | |
| 
			
			
			
			 Groupie 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 173 
				Karma: 1497966 
				Join Date: Jul 2021 
				
				
				
				Device: N/A 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Thanks for pointing it, it is now working (but I had to include a test "is_pyqt5", since it cannot be the same code for qt5 and qt6) I wonder what was the pleasure for the PyQt team to complicate the things that much.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#130 | 
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,216 
				Karma: 1995558 
				Join Date: Aug 2015 
				
				
				
				Device: Kindle 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I am not able to open the manage authors dialog. Getting this error: 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Spoiler: 
 
		 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#131 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			this should take care of it: https://github.com/kovidgoyal/calibr...0e5714db3fac8b
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#132 | 
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,216 
				Karma: 1995558 
				Join Date: Aug 2015 
				
				
				
				Device: Kindle 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Thanks for the quick fix.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#133 | 
| 
			
			
			
			 Guru 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 900 
				Karma: 3501166 
				Join Date: Jan 2017 
				Location: Poland 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Related to Qt6.
		 
		
	
		
		
			 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#134 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#135 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,269 
				Karma: 16544702 
				Join Date: Sep 2009 
				Location: UK 
				
				
				Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			In the Editor I tried to use Compare > Options > Beautify files before compare and got this error message:  
		
	
		
		
		
		
		
		
		
		
		
		
		
			Code: 
	calibre, version 5.99.4
ERROR: Unhandled exception: <b>TypeError</b>:QTextDocument.setPlainText(): argument 1 has unexpected type 'bytes'
calibre 5.99.4 Portable embedded-python: True
Windows-10-10.0.19042 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19042')
Python 3.10.1
Windows: ('10', '10.0.19042', '', 'Multiprocessor Free')
Interface language: en_GB
Successfully initialized third party plugins: Device Old Books (0, 6, 0) && Epub2Kepub (0, 1, 0) && EpubCheck (0, 2, 4) && EpubMetadata (0, 1, 0) && EpubModBuild (0, 1, 0) && EpubXCustomMetadata (0, 1, 0) && JS_Editor_Tools (0, 6, 0) && JS_Editor_Utils (0, 1, 0) && JS_Modify_Epub (0, 1, 0) && KePub Input (3, 4, 3) && KePub Metadata Reader (3, 4, 3) && KePub Metadata Writer (3, 4, 3) && KindleUnpack - The Plugin (0, 83, 1) && Kobo Utilities (2, 15, 1) && KoboEject (0, 0, 3) && KoboTouchExtended (3, 5, 4) && Obok DeDRM (7, 2, 99) && ScrambleEbook (0, 5, 3) && Smart_Device_App_CSSAdd (0, 0, 12) && TTS to MP3 (0, 6, 0)
Traceback (most recent call last):
  File "calibre\gui2\tweak_book\diff\main.py", line 350, in toggle_beautify
  File "calibre\gui2\tweak_book\diff\main.py", line 344, in refresh
  File "calibre\gui2\tweak_book\diff\view.py", line 554, in add_diff
  File "calibre\gui2\tweak_book\diff\view.py", line 691, in add_text_diff
  File "calibre\gui2\tweak_book\diff\highlight.py", line 117, in get_highlighter
  File "calibre\gui2\tweak_book\diff\highlight.py", line 27, in __init__
TypeError: QTextDocument.setPlainText(): argument 1 has unexpected type 'bytes'
Last edited by jackie_w; 02-01-2022 at 03:42 PM. Reason: ETA  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
            
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Suggestion for PI Devs | BetterRed | Plugins | 11 | 09-27-2020 07:18 PM | 
| Attn plugin devs: porting to python 3 | kovidgoyal | Plugins | 129 | 06-16-2020 02:31 AM | 
| Attention All Plugin Devs: Remove vestiges from python 2? | KevinH | Plugins | 11 | 05-29-2020 04:16 PM | 
| Plugin Devs: Should we include a License or COPYING file? | KevinH | Plugins | 3 | 08-15-2017 02:09 PM | 
| New Plugin Features in the upcoming Sigil 0.8.900 | KevinH | Plugins | 6 | 09-14-2015 03:48 PM |