#NEWLINE# def saveValues( self , **kwargs ) : #NEWLINE# #INDENT# ' Save a new row of information in the current csv file that stores the data  (from a dictionary of items)\n        :param kwargs: dictionary of values\n        ' #NEWLINE# if ( ( len ( kwargs ) != len ( self . columnNames ) ) and self . showWarningWhenIncompleteColumns ) : #NEWLINE# #INDENT# print ( 'WARNING. There is a wrong number of arguments in ReportsWidget. ' ) #NEWLINE# print ( 'Current columns: ' ) #NEWLINE# pprint . pprint ( self . columnNames ) #NEWLINE# print ( 'Total: {0}' . format ( len ( self . columnNames ) ) ) #NEWLINE# print ( 'Args passed: ' ) #NEWLINE# pprint . pprint ( kwargs ) #NEWLINE# print ( 'Total: {0}' . format ( len ( kwargs ) ) ) #NEWLINE# #UNINDENT# for key in kwargs : #NEWLINE# #INDENT# if ( key not in self . columnNames ) : #NEWLINE# #INDENT# print ( 'WARNING: Column {0} is not included in the list of columns' . format ( key ) ) #NEWLINE# #UNINDENT# #UNINDENT# orderedColumns = [ ] #NEWLINE# orderedColumns . append ( time . strftime ( '%Y/%m/%d %H:%M:%S' ) ) #NEWLINE# for column in self . columnNames : #NEWLINE# #INDENT# if kwargs . has_key ( column ) : #NEWLINE# #INDENT# orderedColumns . append ( kwargs [ column ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# orderedColumns . append ( '' ) #NEWLINE# #UNINDENT# #UNINDENT# fileExists = os . path . isfile ( self . csvFilePath ) #NEWLINE# with open ( self . csvFilePath , 'a+b' ) as csvfile : #NEWLINE# #INDENT# writer = csv . writer ( csvfile ) #NEWLINE# writer . writerow ( orderedColumns )