From 226a0000b1d99a999a87e66b1fba984b214c9641 Mon Sep 17 00:00:00 2001 From: Ted Henriksson Date: Sat, 14 May 2016 14:20:22 +0200 Subject: [PATCH 1/2] Added ignor for pycharm project files. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 311a7d5..cd0255d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ People.db +.idea From 75c7ad89440d2cde6bb68a6ef898ebb5a4bbcda9 Mon Sep 17 00:00:00 2001 From: Ted Henriksson Date: Mon, 10 Apr 2017 20:34:55 +0200 Subject: [PATCH 2/2] Simple fix so that we find the db "dynamically" when executing from cron. --- logout_all.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/logout_all.py b/logout_all.py index 5ba16ed..5b2370b 100755 --- a/logout_all.py +++ b/logout_all.py @@ -1,5 +1,10 @@ import sqlite3 as lite -con = lite.connect('People.db') +import os + +path, _ = os.path.split(os.path.realpath(__file__)) +db_path = os.path.join(path, 'People.db') + +con = lite.connect(db_path) with con: cur = con.cursor() cur.execute("UPDATE People SET isHere = 0")