Skip to content

Conversation

@lizlooney
Copy link
Collaborator

Generate "from import " import statements.

Also, don't let the user create a module whose name collides with an existing python module.

Fixes #234

In ClassNameComponent.tsx, check whether the class name entered by the user would cause a collision with an existing python module.
@lizlooney lizlooney requested a review from alan412 October 25, 2025 04:34
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.

In general this looks good, but when we put in a component it doesn't use this. Is that intentional?
Screenshot 2025-10-25 at 8 54 38 AM

@lizlooney
Copy link
Collaborator Author

Yes, at least for this PR, I'm not changing the python code generated for blocks, except for the mrc_port block, where it has multiple names to import from port.

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.

LGTM

@alan412 alan412 merged commit 5d77dab into wpilibsuite:main Oct 25, 2025
1 check passed
@lizlooney lizlooney deleted the pr_from_x_import_y branch October 26, 2025 21:38
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.

The python generator should be able to generate from x import y

2 participants