-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
IDLE: Document, fix, and complete configdialog font tests #75176
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
Comments
This follows bpo-30981 and the comments on PR 2805 after the close notice.
|
Patch ready for test on linux and review. |
Works on linux. I just had one question on github about a test for sizelist and moving the initialization of the Tk variables into setUp. I also deleted a second comment that was just a wrong comment, but it's led me to another question. For test_indent_scale, you have the widget test and the |
I am thinking that the tab title should be 'Font/Indent' rather than 'Font/Tabs' to avoid the confusion between the simulated file-folder tab that we click on and the tab key that indents. Opinions? But maybe the indent widget will be moved, eliminating the issue, or maybe more will be added, as part of converting 'extensions' to features, requiring a different rename. 'Reformat paragraph, also affect text layout. |
Yes, test_font_set could be split up. But then the setup would have to be repeated for each, and it would be harder to verify that each .set() call was being tested the same way. The event graph for indent_scale is a simple linear chain, and the simple liner test mirrors that. The combined test of bold_toggle and set_samples is not what I wanted, but I prefer it to the alternative of depending on an undocumented internal detail of the tcl wrapper maker (_tkinter, I suspect). |
+1 on the Font/Indent name. And I agree that the indent widget would make more sense on the General tab, or another name, like Editor/Shell Preferences. Another thought I had was Fonts should maybe be part of a Theme. At the theme level (not at the tag level), define font name/font size and then have font bold at the tag level. Spyder has that, so the function names (IDLE tag of Another thought I had with the cycle in fonts: A wdiget is clicked on, which calls the tkinter command callback. But, the Tk variable is also updated which calls the trace function. Those are the two paths. What if the trace function called set_samples? Then font_bold and font_size widgets wouldn't need the command argument. I think instead of: this: |
A big issue with changing to tagging individual elements is back compatibility. Besides which, if the font is not bold, I cannot imaging bolding anything other than the definition names. This also seems to venture beyond 'keep IDLE simple for beginners'. How about a new option to just bold definition names? Factoring out the call to set_samples to one place is a great idea that simplifies code and tests. I did it and the htest dialog worked just fine. The tests also passed as were, but need reworking. I am doing that now. The result will be one FontTest class that tests that each widget sets its var, tests that var setting adds changes and calls set_samples, and tests set_samples. |
2nd and presumably last PR for this issue: please verify on linux. |
The tests pass on linux and the htest looks good. Thank you for making all these changes. It seems much clearer now, but I do want to spend more time reading the code to understand it. Looks like you grouped all the font-related functions, so they are ready to become a Class? The only part I couldn't figure out is how to update highlight_sample since it wouldn't be in the class. With the backwards compatibility, I thought maybe you have an idea about how to make the changes compatible because of the issue that moves the extensions. I can see where that would be a problem as far as making changes is concerned. Maybe I'll look at the creating tests for one of the other tabs next? |
Ned, in a comment on PR2826, Louie reported "The patch unittest work on Linux, but on MacOS, I get test.support.ResourceDeined: cannot run without OS X gui process, it is wierd, I'm inside the GUI mode. Also, I'm not sure if this only on MacOS (is font problem or what), when checking bold box, some font won't render to bold (I've check that this may not relative to patch, in older commit have this problem, too)." Have you run gui tests, and in particular, IDLE tests on OSX lately? Is the OSX code in test.support for GUI required still working? |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: