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

bpo-38439: Add 256px IDLE icon #17473

Merged
merged 9 commits into from
Apr 22, 2020
Merged

bpo-38439: Add 256px IDLE icon #17473

merged 9 commits into from
Apr 22, 2020

Conversation

hroncok
Copy link
Contributor

@hroncok hroncok commented Dec 5, 2019

Icon author: Andrew Clover, bpo-1490384

Downloaded from https://www.doxdesk.com/software/py/pyicons.html

I would add the vector version as well, however:

  • found now way to open the Xara file
  • the SVG file is missing important features (e.g. shadow is broken)

https://bugs.python.org/issue38439

@vstinner
Copy link
Member

vstinner commented Dec 5, 2019

cc @terryjreedy @csabella @serhiy-storchaka

The icon looks great! It looks the same than Lib/idlelib/Icons/idle_48.png but with a much better resolution. I cannot see 256x256 pixels icon in https://bugs.python.org/issue1490384 : where does the file come from? I would like to get some more context to check the license. On the issue, I see that Andrew Clover signed the Contributor Agreement. Did Andrew draw them?


The commit 4ade2d2 of https://bugs.python.org/issue20406 added the following icons (GIF and PNG formats):

 Lib/idlelib/Icons/idle.ico    | Bin 0 -> 19790 bytes
 Lib/idlelib/Icons/idle_16.gif | Bin 0 -> 1034 bytes
 Lib/idlelib/Icons/idle_16.png | Bin 0 -> 1264 bytes
 Lib/idlelib/Icons/idle_32.gif | Bin 0 -> 1435 bytes
 Lib/idlelib/Icons/idle_32.png | Bin 0 -> 2542 bytes
 Lib/idlelib/Icons/idle_48.gif | Bin 0 -> 1388 bytes
 Lib/idlelib/Icons/idle_48.png | Bin 0 -> 4710 bytes

But I didn't understand where these files come from.

@hroncok
Copy link
Contributor Author

hroncok commented Dec 5, 2019

But I didn't understand where these files come from.

I've tried to address this in the commit message.

@vstinner
Copy link
Member

vstinner commented Dec 5, 2019

Oh wait, I missed https://bugs.python.org/issue38439 I confirm that the icon is drew by drew by Andrew Clover: https://bugs.python.org/issue38439#msg357852

For an unknown reason, the bot didn't add a link to https://bugs.python.org/issue38439 in the PR description.

@hroncok
Copy link
Contributor Author

hroncok commented Dec 5, 2019

As a side note, I haven't added a gif, because I don't see a point in a 256px gif icon.

@vstinner
Copy link
Member

vstinner commented Dec 5, 2019

I installed Xara Photo & Graphic Designer trial on Windows. I converted the Xara file to SVG at 300 dpi, but the compressed SVG is still 1.4 MiB which is quite big. I converted to 96 dpi compressed SVG: 796 KiB. Still quite big.

I edited the SVG to only keep the 4 IDLE icons: 152 KiB. That's more reasonable, no?

If I only keep the IDLE icon "at 256x256 pixels" resolution (the one used to generated the PNG of this PR), it's 136 KiB:

I don't have a strong opinion about only adding the PNG, or also add the SVG.

@hroncok
Copy link
Contributor Author

hroncok commented Dec 5, 2019

I would also add the svg, possibly with all the variants. At least include t in the sources (not install it). So we don't have to search the Internets when we add a higher resolution icon in next decade.

However, no idea where to put it in the source tree.

@hroncok
Copy link
Contributor Author

hroncok commented Dec 5, 2019

And here is the scaleable icon I'd like to actually include in the installation (uncompressed).
idle-256px.svg.tar.gz

@vstinner
Copy link
Member

vstinner commented Dec 5, 2019

And here is the scaleable icon I'd like to actually include in the installation (uncompressed). idle-256px.svg.tar.gz

Uncompressed: 136 KiB. That sounds reasonable. I like the idea of installing it. But I'm not sure of the location. Do you expect to get it in /usr/share? Currently, Python only install icons in /usr/lib, no? I'm not sure how to modify the Makefile. Maybe start by adding the SVG in Lib/idlelib/Icons/ but don't install it with "make install". It's nice to have the source of PNG icons in the same directory.

Linux vendors like Fedora could use this SVG icon if they want.

Or maybe propose a following PR to install it, if you are motivated to hack the Makefile ;-)

@hroncok
Copy link
Contributor Author

hroncok commented Dec 5, 2019

In Fedora, we currently do:

install -D -m 0644 Lib/idlelib/Icons/idle_16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/idle3.png
install -D -m 0644 Lib/idlelib/Icons/idle_32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/idle3.png
install -D -m 0644 Lib/idlelib/Icons/idle_48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/idle3.png

Where %{buildroot}%{_datadir} is /usr/share.

The svg would go to /usr/share/icons/hicolor/scalable/apps/idle3.svg

@hroncok
Copy link
Contributor Author

hroncok commented Dec 27, 2019

How can move this forward? Is the higher resolution icon desired? Should I add the SVG "source" as well as the minimized scalable SVG? Where?

We can carry those downstream, but I'd rather not.

@terryjreedy
Copy link
Member

I am on holiday break with my family, but I will try to get to this, at least from the IDLE side, soon.

@hroncok
Copy link
Contributor Author

hroncok commented Dec 27, 2019

Enjoy the break and don't worry. It's enough for me to know that you are aware of this. Thanks for the heads up.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM. I'm fine with not adding the source SVG into Python, only PNG.

Note: the idle.ico has been modified to add a 8th icon into the file: the 256x256 pixels PNG flavor.

For the one who merges the change: please just ensure that the commit message is complete, see #17473 (comment)

@zooba
Copy link
Member

zooba commented Feb 5, 2020

Could someone with the SVG also create 44x44 and 150x150 sized versions? (Like the pythonx44.png and pythonx150.png files in PC/icons.)

These are the sizes used for the tiles created by the Microsoft Store installer, and referenced from PC\layout\support\appxmanifest.py (search for pythonwx to find the current IDLE and pythonw references).

@hroncok
Copy link
Contributor Author

hroncok commented Feb 5, 2020

I cannot do it right now, but the SVG is attached here: https://github.com/python/cpython/files/3927351/idle-256px.svg.tar.gz

@hroncok
Copy link
Contributor Author

hroncok commented Feb 5, 2020

and this one has scalable versions of the smaller icons, more likely to be useful for the 44x44 version: http://haypo.alwaysdata.net/tmp/idle.svgz

@hroncok
Copy link
Contributor Author

hroncok commented Feb 26, 2020

@terryjreedy Should we still wait for your review?

@hroncok
Copy link
Contributor Author

hroncok commented Feb 26, 2020

44x44:

idle-44px

150x150:

idle-150px

Copy link
Member

@terryjreedy terryjreedy left a comment

Choose a reason for hiding this comment

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

As is, the patch seems incomplete and it is not clear what effects it will have. (Revised from first post.) The relevant code in idlelib.pyshell is

    # set application icon
    icondir = os.path.join(os.path.dirname(__file__), 'Icons')
    if system() == 'Windows':
        iconfile = os.path.join(icondir, 'idle.ico')
        root.wm_iconbitmap(default=iconfile)
    elif not macosx.isAquaTk():
        ext = '.png' if TkVersion >= 8.6 else '.gif'
        iconfiles = [os.path.join(icondir, 'idle_%d%s' % (size, ext))
                     for size in (16, 32, 48)]
        icons = [PhotoImage(master=root, file=iconfile)
                 for iconfile in iconfiles]
        root.wm_iconphoto(True, *icons)

The patch has an expanded multi-icon idle.ico for Windows. Since it will only be used on Vista+, It should have been made from the 4 .pngs. Was it?

An expanded multi-icon idle.icns is needed for macOS Aqua, made from the 4 .pngs. The mac installer must separately grab idle.icns and give it to the OS for whatever use it makes of it.

For *nix, either idle_256.gif must be added, and 256 added to the list in the code above, or the code needs revision to tolerate its absence.

Except on macOS Aqua, I am not sure if the new size will ever by used, as the code above only affects the little icon in upper-left corners of windows. (After I posted this, I notice that Fedora also grabs the icons from IDLE for use elsewhere.)

I don't know what the Content include lines do. idle.icns is installed even though not 'Content include'd. The .gif and .png files are not directly used, at least not by IDLE. But worrying about this is another issue.

It seems to me that since installing tkinter/IDLE is generally optional, icons needs by other than IDLE should be stored somewhere else always installed, and 'imported' as needed by IDLE.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@miss-islington
Copy link
Contributor

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 22, 2020
Icon author: Andrew Clover, bpo-1490384
(cherry picked from commit 3a69f3c)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
@bedevere-bot
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 22, 2020
Icon author: Andrew Clover, bpo-1490384
(cherry picked from commit 3a69f3c)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
@bedevere-bot
Copy link

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

@terryjreedy
Copy link
Member

Please make a 2nd PR, same issue, for the .ico. Even if the 256 icon is not used, the png versions of the others may improve on the .gif versions.

hroncok added a commit to hroncok/cpython that referenced this pull request Apr 22, 2020
miss-islington added a commit that referenced this pull request Apr 22, 2020
Icon author: Andrew Clover, bpo-1490384
(cherry picked from commit 3a69f3c)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
@hroncok
Copy link
Contributor Author

hroncok commented Apr 22, 2020

#19648

@hroncok hroncok deleted the idle256 branch April 22, 2020 07:39
miss-islington added a commit that referenced this pull request Apr 22, 2020
Icon author: Andrew Clover, bpo-1490384
(cherry picked from commit 3a69f3c)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Fedora Stable Clang Installed 3.x has failed when building commit 3a69f3c.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/127/builds/647) and take a look at the build logs.
  4. Check if the failure is related to this commit (3a69f3c) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/127/builds/647

Failed tests:

  • test_concurrent_futures

Failed subtests:

  • test_killed_child - test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest

Summary of the results of the build (if available):

== Tests result: FAILURE then FAILURE ==

403 tests OK.

1 test failed:
test_concurrent_futures

17 tests skipped:
test_asdl_parser test_check_c_globals test_clinic test_devpoll
test_gdb test_ioctl test_kqueue test_msilib test_ossaudiodev
test_startfile test_tix test_tk test_ttk_guionly test_winconsoleio
test_winreg test_winsound test_zipfile64

1 re-run test:
test_concurrent_futures

Total duration: 6 min 21 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 300, in _run_finalizers
    finalizer()
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 224, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 300, in _run_finalizers
    finalizer()
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 224, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 300, in _run_finalizers
    finalizer()
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 224, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 300, in _run_finalizers
    finalizer()
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 224, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 300, in _run_finalizers
    finalizer()
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 224, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
FileNotFoundError: [Errno 2] No such file or directory
Warning -- multiprocessing.process._dangling was modified by test_concurrent_futures
  Before: set()
  After:  {<weakref at 0x7f5bdf04d090; to 'SpawnProcess' at 0x7f5bdf07da00>, <weakref at 0x7f5bdf04d040; to 'SpawnProcess' at 0x7f5bdf1f8eb0>, <weakref at 0x7f5bdf04df90; to 'SpawnProcess' at 0x7f5bdf07d340>, <weakref at 0x7f5bdf051040; to 'SpawnProcess' at 0x7f5bdf07d370>, <weakref at 0x7f5bdf04d4a0; to 'SpawnProcess' at 0x7f5bdf176dc0>} 
Warning -- threading._dangling was modified by test_concurrent_futures
  Before: {<weakref at 0x7f5bdda2d220; to '_MainThread' at 0x7f5be056bfd0>}
  After:  {<weakref at 0x7f5bdf07aa40; to '_ExecutorManagerThread' at 0x7f5bdf176580>, <weakref at 0x7f5bdf07a590; to '_MainThread' at 0x7f5be056bfd0>, <weakref at 0x7f5bdf051090; to 'Thread' at 0x7f5bdf07db80>} 


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 300, in _run_finalizers
    finalizer()
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 224, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 300, in _run_finalizers
    finalizer()
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 224, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 300, in _run_finalizers
    finalizer()
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 224, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 300, in _run_finalizers
    finalizer()
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 224, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
FileNotFoundError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 300, in _run_finalizers
    finalizer()
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/util.py", line 224, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/synchronize.py", line 87, in _cleanup
    sem_unlink(name)
FileNotFoundError: [Errno 2] No such file or directory


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/test/test_concurrent_futures.py", line 130, in tearDown
    self.executor.shutdown(wait=True)
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/concurrent/futures/process.py", line 724, in shutdown
    self._executor_manager_thread_wakeup.wakeup()
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/concurrent/futures/process.py", line 80, in wakeup
    self._writer.send_bytes(b"")
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/connection.py", line 205, in send_bytes
    self._send_bytes(m[offset:offset + size])
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/connection.py", line 416, in _send_bytes
    self._send(header + buf)
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/connection.py", line 373, in _send
    n = write(self._handle, buf)
OSError: [Errno 9] Bad file descriptor

@hroncok
Copy link
Contributor Author

hroncok commented Apr 22, 2020

@stratakis is that ours? Hardly related here.

@stratakis
Copy link
Contributor

@hroncok indeed it is, but the failure seems unrelated.

@vstinner
Copy link
Member

@stratakis is that ours? Hardly related here.

Sadly, there are many known buildbot failures. Search for bugs that I reopened which contain "test" in the title to have an idea :-)

This one is likely this bug: https://bugs.python.org/issue39995 Reported one month ago, nobody investigated it yet.

@taleinat
Copy link
Contributor

@taleinat Ned disposed of the .icns issue. Do you currently have a respository on Windows? If so, can you verify that IDLE runs with the current patch and new .ico file?

Tested now, works great on my Windows 10 machine.

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.

10 participants