Package src :: Package inspectors :: Module conversions
[hide private]
[frames] | no frames]

Module conversions

source code

The module is for conversions. There is functions for convert the measure to right dimension.


Author: Vili Auvinen, Olli Kauppinen, Juho Tammela

Functions [hide private]
string
convertCmOrInToPt(value)
Converts a value in centimeters or inches to points.
source code
 
convertPtToCm(pt) source code
 
convertPtToTwip(pt) source code
 
convertTwipToPt(twips) source code
 
convertCmToTwip(cm) source code
 
convertTwipToCm(twips) source code
 
convertTwipToInch(twips) source code
 
convertInchToTwip(inches) source code
 
convertPercentToDecimal(percent)
Converts a percent to a decimal format.
source code
string
convertCmOrInToString(value, decimals=1)
Converts the value in centimeters or inches to the string format.
source code
 
convertCmOrInDictToString(convertedDict, decimals=1)
Converts dictionary's value in centimeters or inches to the string format.
source code
Variables [hide private]
  __package__ = None
Function Details [hide private]

convertCmOrInToPt(value)

source code 

Converts a value in centimeters or inches to points.

Parameters:
  • value - the string contains a value centimeter or inches with 'cm' or 'in' after the value.
Returns: string
converted value in points (pt).

Note: XML-example: <style:paragraph-properties fo:margin-top="0.39cm" </style:paragraph-properties>

convertPercentToDecimal(percent)

source code 

Converts a percent to a decimal format.

Returns:
The value in decimal format.

convertCmOrInToString(value, decimals=1)

source code 

Converts the value in centimeters or inches to the string format.

Parameters:
  • value - the string contains centimeter or inches with 'cm' or 'in' after value.
  • decimals - the number of the decimals (default 1).
Returns: string
The value in centimeters.

convertCmOrInDictToString(convertedDict, decimals=1)

source code 

Converts dictionary's value in centimeters or inches to the string format.

Parameters:
  • convertedDict - The dictionary contains centimeter or inches with 'cm' or 'in' as values.
  • decimals - the number of the decimals (default 1).
Returns:
Converted dictionary in centimeters.