-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
construct-code uptodate #20
Conversation
"target_temp" / TempAdapter(Int8ub), | ||
"away" / IfThenElse(lambda ctx: ctx.mode.AWAY, | ||
AwayDataAdapter(Byte[4]), | ||
GreedyBytes), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continuation line under-indented for visual indent
Const(0x04, Int8ub), | ||
"target_temp" / TempAdapter(Int8ub), | ||
"away" / IfThenElse(lambda ctx: ctx.mode.AWAY, | ||
AwayDataAdapter(Byte[4]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continuation line under-indented for visual indent
"valve" / Int8ub, | ||
Const(0x04, Int8ub), | ||
"target_temp" / TempAdapter(Int8ub), | ||
"away" / IfThenElse(lambda ctx: ctx.mode.AWAY, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing whitespace
return int(obj * 2.0) | ||
|
||
ModeFlags = "ModeFlags" / FlagsEnum(Int8ub, | ||
AUTO=0x00, | ||
AUTO=0x00, # always True, doesnt affect building |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at least two spaces before inline comment
line too long (84 > 79 characters)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to build with Construct 2.9.3 and it's working again.
There is no version ".3" |
Typo mean .30 |
Seems to work fine with 2.9.32. I'll ignore the hound warnings this time and prepare a make a new release, thanks for the patch! |
For the record, Timestamp class was added but even tho it supports custom epochs and units, and even ancient MSDOS format, it would not support a custom bitstruct. So stick to the custom adapter. |
This brings construct-related code uptodate, but it requires 2.9.31 which will be shipped within a day.
https://pypi.org/project/construct/
There is FlagsEnum thingy: value 0 doesnt make much sense, because parsing always sets it True and building is not affected by that flag regardless if its set. Its correct code, but not proper.