diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index 5762933..34bd1ed 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -1,11 +1,27 @@ import pandas as pd import numpy as np +import glob import re import sys # Import our local settings management. import settings -timelog = pd.read_csv(settings.pomodoro_logfile()) +# This works for one file: +# timelog = pd.read_csv(settings.pomodoro_logfile()) + +# For multiple files: +path = settings.pomodoro_logpath() +all_files = glob.glob(path + "/*.csv") + +li = [] + +for filename in all_files: + df = pd.read_csv(filename, index_col=None, header=0) + li.append(df) + +timelog = pd.concat(li, axis=0, ignore_index=True) + +timelog = timelog.dropduplicates(inplace=True) # Dump bad data. The real solution here is to get rid of the damned 'Cancel' # button on the Pomodoro Prompt dialog, but i don't know how to do that, so we