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
Do not automatically remove temporary ImageShow files on Unix #6045
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
I have tested the functionality (Ubuntu 20.04): show() function worked well for all the viewers except GmDisplayViewer. In case of single file the image was sometimes shown and sometimes not shown. For multiple images, in my case 3 images, only two images showed up. I do not have any good explanation for such behavior of GmDisplayViewer...
-
Good news: the temporary image files get deleted on reboot (Ubuntu 20.04)
-
Code:
(a) I think there is a backwards compatibility issue with viewers interface, I'm talking here about get_command() function. This function is redundant for Mac and Unix viewers. There is also a consistency issue if one compares Windows viewer implementation vs Mac and Unix.
(b) I would say that DRY principle is violated for Unix viewers image_show() method.
(c) Unix viewers get_command_ex() method became redundant, and it doesn't reflect the actually implemented functionality.
(d) get_command() method does not reflect actually implemented functionality.
Summary: the key thing here is to make a decision about viewers interface: either implement the new approach to all the viewers, or stick with the old interface, and apply it to all the viewers.
|
In the Viewer class viewers interface is defined. As per this definition the get_command() is expected to return specific viewer's display command, the return value of the get_command() function is expected to be used by show_file() method. Question: What is the purpose of get_command() and get_command_ex() in this PR? |
I am confused by your comment. I have proposed minimal changes to
Are you just having a conversation about ImageShow in general, rather than reviewing my changes here? It's ok if you are, I just don't feel like that's clear. If you're asking why |
|
Sorry, I forgot to switch to my regular account 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ImageShow.show()
does not returnTrue
andFalse
like the docstring states, it returns 0 and 1.
>>> True == 1
True
>>> False == 0
True
>>>
;)
Returning True
or False
is nicer. 👍
Let's include in the release notes too the fact they're no longer automatically* removed, so people know it's their job to clear it out if for example they show lots of images and don't reboot often.
(* Shall we rename "manually" -> "automatically" in the PR title?)
Thanks! |
Helps #5945 and #5976. Alternative to #6021
Three changes here.
ImageShow.show()
does not returnTrue
andFalse
like the docstring states, it returns 0 and 1. This PR updates the return values to match the docstring.display -title
looks preferable todisplay -name
.