summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2020-10-20 02:00:39 +0200
committeremkael <emkael@tlen.pl>2020-10-20 02:00:39 +0200
commit34ce719920a7b25ec3183ee4a9ee1af5e59e72b3 (patch)
treef9e8a69e207dae74eaa25575a21a200f89dc5671
parent006822e6ad0f8ab0ddf45fd53d053e493eaee505 (diff)
Strip non-JFR DD tags in --jfr-only mode
-rw-r--r--dealconvert/formats/pbn.py10
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)))