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

klippy/extras: Add boolean filter for gcode_macro. #6362

Closed
wants to merge 1 commit into from

Conversation

Luro02
Copy link

@Luro02 Luro02 commented Oct 9, 2023

This allows one to write

{% set FLAG = params.FLAG|boolean %}

instead of

{% set FLAG = (params.FLAG|string).lowercase() == "true" %}

@KevinOConnor
Copy link
Collaborator

Thanks. However, I think we should try to limit the amount of Jinja2 customizations. Adding these customizations would require associated documentation (so that users knew of its existence). I agree that Jinja2 is cryptic, but I don't think we can realistically make Jinja2 "not cryptic". I fear at best we can only introduce "many different kinds of cryptic". Users today can use the standard Jinja2 documentation (which is thorough) to figure out appropriate syntax, and I think we should encourage that going forward.

Cheers,
-Kevin

@KevinOConnor KevinOConnor added the not mainline Wont merge into master branch label Oct 19, 2023
@flowerysong
Copy link
Contributor

% set FLAG = (params.FLAG|string).lowercase() == "true" %}

A more idiomatic way to do this is

{% set FLAG = params.FLAG | lower == "true" %}

@github-actions
Copy link

This PR is being closed because it is currently not considered a good match for the master Klipper repository.

Best regards,
~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being.

@github-actions github-actions bot closed this Oct 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
not mainline Wont merge into master branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants