diff options
Diffstat (limited to 'misc/export_to_2.0')
-rwxr-xr-x | misc/export_to_2.0 | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/misc/export_to_2.0 b/misc/export_to_2.0 index ef30ffe..d6fe65c 100755 --- a/misc/export_to_2.0 +++ b/misc/export_to_2.0 @@ -5,12 +5,11 @@ sys.path.insert(0, "/usr/share/Watcher/") import csv from watch_log import get_date import datetime +import files import time_operations as to def extract_data(date): - user = os.getlogin() - path = "/home/" + user +"/.cache/Watcher/raw_data/" - filename = path + date + ".csv" + filename = files.raw_log(date) l = list() # l = list of (app_name, time spent on app on that session) d = dict() @@ -64,7 +63,7 @@ def final_report(window_opened, time_spent): def export_to_new(date): window_opened, time_spent = extract_data(date) sorted_report = final_report(window_opened, time_spent) - filename = "/home/"+os.getlogin()+"/.cache/Watcher/daily_data/"+date+".csv" + filename = files.daily_log(date) overwrite_Data = [] with open(filename, 'w') as csvfile: for x,y in sorted_report.items(): @@ -76,8 +75,6 @@ def export_to_new(date): del sorted_report del overwrite_Data -path = "/home/" + os.getlogin() +"/.cache/Watcher/raw_data/" +path = os.path.dirname(files.raw_log('empty')) for file in os.listdir(path): export_to_new(file[:-4]) - - |