From 34ce719920a7b25ec3183ee4a9ee1af5e59e72b3 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 20 Oct 2020 02:00:39 +0200 Subject: Strip non-JFR DD tags in --jfr-only mode --- dealconvert/formats/pbn.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'dealconvert') diff --git a/dealconvert/formats/pbn.py b/dealconvert/formats/pbn.py index 306ab79..11295f9 100644 --- a/dealconvert/formats/pbn.py +++ b/dealconvert/formats/pbn.py @@ -111,9 +111,13 @@ class PBNFormat(DealFormat): for i, suit in enumerate(hands[hand].split('.')): deal_dto.hands[(hand + dealer) % 4][i] = list(suit) result.append(deal_dto) - if deal_obj.has_field('OptimumResultTable'): - deal_dto.extra_fields += deal_obj.get_optimum_table() - for field in ['Ability', 'Minimax', 'OptimumScore']: + if not self.options.get('jfr_only', False): + if deal_obj.has_field('OptimumResultTable'): + deal_dto.extra_fields += deal_obj.get_optimum_table() + if deal_obj.has_field('OptimumScore'): + deal_dto.extra_fields.append( + str(deal_obj.get_field('OptimumScore', True))) + for field in ['Ability', 'Minimax']: if deal_obj.has_field(field): deal_dto.extra_fields.append( str(deal_obj.get_field(field, True))) -- cgit v1.2.3