Make one CSV logfile vs directory an option determined via settings.ini
Default to directory.
This commit is contained in:
parent
8c8c00586d
commit
d952f11350
1 changed files with 13 additions and 12 deletions
|
@ -12,20 +12,21 @@ if hasattr(sys, 'ps1'):
|
||||||
else:
|
else:
|
||||||
debug = False
|
debug = False
|
||||||
|
|
||||||
# This works for one file:
|
if settings.pomodoro_logfile():
|
||||||
timelog = pd.read_csv(settings.pomodoro_logfile())
|
# This works for one file:
|
||||||
|
timelog = pd.read_csv(settings.pomodoro_logfile())
|
||||||
|
else:
|
||||||
|
# For multiple files:
|
||||||
|
path = settings.pomodoro_logpath()
|
||||||
|
all_files = glob.glob(path + "*.csv")
|
||||||
|
|
||||||
# For multiple files:
|
li = []
|
||||||
#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)
|
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)
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
imported = copy.deepcopy(timelog)
|
imported = copy.deepcopy(timelog)
|
||||||
|
|
Loading…
Reference in a new issue