summaryrefslogtreecommitdiff
path: root/bidding_data.py
diff options
context:
space:
mode:
Diffstat (limited to 'bidding_data.py')
-rw-r--r--bidding_data.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/bidding_data.py b/bidding_data.py
index ba467f6..a56847b 100644
--- a/bidding_data.py
+++ b/bidding_data.py
@@ -149,12 +149,12 @@ class JFRBidding:
__board_number_mapping = {}
def __init__(self, bws_file, file_prefix):
- connection = pypyodbc.win_connect_mdb(bws_file)
- cursor = connection.cursor()
- self.__lineup_data = cursor.execute('SELECT * FROM RoundData').fetchall()
+ with pypyodbc.win_connect_mdb(bws_file) as connection:
+ cursor = connection.cursor()
+ self.__lineup_data = cursor.execute('SELECT * FROM RoundData').fetchall()
+ bid_data = cursor.execute('SELECT * FROM BiddingData').fetchall()
self.__round_lineups = self.__parse_lineup_data(self.__lineup_data)
- self.__bids = self.__parse_bidding_data(
- cursor.execute('SELECT * FROM BiddingData').fetchall())
+ self.__bids = self.__parse_bidding_data(bid_data)
self.__tournament_prefix = path.splitext(
path.realpath(file_prefix + '.html'))[0]
self.__tournament_files_match = re.compile(