Skip to content

Commit 9e8448f

Browse files
author
szwerver
committed
empty friendlies
1 parent e46ccaa commit 9e8448f

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

DataHandler.py

+9
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ def get_db_connection(self, name):
7373
conn_schedule.row_factory = sqlite3.Row
7474
return conn_schedule
7575

76+
def clear_friendly_requests(self):
77+
conn = self.get_db_connection('friendlies')
78+
cursor = conn.cursor()
79+
cursor.execute('DELETE FROM friendlies')
80+
conn.commit()
81+
conn.close()
82+
7683
def schedule_csv_to_db(self, name, init=False): # use this only once for the initial database
7784
filename = name + '.csv'
7885
conn = self.get_db_connection('schedule')
@@ -101,6 +108,8 @@ def schedule_csv_to_db(self, name, init=False): # use this only once for the in
101108
conn.commit()
102109
conn.close()
103110

111+
self.export_schedule_to_csv()
112+
104113
def update_tournament_db(self):
105114
if path.exists('data/new_match.csv'):
106115
print('[DataHandler][update_tournament_db] Entering new matches')

main.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919
# Initialise database and availability
2020
dataHandler.update_team_availability(name='schedule', init=True, type='csv')
2121
dataHandler.schedule_csv_to_db(name='schedule', init=True)
22-
# process = Popen(['data/ssl-scheduling/data/reset.sh'], stdout=PIPE, stderr=PIPE)
23-
# stdout, stderr = process.communicate()
24-
# print(stdout)
25-
# print(stderr)
26-
# process.wait()
22+
dataHandler.clear_friendly_requests()
23+
process = Popen(['data/ssl-scheduling/data/reset.sh'], stdout=PIPE, stderr=PIPE)
24+
stdout, stderr = process.communicate()
25+
print(stdout)
26+
print(stderr)
27+
process.wait()
2728

2829

2930
###############################################################

0 commit comments

Comments
 (0)