@DiapDealer: While it is certainly true that using code from the conversion pipeline is not always possible standalone, in this case you can do it with the container pretty easily, like this (insert the following into my previous example:
Code:
# assume we have a parsed stylesheet as I showed before
for rule in sheet.cssRules:
if rule.type == rule.STYLE_RULE:
for property in rule.style.keys():
val = property.propertyValue
for x in val:
if x.type == 'DIMENSION' and x.unit == 'cm':
x.cssText = convert(x.value ) # Here convert should convert a float into a string in em units
container.dirty(sheet_name)
This is ofcourse, only a skeleton, it does not handle @media rules or <style> tags or style attributes, but those are all equally trivial, just look around in the files inthe polish directory to learn how to iterate over them.