View Single Post
Old 07-09-2014, 11:52 AM   #884
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,937
Karma: 6361444
Join Date: Nov 2009
Device: many
Hi,

Yes, we can set empty tattr to {} and not None.
Simply remove this line from near the end of parsetag():

Code:
if tattr is not None and len(tattr)== 0: tattr = None
Yes, that will make it simpler not to have to test for tattr not being None all of the time.

Kevin

Quote:
Originally Posted by tkeo View Post
Hi Kevin,

It seems you made tattr = None if it is empty intentionally.
Is it better to keep tattr = {} since None type errors occur?
I have encounterd the errors with <spine> and <dc:format/>.

Thanks,

EDIT
I have nomore time to read your post tonight. I will answer tomorrow.
PS: Attached is a patch to v072x that will add linear and deal with the coverpage as well as clean up a few nits. Please apply it and see if it deals with the issues you have mentioned and if not we can modify it as needed. I have changed the coverpage code in kindleunpack to let the k8resc object do the necessary prepending to the order so that class data it is better encapsulated.
Attached Files
File Type: zip changes.txt.zip (2.4 KB, 228 views)

Last edited by KevinH; 07-09-2014 at 02:54 PM.
KevinH is offline   Reply With Quote