summaryrefslogtreecommitdiff
path: root/dealconvert/formats/pbn.py
diff options
context:
space:
mode:
Diffstat (limited to 'dealconvert/formats/pbn.py')
-rw-r--r--dealconvert/formats/pbn.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/dealconvert/formats/pbn.py b/dealconvert/formats/pbn.py
index bc52462..b6c30ed 100644
--- a/dealconvert/formats/pbn.py
+++ b/dealconvert/formats/pbn.py
@@ -137,14 +137,15 @@ class PBNFormat(DealFormat):
])))
for field in board.extra_fields:
lines.append(field)
- try:
- dd_board = PBNBoard(lines)
- dd_table = DDTable(dd_board).get_dd_table(self.interactive)
- dd_contract = ParScore(dd_board).get_par_contract(dd_table)
- dd_board.save_dd_table(dd_table)
- dd_board.save_par_contract(dd_contract)
- lines = [field.raw_field for field in dd_board.fields]
- except Exception as e:
- warnings.warn('unable to determine double-dummy data: %s' % e)
+ if self.analyze:
+ try:
+ dd_board = PBNBoard(lines)
+ dd_table = DDTable(dd_board).get_dd_table(self.interactive)
+ dd_contract = ParScore(dd_board).get_par_contract(dd_table)
+ dd_board.save_dd_table(dd_table)
+ dd_board.save_par_contract(dd_contract)
+ lines = [field.raw_field for field in dd_board.fields]
+ except Exception as e:
+ warnings.warn('unable to determine double-dummy data: %s' % e)
for line in lines + ['']:
out_file.write(line + '\r\n')