-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to make <summary_format> still flexible for user #172
Comments
correct - no fancy f-string logic but can do quite a bit with custom serializer and telling user what formattings are available. Here is the format helper I pointed out in matrix yesterday:
I think it provides a very nice helper also to output "unknown" for |
@yarikoptic since you seem attached to the summary_format The user can set a
str
, (note, not an f string) https://github.com/con/duct/blob/main/src/con_duct/__main__.py#L31-L46Since the user-provided value is a regular string, we cannot use fancing f-string logic.
Instead we could add the logic to what I'm calling the "human readable preserializer" https://github.com/con/duct/blob/main/src/con_duct/__main__.py#L472-L476. That serializer is currently only responsible for replacing "unknown" string when the value is None, but it could be extended to do any other logic that would be necessary, ie rounding, and possibly even adding unit choices (ie Gb instead of bytes).
This would leave the user-customizable string to much simpler, and only allow the usage of pre-formatted values.
The text was updated successfully, but these errors were encountered: