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

Turtledemo: exception and minor glitches. #58325

Closed
terryjreedy opened this issue Feb 24, 2012 · 15 comments
Closed

Turtledemo: exception and minor glitches. #58325

terryjreedy opened this issue Feb 24, 2012 · 15 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@terryjreedy
Copy link
Member

BPO 14117
Nosy @rhettinger, @terryjreedy, @vstinner, @willingc, @miss-islington
PRs
  • bpo-14117: Make minor tweaks to turtledemo #8002
  • [3.7] bpo-14117: Make minor tweaks to turtledemo (GH-8002) #8003
  • [3.6] bpo-14117: Make minor tweaks to turtledemo (GH-8002) #8004
  • Dependencies
  • bpo-21597: Allow turtledemo code pane to get wider.
  • bpo-21823: Catch turtle.Terminator exceptions in turtledemo
  • bpo-21882: turtledemo modules imported by test___all__ cause side effects or failures
  • bpo-21933: Allow the user to change font sizes with the text pane of turtledemo
  • bpo-21971: Index and update turtledemo doc.
  • bpo-22051: Turtledemo: stop reloading demos
  • Files
  • 14117_tree_output.patch: Removes print in tree demo
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/terryjreedy'
    closed_at = <Date 2018-06-29.05:33:08.183>
    created_at = <Date 2012-02-24.21:52:45.185>
    labels = ['3.7', '3.8', 'type-bug', 'library']
    title = 'Turtledemo: exception and minor glitches.'
    updated_at = <Date 2018-10-24.22:47:40.911>
    user = 'https://github.com/terryjreedy'

    bugs.python.org fields:

    activity = <Date 2018-10-24.22:47:40.911>
    actor = 'vstinner'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2018-06-29.05:33:08.183>
    closer = 'terry.reedy'
    components = ['Library (Lib)']
    creation = <Date 2012-02-24.21:52:45.185>
    creator = 'terry.reedy'
    dependencies = ['21597', '21823', '21882', '21933', '21971', '22051']
    files = ['38986']
    hgrepos = []
    issue_num = 14117
    keywords = ['patch']
    message_count = 15.0
    messages = ['154164', '221482', '221509', '221518', '221980', '223774', '223783', '240876', '319752', '320696', '320697', '320699', '320701', '320702', '328398']
    nosy_count = 7.0
    nosy_names = ['rhettinger', 'terry.reedy', 'vstinner', 'python-dev', 'willingc', 'cabiad', 'miss-islington']
    pr_nums = ['8002', '8003', '8004']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue14117'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8']

    @terryjreedy
    Copy link
    Member Author

    Win7, 3.2.2, python -m turtledemo in Command Prompt Window

    After running clock example, hitting Stop results in following:
    Clock face, including hands, is erased. Day and date are left (intentional?), and the following appears back in command prompt window.

    Exception in Tkinter callback
    Traceback (most recent call last):
      File "C:\Programs\Python32\lib\tkinter\__init__.py", line 1399, in __call__
        return self.func(*args)
      File "C:\Programs\Python32\lib\tkinter\__init__.py", line 487, in callit
        func(*args)
      File "C:\Programs\Python32\lib\turtledemo\clock.py", line 116, in tick
        second_hand.setheading(6*sekunde)
      File "C:\Programs\Python32\lib\turtle.py", line 1936, in setheading
        self._rotate(angle)
      File "C:\Programs\Python32\lib\turtle.py", line 3279, in _rotate
        self._update()
      File "C:\Programs\Python32\lib\turtle.py", line 2660, in _update
        self._update_data()
      File "C:\Programs\Python32\lib\turtle.py", line 2646, in _update_data
        self.screen._incrementudc()
      File "C:\Programs\Python32\lib\turtle.py", line 1285, in _incrementudc
        raise Terminator
    turtle.Terminator

    Demo continues to run.

    Paint: Left clicking mouse moves dot without painting. Right clicking changes mode so left clicking draws line. It also causes some filling of enclosed regions. This double action is slightly obscure. The prompt on the bottom of the screen says "Use mouse/keys or Stop" As near as I can tell, keys are inactive. So prompt could delete '/keys'.

    Module doc strings that explain each demo should be wrapped so that they appear in the code window without scrolling. Or the left window could be wider, especially if the user widens the window. 800x600 screens are pretty rare these days.

    'Wikipedia' is a poor name for something just because it happened to be there. 'Rosette', for instance, would be better.

    @terryjreedy terryjreedy added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Feb 24, 2012
    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Jun 24, 2014

    Confirmed still a problem in 3.4.1 on Win7.

    @terryjreedy
    Copy link
    Member Author

    bpo-21823 fixed the Terminator issue 3 days ago.

    bpo-21597 is about making the text pane resizable.
    The doc strings for peace, planet_and_moon, and tree need a bit of re-wrapping. The paint instruction is wrong. I am working on these now.

    "Use mouse/keys or Stop" is a generic prompts for all 'special' demos that continue after xyz.main returns. keys is never right for the current set of demos.

    The text for two_canvases does not load. I think this can be fixed.

    @terryjreedy terryjreedy self-assigned this Jun 24, 2014
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jun 25, 2014

    New changeset 129ec3d90a67 by Terry Jan Reedy in branch '2.7':
    Issue bpo-14117: Inprove help text and docstrings, some for clarity, some just to
    http://hg.python.org/cpython/rev/129ec3d90a67

    New changeset 713a774ca68a by Terry Jan Reedy in branch '3.4':
    Issue bpo-14117: Inprove help text and docstrings, some for clarity, some just to
    http://hg.python.org/cpython/rev/713a774ca68a

    @terryjreedy
    Copy link
    Member Author

    21884 removed or moved global system-changing or gui calls to main. Wrapping two_canvases code (except for window preserving mainloop) to a new main fixed its problems.

    Should remove reload from main driver, and test.

    @terryjreedy
    Copy link
    Member Author

    Added bpo-21933, change text font size, as dependency.
    Added new bpo-22051 remove reload, as dependency.
    bpo-18132: stop demo buttons from disappearing, was fixed by bpo-21507 patch.

    @terryjreedy
    Copy link
    Member Author

    bpo-22053 added main(), eliminated 'while RUN', and fixed this a 3.x debug shutdown message.

    The main remaining problem I am aware of now is that some demos 'print' messages to the console (or shell), which would be a problem if there were not one (as with pythonw). Except for one demo, the messages would fit on the demo window message button. A possible fix would be to call demo.main with the button, so mainloop demos could write back to it.
    (Normal demo returns are put there now.)

    @cabiad
    Copy link
    Mannequin

    cabiad mannequin commented Apr 14, 2015

    Running through each of the demos, it seems as though only 'penrose' and 'tree' have console/shell output.

    'penrose' output is a list of information about the current rendering and has a format like:
    Calculation: 0.0009 s
    Drawing: 0.0074 s
    Together: 0.0083 s
    5 kites and 0 darts = 5 pieces.
    (... This repeats with updated information for each rendering ...)

    I believe that there's too much output right now to include this in the demo window's message button area. It might be interesting to show most or all of this information with a turtle.write() in the graphical area, but I think that the better option is just to remove (or at least comment out) the timing information entirely and show only the '5 kites and 0 darts = 5 pieces' portion in the message button area.

    I could submit a patch for either 'penrose' option if there's interest.

    The 'tree' prints a count of the number of turtles created at the end of the run. Console output looks like:
    1024

    I think this is not very useful, except perhaps when debugging the demo. I've attached a patch which removes this output.

    @willingc
    Copy link
    Contributor

    Hi @terry.reedy,

    I'm triaging open "turtle" issues. What do you think would be a reasonable next step for this issue? Perhaps: a contributor runs the demo and reports back here with the current behavior experienced.

    @terryjreedy
    Copy link
    Member Author

    bpo-21884 was closed as a duplicate of bpo-21882 and hence not a separate dependency.

    @terryjreedy
    Copy link
    Member Author

    PR 8002 fixes the remaining minor problems.

    @terryjreedy terryjreedy added 3.7 (EOL) end of life 3.8 only security fixes labels Jun 29, 2018
    @terryjreedy
    Copy link
    Member Author

    New changeset 891a1f8 by Terry Jan Reedy in branch 'master':
    bpo-14117: Make minor tweaks to turtledemo (GH-8002)
    891a1f8

    @miss-islington
    Copy link
    Contributor

    New changeset e2c5a75 by Miss Islington (bot) in branch '3.7':
    bpo-14117: Make minor tweaks to turtledemo (GH-8002)
    e2c5a75

    @miss-islington
    Copy link
    Contributor

    New changeset 00e0524 by Miss Islington (bot) in branch '3.6':
    bpo-14117: Make minor tweaks to turtledemo (GH-8002)
    00e0524

    @vstinner
    Copy link
    Member

    See also bpo-35039 which removed now useless clock() calls from Lib/turtledemo/penrose.py.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants