Update .gitignore
[aur.git] / scripts / tuvotereminder.py
blob97b1d12e72417f8241cb11c32a87e1f753fcc594
1 #!/usr/bin/python3
3 import subprocess
4 import time
6 import aurweb.config
7 import aurweb.db
9 notify_cmd = aurweb.config.get('notifications', 'notify-cmd')
12 def main():
13 conn = aurweb.db.Connection()
15 now = int(time.time())
16 filter_from = now + 500
17 filter_to = now + 172800
19 cur = conn.execute("SELECT ID FROM TU_VoteInfo " +
20 "WHERE End >= ? AND End <= ?",
21 [filter_from, filter_to])
23 for vote_id in [row[0] for row in cur.fetchall()]:
24 subprocess.Popen((notify_cmd, 'tu-vote-reminder', str(vote_id))).wait()
27 if __name__ == '__main__':
28 main()