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

Port to wx python 4.2.1 and Python3 #2

Merged

Conversation

chrisinabox
Copy link
Contributor

Updates the OD Edit tool to use the latest wxPython version. The UI now works with Python 3.
This change does not do any significant refactoring to improve the underlying logic.

chrisinabox and others added 15 commits November 24, 2023 01:49
Able to open UI but cannot open files yet
Update error window message so it's more generic
Add new parser so no need to use eval.
Add tests for basic interpreter
Change default value for number field from 0 to 1
Add check for number >0 before allowing return OK
…with-zero-elements-creates-ghost-data-in-od

Fix ghost data created in OD files if number left as 0 in MapVariableDialog
…-from-object-type-record

Fix unable to remove sub-indexes from record types
…on 2

Update README to remove python 2 references
Refactor FileDialog for SaveAs to use wxPython recommended implementation
Update wildcards for easier selection of OD type
…type-od-without-closing-the-file-and-opening-again

Fix filepath not set on SaveAs success
Copy link
Member

@sveinse sveinse left a comment

Choose a reason for hiding this comment

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

This PR is a long awaited contribution. Thank you very much @chrisinabox . I really appreciate the efforts and it will be a great addition to the tool. However, we're not quite there yet and some changes are needed.

AFAICS there are three changes included in this PR:

  • wx support for py3
  • The removal of py2 (at least in the comments and setup)
  • Improvements on string parsing

These three belongs in separate PRs. Please adjust the PR accordingly. I recommend making this the wx change and make the two other changes later. If the string parsing is a prerequisite for the wx change, I recommend filing a new PR for that and that it will be approved before this.

The python package code check failed. It does not seem to be able to install wx without compilation. Please check the logs. Getting this working is also something that must be fixed.

README.md Outdated Show resolved Hide resolved
src/objdictgen/node.py Outdated Show resolved Hide resolved
src/objdictgen/node.py Outdated Show resolved Hide resolved
src/objdictgen/node.py Show resolved Hide resolved
src/objdictgen/ui/subindextable.py Show resolved Hide resolved
tests/test_node.py Outdated Show resolved Hide resolved
@chrisinabox
Copy link
Contributor Author

This PR is a long awaited contribution. Thank you very much @chrisinabox . I really appreciate the efforts and it will be a great addition to the tool. However, we're not quite there yet and some changes are needed.

AFAICS there are three changes included in this PR:

  • wx support for py3
  • The removal of py2 (at least in the comments and setup)
  • Improvements on string parsing

These three belongs in separate PRs. Please adjust the PR accordingly. I recommend making this the wx change and make the two other changes later. If the string parsing is a prerequisite for the wx change, I recommend filing a new PR for that and that it will be approved before this.

The python package code check failed. It does not seem to be able to install wx without compilation. Please check the logs. Getting this working is also something that must be fixed.

I believe your summary is correct on the most part. In addition though I have also implemented a couple of small bug fixes to the UI which are now part of this pull request. These changes are:

  • Allowing deletion of record types objects from the manufacturer specific information section for a node
  • Remove a bug that added "ghost" data to the UserMapping dictionary when adding manufacturer info to the node

@chrisinabox
Copy link
Contributor Author

chrisinabox commented Nov 27, 2023

@sveinse The workflows have been updated to include the required dependencies for building wxPython. While this does now build successfully, unfortunately the build times are relatively significant. This is primarily an issue for Linux systems, documented here - https://wxpython.org/pages/downloads/index.html

@sveinse
Copy link
Member

sveinse commented Nov 27, 2023

The check passed with you change 👍. However it took 23 minutes (!) where compiling wx took 22 of them. I think we need to pursue a better ways to do this. The problem is not that it takes CPU time, but its building something that isn't ours. Need to look into if there is a way to cache wx.

Copy link
Member

@sveinse sveinse left a comment

Choose a reason for hiding this comment

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

I haven't run the code yet, but it looks good

src/objdictgen/nodemanager.py Show resolved Hide resolved
@sveinse
Copy link
Member

sveinse commented Nov 27, 2023

I've run the PR on windows and briefly tested it. It works out of box. 🥇 great job. So I'm giving a green light to the PR ✔️ .

Please make the two following changes before merging:

  • Figure out what you want to do on the two except statement comment above
  • Bump odg to version 3.4 (search for 3.3 and replace with 3.4)

@chrisinabox
Copy link
Contributor Author

chrisinabox commented Nov 27, 2023

I've run the PR on windows and briefly tested it. It works out of box. 🥇 great job. So I'm giving a green light to the PR ✔️ .

Please make the two following changes before merging:

  • Figure out what you want to do on the two except statement comment above
  • Bump odg to version 3.4 (search for 3.3 and replace with 3.4)

Amazing! Shall get these done ASAP.

I have only tested on a windows system also.

Adjust try/catch in nodemanager GetNodeEntryValues(...) for slightly better (but not good) error handling
@chrisinabox chrisinabox requested a review from sveinse November 27, 2023 16:25
@chrisinabox
Copy link
Contributor Author

I have tested this in a Ubuntu VM and it all appears to be working as intended. There are a number of warnings generated by gtk but this does not appear to effect the functionality.

@sveinse sveinse merged commit dee2860 into Laerdal:main Nov 27, 2023
@chrisinabox chrisinabox deleted the feature-port-to-wxPython-4_2_1-and-python3 branch November 28, 2023 00:19
@sveinse sveinse mentioned this pull request Nov 28, 2023
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