diff options
author | emkael <emkael@tlen.pl> | 2015-08-28 14:49:52 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2015-08-28 14:49:52 +0200 |
commit | 84b22e5ecffb95a84e2a0e9a30f71b127a2cf05e (patch) | |
tree | fca62b51d98f3e5eee68209d2aa0549b7aa6d74b | |
parent | a01924e56445e047ed7db503e710c7cb6ff0e716 (diff) |
* omitting link appending when there's no data for a particular score
-rw-r--r-- | TODO.md | 1 | ||||
-rw-r--r-- | bidding_data.py | 12 |
2 files changed, 8 insertions, 5 deletions
@@ -1,5 +1,4 @@ * dopisać jakieś hinty do generowania CSV po Windowsem * jakiś niepaskudny link do licytacji - * niedodawanie linków tam, gdzie nie ma licytacji * czytać bezpośrednio z BWS (albo chociaż obsłużyć Excelowy format CSV) * pobieranie nazwisk z BWS(?) diff --git a/bidding_data.py b/bidding_data.py index 3107e2f..e845626 100644 --- a/bidding_data.py +++ b/bidding_data.py @@ -259,10 +259,14 @@ class JFRBidding: self.__get_bidding_file_output_path( int(file_number, 10), pair_numbers=pair_numbers)) - # fourth cell is the contract - for link in cells[3].select('a.biddingLink'): - link.extract() - cells[3].append(bidding_link) + # only append link if we've got bidding data + if path.isfile(path.join( + path.dirname(self.__tournament_prefix), + bidding_link['data-bidding-link'])): + # fourth cell is the contract + for link in cells[3].select('a.biddingLink'): + link.extract() + cells[3].append(bidding_link) board_text.seek(0) board_text.write(board_text_content.table.prettify( 'iso-8859-2', formatter='html')) |