mirror of https://github.com/tilde-team/botany
tidy up clear_weekly_users.py
This commit is contained in:
parent
ab0190ef74
commit
aeaa5ac00a
|
@ -1,11 +1,6 @@
|
|||
import os
|
||||
import sqlite3
|
||||
#!/usr/bin/env python3
|
||||
|
||||
game_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
garden_db_path = os.path.join(game_dir, 'sqlite/garden_db.sqlite')
|
||||
conn = sqlite3.connect(garden_db_path)
|
||||
c = conn.cursor()
|
||||
c.execute("DELETE FROM visitors")
|
||||
print("Cleared weekly users")
|
||||
conn.commit()
|
||||
conn.close()
|
||||
from data_manager import DataManager
|
||||
|
||||
d = DataManager()
|
||||
d.clear_weekly_visitors()
|
||||
|
|
|
@ -255,3 +255,7 @@ class DataManager(object):
|
|||
else:
|
||||
visitor_block = 'nobody :('
|
||||
return visitor_block
|
||||
|
||||
def clear_weekly_visitors(self):
|
||||
self.cursor.execute("DELETE FROM visitors")
|
||||
self.conn.commit()
|
||||
|
|
Loading…
Reference in New Issue