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
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.