-
Notifications
You must be signed in to change notification settings - Fork 3
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
Change the encoding of attribut definitions #2
Comments
What about using a standard string formatting convention such as this one? https://docs.python.org/3/library/string.html#format-specification-mini-language A string of length 4, right-aligned, could be I'm not sure if this would cover all use-cases, though. For example, I'm not sure if you can force a float to be formatted with a specified number of total characters, I think you can only specify the number of decimal places. But maybe the syntax can be used anyway, even if the plugin has to do some extra work for e.g. shortening numbers. |
I love conventional standards as much as the next guy - but on the one hand I think we can do it even more efficient and on the other hand the standard string formatting convention (as you suspected) would not cover all of our use-cases :-) We have decision values ("J/N") and special date/time values like "TT.MM" (only 1 dot), which aren't covered in the convention. I have the following suggestion for the definition: [ 1 character to identify the data type ][ 1 space ][ maximum total number of characters possible ][ 1 space ][ additional info ] We don't need curly brackets because every definition is set in their own litte cell in the definitions file. The first item in that list would identify the data type. The second item would contain the maximum total number of characters possible. I'm not sure any more, that the alignment of the text should be encoded in the definition, because the default is strings-left and numbers-right. To my knowledge this fits in all cases (only the ALL-file might look nicer with left-aligned numbers). Examples: maybe later: |
I fully agree 👍 |
The attribute definitions currently rely on the length of the entry to encode the requiered length of the attribute, e.g. "ssss" for a string with a length of 4.
It would be easier and clearer, if this definition would look more like "s, 4".
Additionally it would enable the definitions to contain more information like alignment or if this attribute is requiered or could be left empty.
The text was updated successfully, but these errors were encountered: