◐ Shell
reader mode source ↗
Skip to content

bpo-5680: IDLE: Customize running a module.#13763

Merged
terryjreedy merged 19 commits into
python:masterfrom
csabella:bpo5680
Jun 18, 2019
Merged

bpo-5680: IDLE: Customize running a module.#13763
terryjreedy merged 19 commits into
python:masterfrom
csabella:bpo5680

Conversation

@csabella

@csabella csabella commented Jun 3, 2019

Copy link
Copy Markdown
Contributor

The initialize options are 1) add command line options, which are appended to sys.argv as if passed on a real command line, and 2) skip the shell restart. The customization dialog is accessed by a new item on the Run menu.

https://bugs.python.org/issue5680

@brettcannon brettcannon added the type-feature A feature request or enhancement label Jun 3, 2019

@terryjreedy terryjreedy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hide comment

Test of behavior without looking much at code yet. Will respond to other comments later. Immediate issue: I have a custom keyset without new pseudoevent binding and on startup see

Warning: config.py - IdleConf.GetCoreKeys -
problem retrieving key binding for event '<>'
from key set 'test'.
returning default value: ['']

The fix is simple and I know how to do it if you don't beat me.

Separate issue if not done yet: write back keyset with new bindings.

Otherwise, works great.

@bedevere-bot

Copy link
Copy Markdown

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@taleinat

taleinat commented Jun 6, 2019

Copy link
Copy Markdown
Contributor
  1. I find the name "Run Custom" unclear and confusing, and I image some users would too. Is "Run Module With Arguments" too long? Perhaps "Run With Arguments..."?
  2. It would be great to remember the last used arguments for each file, and pre-populate the field with them.

@csabella

csabella commented Jun 6, 2019

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again.

@terryjreedy, I added this pseudoevent to the former_extension_events set. I think that's what you wanted to fix -- to suppress the warning for the new binding and then to work on updating any custom keysets in another ticket. Maybe former_extension_events needs to be renamed?

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

@terryjreedy: please review the changes made to this pull request.

@csabella

csabella commented Jun 6, 2019

Copy link
Copy Markdown
Contributor Author

Thanks for looking at this, @taleinat!

I find the name "Run Custom" unclear and confusing, and I image some users would too. Is "Run Module With Arguments" too long? Perhaps "Run With Arguments..."?

Terry wants to have more things on that dialog to be able to change the run environment, so using 'arguments' on the menu isn't inclusive enough. If 'Run Custom' is awkward, maybe 'Customize Run'?

It would be great to remember the last used arguments for each file, and pre-populate the field with them.

Yes, there was a few things that I listed on the bpo issue that I didn't do in this first round, including saving the values. Terry requested creating a minimal version to start with. Saving the items wouldn't (shouldn't?) complicate the code, but I wanted to try to keep it simple and then iterate over it in the next round. He had also mentioned printing the run options in the shell window so that multiple runs would be annotated. Both features would be helpful.

@taleinat

taleinat commented Jun 7, 2019

Copy link
Copy Markdown
Contributor

I find the name "Run Custom" unclear and confusing, and I image some users would too. Is "Run Module With Arguments" too long? Perhaps "Run With Arguments..."?

Terry wants to have more things on that dialog to be able to change the run environment, so using 'arguments' on the menu isn't inclusive enough. If 'Run Custom' is awkward, maybe 'Customize Run'?

I see. Perhaps just "Run..."?

@taleinat taleinat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hide comment

As a general note, I'm not sure about the usefulness of the non-GUI tests for the RunCustom dialog (CustomRunCLIargsokTest, CustomRunEntryokTest) . They rely rather heavily on the internal implementation. Since we have GUI tests run by the CI now, I prefer to have simpler tests actually using Tk with less mocking. Would it be possible to simply move the tests from these classes into CustomRunGuiTest?

2 hidden conversations Load more…
@terryjreedy

Copy link
Copy Markdown
Member

I am reviewing and editing with the intention of getting this into 3.7.4. While the user UI can be changed after that, it is my primary focus. Summary responses to comments above.

  • Config warning: fixed.

  • Menu entry: We could flip 'Run custom', but I prefer to keep to a verb form. ('Python Shell' might better be 'Open Shell'.) I think 'Run customized' or 'Run ... customized' as an abbreviation for 'Run module with customized settings' is better, and should be good enough for now. I will see how latter looks.

  • Restart (or not) button: now functional. Add to blurb.

  • Arguments, without restart: These extend sys.argv. 'Command line' arguments do not make sense without restart, but extending sys.argv does. So this is OK.

  • No arguments, with restart: I changed my mind and will remove the current error check. No args will be ok with other settings, and if someone opens box to see available customizations, I now think they should be able to run without changing anything.
    (Note: check button will be replaced with radio buttons when another mutually exclusive option is added, such as 'O Run module in system console' (no issue yet).)

  • Code comments, especially tests: I will make the changes I currently agree with.

  • Blurb: will expand.

19 hidden items Load more…
3 hidden conversations Load more…
@terryjreedy

Copy link
Copy Markdown
Member

buglet to fix: focus is not being shifted to shell correctly.

Don't ask for config if still may toss.
Want focus to go to shell unless cancel.
@terryjreedy

Copy link
Copy Markdown
Member

Changes: 1) Check code before bother to customize. 2) Add module title to title bar. 3) Make shell.text the parent, so focus goes to shell. Good enough to merge. See issue for 2 remaining issues.

@terryjreedy terryjreedy changed the title bpo-5680: IDLE: Run modules with command line arguments Jun 18, 2019
@terryjreedy terryjreedy merged commit 201bc2d into python:master Jun 18, 2019
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @csabella for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @csabella for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 18, 2019
The initialize options are 1) add command line options, which are appended to sys.argv as if passed on a real command line, and 2) skip the shell restart. The customization dialog is accessed by a new entry on the Run menu.
(cherry picked from commit 201bc2d)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
@bedevere-bot

Copy link
Copy Markdown

GH-14184 is a backport of this pull request to the 3.7 branch.

@bedevere-bot

Copy link
Copy Markdown

GH-14185 is a backport of this pull request to the 3.8 branch.

miss-islington added a commit that referenced this pull request Jun 18, 2019
The initialize options are 1) add command line options, which are appended to sys.argv as if passed on a real command line, and 2) skip the shell restart. The customization dialog is accessed by a new entry on the Run menu.
(cherry picked from commit 201bc2d)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
miss-islington added a commit that referenced this pull request Jun 18, 2019
The initialize options are 1) add command line options, which are appended to sys.argv as if passed on a real command line, and 2) skip the shell restart. The customization dialog is accessed by a new entry on the Run menu.
(cherry picked from commit 201bc2d)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
@csabella csabella deleted the bpo5680 branch June 20, 2019 21:59
@csabella

Copy link
Copy Markdown
Contributor Author

@taleinat, thank you for the review and @terryjreedy, thank you for the review and making the additional changes.

lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
The initialize options are 1) add command line options, which are appended to sys.argv as if passed on a real command line, and 2) skip the shell restart. The customization dialog is accessed by a new entry on the Run menu.
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
The initialize options are 1) add command line options, which are appended to sys.argv as if passed on a real command line, and 2) skip the shell restart. The customization dialog is accessed by a new entry on the Run menu.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants