diff options
author | Agustin Zubiaga <aguz@sugarlabs.org> | 2012-03-09 13:59:14 (GMT) |
---|---|---|
committer | Agustin Zubiaga <aguz@sugarlabs.org> | 2012-03-09 13:59:14 (GMT) |
commit | 7bfe9246498b483495f163536ff9f1f3385211f6 (patch) | |
tree | 8ab8e423c8a6a4f4e8fd35e8d1e4a3d2b9889d34 /readers.py | |
parent | 0d488062920a9e84aee8d695ac261455bf2b154d (diff) |
Choose measure channel
Diffstat (limited to 'readers.py')
-rw-r--r-- | readers.py | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -92,10 +92,11 @@ class StopWatchReader(): class MeasureReader(): - def __init__(self, file): + def __init__(self, file, channel): """Import chart data from file.""" self._reader = csv.reader(file) + self._channel = str(channel - 1) def get_chart_data(self): """Return data suitable for pyCHA.""" @@ -108,7 +109,14 @@ class MeasureReader(): if count > 6: label, value = row[0].split(": ") - chart_data.append((label, float(value))) + split = label.split(".") + + if len(split) > 1: + if split[1] == self._channel: + chart_data.append((split[0], float(value))) + + elif len(split) < 1: + chart_data.append((split[0], float(value))) return chart_data |