def echo(lines): """Called when data is successfully parsed.""" # Take last reading only line = lines[-1] # Timestamp each line line = core.timestamp(line) print line
def data_received(self, data): """Add new data to the table. data -- a list of lists containing strings of data """ logging.debug('Data received {0}'.format(data)) for row in data: row = core.timestamp(row) self.data.append(row) msg = wx.grid.GridTableMessage(self, wx.grid.GRIDTABLE_NOTIFY_ROWS_APPENDED, len(data)) # Refresh any views such as grids for view in self.views: view.ProcessTableMessage(msg) view.ForceRefresh()
def setUp(self): self._FILENAME = 'data.csv' if os.path.isfile(self._FILENAME): os.remove(self._FILENAME) self.row = [str(x) for x in range(10)] self.stampedrow = core.timestamp(self.row[:])