Skip to content
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

Merged
merged 1 commit into from
Feb 18, 2018
Merged

construct-code uptodate #20

merged 1 commit into from
Feb 18, 2018

Conversation

arekbulski
Copy link
Contributor

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.

"target_temp" / TempAdapter(Int8ub),
"away" / IfThenElse(lambda ctx: ctx.mode.AWAY,
AwayDataAdapter(Byte[4]),
GreedyBytes),

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]),

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,

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

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)

Copy link

@mrlexley mrlexley left a 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.

@arekbulski
Copy link
Contributor Author

There is no version ".3"

@mrlexley
Copy link

Typo mean .30

@rytilahti
Copy link
Owner

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!

@rytilahti rytilahti merged commit 0602e2a into rytilahti:master Feb 18, 2018
@arekbulski
Copy link
Contributor Author

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.
https://construct.readthedocs.io/en/latest/api/misc.html#construct.Timestamp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants