View Single Post
Old 06-06-2014, 04:27 PM   #16
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,626
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Hi

EDIT

I tested the script on several books and it's OK. One small thing, I realized that it does not convert negative indents like this one (a rare occurrence).
Code:
text-indent: -0.5cm;
For this reason, pingouinux suggests to change this line:
Code:
unit=re.compile('([^\d.]+:\s*)([\d.]+)(cm)?(;\s*)')
with this line (which also simplifies the code)

Code:
unit=re.compile('(.+:\s*)(-?[\d.]+)(cm)?(;\s*)')
roger64 is offline   Reply With Quote