Skip to content

Conversation

@lizlooney
Copy link
Collaborator

Also:

  • Added constants for the base class names and updated code to use the constants.
  • Updated json generator and the json for blocks_base_classes.

…s names.

In methods_category.ts, use the constants instead of hardcoding the class names.

In generator_context.ts, added getBaseClassName function which returns the full name of the base class. Removed getClassParent function.

In extended_python_generator.ts:
  Use constants for the OpMode class name and blocks_base_classes module.
  Modified addImport function to return the simple name if it generates a "from blocks_base_classes import" style import.
  Modified getBaseClassMethods function to use the class data from the JSON instead of hard coding.

Updated the json generator so that the submodules within blocks_base_classes are just reported as blocks_base_classes.
@lizlooney lizlooney requested a review from alan412 July 18, 2025 04:14
Copy link
Collaborator

@alan412 alan412 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I especially like the way we are getting more and more away from hard coded items with embedded strings. LGTM

@alan412 alan412 merged commit 053f132 into wpilibsuite:main Jul 18, 2025
1 check passed
@lizlooney lizlooney deleted the pr_base_class_methods branch July 18, 2025 22:01
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.

2 participants