Skip to content

Commit

Permalink
Added DataVersion str() operator. (#312)
Browse files Browse the repository at this point in the history
# Changes
- Added simplified `str()` operator to `DataVersion` (e.g., "6.7")

# Fixes
- Fixed CSV-style command line arguments appending to the default value unexpectedly
  • Loading branch information
adamshapiro0 authored May 14, 2024
2 parents 9c74676 + 4fe1f4d commit f52dc4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/fusion_engine_client/messages/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1601,6 +1601,9 @@ class DataVersion(NamedTuple):
major: int
minor: int

def __str__(self):
return f'{self.major}.{self.minor}'


_DataVersionConstructRaw = Struct(
Padding(1),
Expand Down
2 changes: 2 additions & 0 deletions python/fusion_engine_client/utils/argument_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ def __call__(self, parser, namespace, values, option_string=None):
result = getattr(namespace, self.dest)
if result is None:
result = []
elif result is self.default:
result = []
result.extend(flattened_values)
setattr(namespace, self.dest, result)

Expand Down

0 comments on commit f52dc4a

Please sign in to comment.