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

Remove Tools/pynche #91551

Closed
warsaw opened this issue Apr 15, 2022 · 9 comments · Fixed by #91554
Closed

Remove Tools/pynche #91551

warsaw opened this issue Apr 15, 2022 · 9 comments · Fixed by #91554
Assignees
Labels
3.11 only security fixes

Comments

@warsaw
Copy link
Member

warsaw commented Apr 15, 2022

@larryhastings reminded me of this ancient program. It's way past time to remove this directory from Tools/. I have no way to test it and zero interest in supporting it. I don't even know the last time anybody mentioned it. I don't even have enough interest to keep it alive in a separate repository.

Fun historical fact: I wrote the original version of this color editor for SunView.

@warsaw warsaw self-assigned this Apr 15, 2022
@warsaw warsaw added the 3.11 only security fixes label Apr 15, 2022
warsaw added a commit to warsaw/cpython that referenced this issue Apr 15, 2022
@arhadthedev
Copy link
Member

arhadthedev commented Apr 15, 2022

I see this tool as a neat way to find some pretty named color. Maybe it should be moved to Tools/demo as an example of how to use TKInter in a real (multifile) program? I can reorganize the tool's code to make it testable if it's viable.

A patch to make a program runnable:

diff --git a/Tools/pynche/PyncheWidget.py b/Tools/pynche/PyncheWidget.py
index ea456e577e..e73d48f16a 100644
--- a/Tools/pynche/PyncheWidget.py
+++ b/Tools/pynche/PyncheWidget.py
@@ -37,7 +37,7 @@ def __init__(self, version, switchboard, master=None, extrapath=[]):
             # Is there already a default root for Tk, say because we're
             # running under Guido's IDE? :-) Two conditions say no, either the
             # _default_root is None or it is unset.
-            tkroot = getattr(tkinter, '_default_root', None)
+            tkroot = getattr(sys.modules['tkinter'], '_default_root', None)
             if not tkroot:
                 tkroot = Tk(className='Pynche')
             self.__tkroot = tkroot

I runned it as follows:

PCbuild\amd64\python Tools\pynche\Main.py -d Tools\pynche\X\rgb.txt

@arhadthedev
Copy link
Member

@JelleZijlstra
Copy link
Member

@arhadthedev if you're interested in maintaining it, probably better to just start a new repo. That way there's one less thing to keep around in Python itself.

@warsaw
Copy link
Member Author

warsaw commented Apr 15, 2022

Maybe it should be moved to Tools/demo as an example of how to use TKInter in a real (multifile) program?

if you're interested in maintaining it, probably better to just start a new repo.

I wouldn't be opposed to either option. I can think of a couple of choices:

  1. Move it to a separate repository in the python org
  2. Create a new project outside the python org and set up some contributors
  3. Delete it as planned above

If I was to do it, I'd prefer GitLab, but GitHub is just fine too. Preferences?

@gpshead
Copy link
Member

gpshead commented Apr 15, 2022

I see no reason to keep this buried within the CPython repo.. Delete it here. Let whoever wants to maintain it put it up in a new repo anywhere (and presumably on pypi - their choice).

LOL SunView!

@warsaw
Copy link
Member Author

warsaw commented Apr 16, 2022

Okay, I will copy the files out into my own repo (likely on GitLab though), and will happily add any contributors who want to help out. I'm going to mark this PR as draft until then, then will undraft it and merge. Thanks!

@hugovk
Copy link
Member

hugovk commented Apr 16, 2022

You may know it already but in case not, here are some magic git commands to copy files into a new repo, preserving history:

https://discuss.python.org/t/pep-594-take-2-removing-dead-batteries-from-the-standard-library/13508/34?u=hugovk

@warsaw
Copy link
Member Author

warsaw commented Apr 17, 2022

Contributions and collaborations welcome: https://gitlab.com/warsaw/pynche

@vstinner
Copy link
Member

Screenshots in Python 3.10 with @arhadthedev patch.

Main window:

color

About window:

about

Before this tool has been removed, I didn't know it! It's interesting that it still works (with a oneliner patch)! I didn't know SunOS SunView neither!

Tool added to Python in 1998 (Python v1.5.1) with commit 516f189:

commit 516f18993f97c58f2bb41543bc878b3d7a1338fe
Author: Barry Warsaw <barry@python.org>
Date:   Tue Jan 27 03:19:00 1998 +0000

    Initial revision

 Tools/pynche/Main.py | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants