Module Utils :: Class utils
[hide private]
[frames] | no frames]

Class utils

source code

This class groups a set of useful methods used in other classes to manipulate data.

Instance Methods [hide private]
 
__init__(self)
Constructor, nothing to setup
source code
 
fixFloatingPoint(self, number)
This function addresses the floating point representation in Python It takes a float or double and turns it into its fixed representation.
source code
 
getRelativePath(self, filename) source code
 
getPythonFormat(self, mapped_type, mapped_endianness)
In the XML map schema the data types are named after C conventions i.e.
source code
 
inflate(self, compressed_bytes)
Decompress streams of bytes using the zlib library zip,inflate compression supported
source code
 
getXMLattribute(self, node, attribute)
This function return the value of an attribute in a XML node; also handles "key error" in case the node does not contain that attribute
source code
 
createCSVfromTable(self, table, file_name)
Creates a CSV file from a python table.
source code
 
createPlainDatFile(self, buffer, file_name)
Writes the content of a buffer in a .dat file
source code
 
inflate64(self, b64string) source code
Method Details [hide private]

fixFloatingPoint(self, number)

source code 

This function addresses the floating point representation in Python It takes a float or double and turns it into its fixed representation. i.e. 0.01 is represented as 1.0000000475 or 1.00000001 depending on the hardware The function will return 0.01; the precision used is 1/100 000

getPythonFormat(self, mapped_type, mapped_endianness)

source code 

In the XML map schema the data types are named after C conventions i.e. 2 byte integers are 'int16' This function returns the Python data type.