DSIMA
 All Classes Namespaces Files Functions Variables
implementation.simulator.src.tools Namespace Reference

Functions

def fileLock
 Locking mechanism. More...
 
def log
 Write a content to the log file. More...
 
def cleanLog
 Clean the log file. More...
 
def readCSVFloatList
 Read a list of floats in a CSV file. More...
 
def writeFloatList
 Write a list of floats in a file. More...
 
def writeFloatMatrix
 Write a list of floats in a file. More...
 
def silentCall
 Call a commend without display. More...
 
def clearFolder
 Clear a folder of all files with a given extension. More...
 
def safeCopy
 Copy a file and check if the copy succeeded. More...
 

Function Documentation

def implementation.simulator.src.tools.cleanLog (   filePath = "log.log")

Clean the log file.

Parameters
filePathPath to the log file.
def implementation.simulator.src.tools.clearFolder (   path,
  ext = "" 
)

Clear a folder of all files with a given extension.

Parameters
pathFolder path.
extExtension or list of extension with the dot.
def implementation.simulator.src.tools.fileLock (   lockFile)

Locking mechanism.

Usage: with fileLock('lockFile.lock'): Source : http://amix.dk/blog/post/19531

def implementation.simulator.src.tools.log (   content,
  filePath = "log.log",
  alsoPrint = True 
)

Write a content to the log file.

Parameters
contentContent to write.
filePathPath to the log file.
alsoPrintBoolean equals to true if print on the screen is desired.
def implementation.simulator.src.tools.readCSVFloatList (   fileName)

Read a list of floats in a CSV file.

Parameters
fileNameName of the file to read.
Returns
List of doubles.
def implementation.simulator.src.tools.safeCopy (   src,
  dst,
  maxChecks = 3 
)

Copy a file and check if the copy succeeded.

Parameters
srcSource.
dstDestination.
maxChecksMaximum checks and trials.
def implementation.simulator.src.tools.silentCall (   command)

Call a commend without display.

Parameters
commandCommand to execute
Returns
The return status of the command.
def implementation.simulator.src.tools.writeFloatList (   fileName,
  floatList 
)

Write a list of floats in a file.

Parameters
fileNameName of the file to read.
floatListList of floats.
def implementation.simulator.src.tools.writeFloatMatrix (   fileName,
  floatMatrix 
)

Write a list of floats in a file.

Parameters
fileNameName of the file to read.
floatMatrixList of list floats.