View Single Post
Old 11-10-2013, 10:55 AM   #11
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: 7,603
Karma: 5433388
Join Date: Nov 2009
Device: many
dualmetafix.py v003

I had some more spare time and adding in some basic error testing and attempted to make things unicode safe by grabbing all arguments as utf-8 encoded and converting paths to full unicode only when needed.

So I would say this is now beta quality. Still not pretty. Still a real mishmash.

The palm database access stuff would be better as its own class and and the header and exth should all probably be their own classes as well to encapsulate the access routines.

Oh well. Please give this a try and let me know what troubles you run into. I am sure there are ways to speed this up as well by memory mapping the file and replacing specific sections directly in memory as opposed to using python strings but let's see if this works and is fast enough for what is needed.

Attached is dualmetafix.py version v003
Attached Files
File Type: zip dualmetafix.zip (3.8 KB, 288 views)
KevinH is online now   Reply With Quote