GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Alternative behavior for exit, help, license builtins by bittner · Pull Request #133 · PythonTurtle/PythonTurtle Conversation
Member
Instead of simply deactivating the builtins that cause trouble on the UI we can implement some useful behavior:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
bittner
commented
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want to fire an "exit the application" event. Unfortunately, this doesn't work. Any idea, @cool-RR? Unfortunately, brute-force attempts like
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about calling the
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does nothing. It even returns
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could investigate but it's not worth the time. As far as I'm concerned you can make
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
cool-RR
approved these changes
|
| if object: | ||
| print(object.__doc__) | ||
| else: | ||
| self.window.show_help() |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work either. For some reason the window has lost some attributes:
>>> help() Traceback (most recent call last): File "/usr/lib/python3.6/code.py", line 91, in runcode exec(code, self.locals) File "<console>", line 1, in <module> File "/home/peter/PythonTurtle/pythonturtle/turtleprocess.py", line 80, in help self.window.show_help() File "/home/peter/PythonTurtle/pythonturtle/application.py", line 177, in show_help self.help_menu_item.Check() AttributeError: 'ApplicationWindow' object has no attribute 'help_menu_item'
@cool-RR, do you know a way to trigger the "Teach me" button or the <F1> key?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Did you try calling ApplicationWindow.show_help?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
That's what the code does, isn't it?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Oops, I'm a dumbass. I could investigate, but this is very unimportant. You can make it a no-op in the case where an object wasn't specified.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@bittner Did you get my emails? I'd like to chat with you on Telegram, if you're available. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| UI. We open the default web browser with the Python website | ||
| displaying the license instead. | ||
| """ | ||
| webbrowser.open('https://docs.python.org/3/license.html') |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is a compromise that does, of course, not work offline. We could try to find out whether the license is available as a file in a Python installation and is somehow accessible for printing out. Otherwise, I'd guess this is acceptable. Who will run this function anyway?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is definitely some very esoteric functionality. Your solution is above and beyond what we need.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Let's stick to PEP 257. I can change it accordingly. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Compromise: I'm okay with double quotes, but I really hate the lack of space that PEP 257 suggests between the first |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Trying a few things and looking at the code after discussing the problem on the wxPython-users Google Group I figured that the problem I'm facing could be related to multiprocessing. PythonTurtle, when you start it up, is actually running two processes: The main process, hosting all the wxPython business (if I figure correctly), and the TurtleProcess, which is forked as a separate process from the parent process (according to the Unix OS theory). Could that be why the code behaves weird when I access the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This explanation sounds very likely. I think that to implement |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
c5fb9a5 to
e3520c4
Compare
e3520c4 to
bdc6bc0
Compare
bdc6bc0 to
f6a09ec
Compare
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.