-
Notifications
You must be signed in to change notification settings - Fork 34
Clean up Actions/actions.py #112
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
Merged
madgrizzle
merged 19 commits into
WebControlCNC:master
from
gb0101010101:gb0101010101-actions-remove-elif
Apr 15, 2020
Merged
Clean up Actions/actions.py #112
madgrizzle
merged 19 commits into
WebControlCNC:master
from
gb0101010101:gb0101010101-actions-remove-elif
Apr 15, 2020
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…p code. Standardize exception handling. Format code.
…ith action('move') and action('moveZ').
…ve debugging print(), remove legacy commented code, send file as attachment to retain filename with datestamp.
…mplate to restrict selection of files. Make mimetype variable optional for backwards compatibility when not provided.
…n and does not delete existing log files. Add TODO comments to fix this later.
…e import to .ini extentions.
…with mod=st IDEs.
This was referenced Mar 22, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an initial effort to clean up the Actions/action.py file.
Goals
Major Changes
The main change is the introduction on Actions.processAction(). This method takes the Dictionary message from JavaScript, extracts the first argument as the command[method] and passes all other arguments to the python method. It checks if the method exists, raising exception if not, and checks if the command is safe to execute during gcode file upload using _safe_commands Python List.
Subsequent Commits
The rest of the major changes consist of defining new Actions class methods, that previously did not exist, and mapped execution to other Classes. e.g.
optical_Calibrate(self, arg) executes opticalCalibration.on_Calibrate(arg)
These new methods follow existing JavaScipt action('method') naming and map to existing python class methods to minimize code change. They can certainly be renamed for greater legibility and to follow code standards.
Most of the subsequent commits were added during testing to optimize existing code.
Testing
Urgency
Because of the scope of this code change it can conflict with many other existing branches. I hopefully have worked out possibly branch changes with current Master. I have reviewed code changes from other users, on Master, and tried to merge code changes, to make this addition painless. Please let me know of conflicts that cannot be easily resolved so this change can be applied.
I hope this effort can be incorporated before it falls too far out of sync with Master.