diff options
author | emkael <emkael@tlen.pl> | 2020-10-20 02:00:39 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2020-10-20 02:00:39 +0200 |
commit | 34ce719920a7b25ec3183ee4a9ee1af5e59e72b3 (patch) | |
tree | f9e8a69e207dae74eaa25575a21a200f89dc5671 | |
parent | 006822e6ad0f8ab0ddf45fd53d053e493eaee505 (diff) |
Strip non-JFR DD tags in --jfr-only mode
-rw-r--r-- | dealconvert/formats/pbn.py | 10 |
1 files changed, 7 insertions, 3 deletions
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))) |