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

Various fixes: missed code uses, other updates #27711

Open
wants to merge 10 commits into
base: bugfix-2.1.x
Choose a base branch
from

Conversation

classicrocker883
Copy link
Contributor

@classicrocker883 classicrocker883 commented Feb 24, 2025

Description

- fix this same error in share/scripts/g29_auto.py:


"None" is not iterable
  "__iter__" method not defined

    while len(gcode) > i:
-       try:
-           z, i = find_z(gcode, i + 1)
-       except TypeError:
-           break

    while len(gcode) > i:
+       result = find_z(gcode, i + 1)

+       if result is None:
+           break

+       z, i = result
-start, end = get_lines(gcode, min_g1)

+layer_range = get_lines(gcode, min_g1)

+if layer_range is None:
+   print("Error: Unable to determine layer range. Exiting.")
+   exit(1)

+start, end = layer_range

doesnt have to say "Error: Unable to determine layer range. Exiting." per say, or exit, but its suggested


also, near the end of this file, you will see

out_file = open(output_file, 'w')
in_file = open(input_file, 'r')

# other code ....

file.close()
out_file.close()

file.close() should be in_file.close(), but the code has since been improved differently.


- Add FLIP() to missed opportunity placement

in module/tempurature.cpp

- if ((do_buttons ^= true)) ui.update_buttons();

+ if (FLIP(do_buttons)) ui.update_buttons();


- Other changes and good things

  • Remove ; typo from PlatformIO/scripts/STM32F1_create_variant.py
  • Update spacing, syntax and such ( match likeness in code)
  • Delete redundant share/scripts/languageUtil.py and moved contents into share/scripts/languageExport.py

This helps simplify code and adds better readability, fixes errors and improve on code. for example. added import ... to prevent error of it missing in a .py file.

Requirements

Benefits

Configurations

Related Issues

classicrocker883 and others added 10 commits February 24, 2025 16:10

Verified

This commit was signed with the committer’s verified signature.
snyk-bot Snyk bot
remove extra `"`
… into bugfix-2.1.x-February2
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.

None yet

1 participant