Commit Graph

53 Commits

Author SHA1 Message Date
Wulian233 89f7208f67
gh-120633: Move scrollbar and remove tear-off menus in turtledemo (#120634)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-06-19 02:20:54 -04:00
Jason R. Coombs c8b45a385a
gh-118673: Remove shebang and executable bits from stdlib modules. (#119658)
* gh-118673: Remove shebang and executable bits from stdlib modules.

* Removed shebangs and exe bits on turtledemo scripts.

The setting was inappropriate for '__main__' and inconsistent across the other modules. The scripts can still be executed directly by invoking with the desired interpreter.
2024-05-29 12:43:19 -04:00
Wulian233 538ed5e481
gh-119174: Fix high DPI causes turtledemo(turtle-graphics examples) windows blurry (#119175)
------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-05-20 23:32:00 -04:00
Terry Jan Reedy b802882fb2
gh-111092: Make turtledemo run without default root enabled (#111093)
Add missing 'root' argument to PanedWindow call.
Other root children already have it.
2023-10-19 23:58:41 -04:00
Terry Jan Reedy 96f95df48e
Rewrite the turtledemo makeGraphFrame method (#104224)
Replace `self._canvas` and `self.scanvas`, both bound to `canvas`,
with `self.canvas, which is accessed in other methods.
Replace `_s_` with `screen` and `_s_._canvas` with `canvas`.
Add a comment explaining the unorthodox use of
function turtle.Screen and singleton class turtle._Screen.
2023-05-06 11:09:08 -04:00
Shin-myoung-serp 4652093e1b
gh-91212: Fixed flickering when the tracer is turned off (#95129)
Fixed flickering when the tracer is turned off.
2022-09-28 23:40:51 -07:00
Terry Jan Reedy af5a324843
bpo-44254: On Mac, remove disfunctional colors from turtledemo buttons (GH-26448)
On macOS, tk defers to system setting for button background when in normal state.
Give turtledemo button text a color that works on either light or dark background.
2021-05-29 03:19:50 -04:00
Terry Jan Reedy 4e2ef70841
Fix typo in turtledemo.two_canvases. (GH-25194) 2021-04-05 13:19:13 -04:00
Miro Hrončok 49f70db83e
bpo-40431: Fix syntax typo in turtledemo (GH-19777)
***   File "/usr/lib64/python3.9/turtledemo/__main__.py", line 275
        bg="#d00" if clear == NORMAL else"#fca")
                                        ^
    SyntaxError: invalid string prefix
2020-04-29 02:00:07 +02:00
Greg Price fa3a38d81f Mark files as executable that are meant as scripts. (GH-15354)
This is the converse of GH-15353 -- in addition to plenty of
scripts in the tree that are marked with the executable bit
(and so can be directly executed), there are a few that have
a leading `#!` which could let them be executed, but it doesn't
do anything because they don't have the executable bit set.

Here's a command which finds such files and marks them.  The
first line finds files in the tree with a `#!` line *anywhere*;
the next-to-last step checks that the *first* line is actually of
that form.  In between we filter out files that already have the
bit set, and some files that are meant as fragments to be
consumed by one or another kind of preprocessor.

    $ git grep -l '^#!' \
      | grep -vxFf <( \
          git ls-files --stage \
          | perl -lane 'print $F[3] if (!/^100644/)' \
        ) \
      | grep -ve '\.in$' -e '^Doc/includes/' \
      | while read f; do
          head -c2 "$f" | grep -qxF '#!' \
          && chmod a+x "$f"; \
        done
2019-09-09 07:16:33 -07:00
Greg Price 9ece4a5057 Unmark files as executable that can't actually be executed. (GH-15353)
There are plenty of legitimate scripts in the tree that begin with a
`#!`, but also a few that seem to be marked executable by mistake.

Found them with this command -- it gets executable files known to Git,
filters to the ones that don't start with a `#!`, and then unmarks
them as executable:

    $ git ls-files --stage \
      | perl -lane 'print $F[3] if (!/^100644/)' \
      | while read f; do
          head -c2 "$f" | grep -qxF '#!' \
          || chmod a-x "$f"; \
        done

Looking at the list by hand confirms that we didn't sweep up any
files that should have the executable bit after all.  In particular

 * The `.psd` files are images from Photoshop.

 * The `.bat` files sure look like things that can be run.
   But we have lots of other `.bat` files, and they don't have
   this bit set, so it must not be needed for them.



Automerge-Triggered-By: @benjaminp
2019-08-20 21:53:59 -07:00
Xtreak 0d70227e41 Fix typos in docs and docstrings (GH-13745) 2019-06-03 01:12:33 +02:00
Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి) 9f270a2423 turtledemo/penrose.py: remove unused clock() calls (GH-10033)
Actually time calculations were remove in commit 891a1f8.
2018-10-25 00:43:39 +02:00
Terry Jan Reedy 891a1f86d4
bpo-14117: Make minor tweaks to turtledemo (GH-8002)
The 'wikipedia' example is now 'rosette', describing what it draws.
The 'penrose' print output is reduced.  The 'tree' '1024'
output is eliminated.
2018-06-29 01:10:05 -04:00
Mike 53f7a7c281 bpo-32297: Few misspellings found in Python source code comments. (#4803)
* Fix multiple typos in code comments

* Add spacing in comments (test_logging.py, test_math.py)

* Fix spaces at the beginning of comments in test_logging.py
2017-12-14 13:04:53 +02:00
Victor Stinner 696b501cd1
bpo-32155: Bugfixes found by flake8 F841 warnings (#4608)
* distutils.config: Use the PyPIRCCommand.realm attribute if set
* turtledemo: wait until macOS osascript command completes to not
  create a zombie process
* Tools/scripts/treesync.py: declare 'default_answer' and
  'create_files' as globals to modify them with the command line
  arguments. Previously, -y, -n, -f and -a options had no effect.

flake8 warning: "F841 local variable 'p' is assigned to but never
used".
2017-11-28 15:30:32 +01:00
Victor Stinner 884d13a55f time.clock() now emits a DeprecationWarning (GH-4020)
bpo-31803: time.clock() and time.get_clock_info('clock') now emit a
DeprecationWarning warning.

Replace time.clock() with time.perf_counter() in tests and demos.

Remove also hasattr(time, 'monotonic') in test_time since time.monotonic()
is now always available since Python 3.5.
2017-10-17 14:46:45 -07:00
Jon Dufresne 3972628de3 bpo-30296 Remove unnecessary tuples, lists, sets, and dicts (#1489)
* Replaced list(<generator expression>) with list comprehension
* Replaced dict(<generator expression>) with dict comprehension
* Replaced set(<list literal>) with set literal
* Replaced builtin func(<list comprehension>) with func(<generator
  expression>) when supported (e.g. any(), all(), tuple(), min(), &
  max())
2017-05-18 07:35:54 -07:00
Terry Jan Reedy 2bac3b778f Issue #27117: Make colorizer htest and turtledemo work with dark theme.
Factor out code for configuring text widget colors to a new function.
2016-05-29 01:40:22 -04:00
Terry Jan Reedy 6fa5bdc6e8 Issue #24225: Within idlelib files, update idlelib module names.
This follows the previous patch that changed idlelib file names.
Class names that matched old module names are not changed.
Change idlelib imports in turtledemo.__main__.

Exception: config-extensions.def.  Previously, extension section
names, file names, and class names had to match.  Changing section
names would create cross-version conflicts in config-extensions.cfg
(user customizations).  Instead map old names to new file names
at point of import in editor.EditorWindow.load_extension.

Patch extensively tested with test_idle, idle_test.htest.py, a custom
import-all test, running IDLE in a console to catch messages,
and testing each menu item.  Based on a patch by Al Sweigart.
2016-05-28 13:22:31 -04:00
Serhiy Storchaka ccd047ea4b Removed unused imports. 2016-04-25 00:12:32 +03:00
Ethan Furman 738f805074 issue19075: add visual sorting algorithms to turtledemo; original code from Jason Yeo 2015-03-02 12:29:58 -08:00
Serhiy Storchaka 4f38e483c2 Issue #6639: Module-level turtle functions no longer raise TclError after
closing the window.
2015-02-22 17:26:35 +02:00
Serhiy Storchaka 80a1803193 Issue #6639: Module-level turtle functions no longer raise TclError after
closing the window.
2015-02-22 17:25:33 +02:00
Terry Jan Reedy 867579972d De-'colour'ize stdlib except for idlelib.configDialog.
Tweak docstrigs and comments in affected functions in idlelib.configHandler.
2014-10-09 18:44:32 -04:00
Terry Jan Reedy d43ffc9aba Issue #21933: Make Control-Mousewhell only change font size and not also scroll.
Original patch by Serhiy Storchaka.
2014-09-04 20:59:41 -04:00
Terry Jan Reedy 70349141ee Issue #22051: remove unneeded reload that allowed bad code. 2014-09-03 19:29:17 -04:00
Terry Jan Reedy c6a1c02cce Issue #21933: Users can now change the font size for example code.
Original patch by Lita Cho.
2014-09-03 16:17:41 -04:00
Terry Jan Reedy 2ced87f3e6 Issue #22065: Remove the now unsed configGUI menu parameter and arguments. 2014-08-27 01:58:40 -04:00
Terry Jan Reedy 8450c53315 Issue #22065: Menus, unlike Menubottons, do not have a state option.
Since a new demo can now be loaded while one is running,
adjust loadfile to do the same cleanup as stopIt.
2014-08-27 01:43:50 -04:00
Terry Jan Reedy f819ef74da Issue #22065: Update turtledemo menu creation; don't use obsolete Menubutton. 2014-08-15 01:23:02 -04:00
Terry Jan Reedy 011b55b8d7 #22053: actually remove .txt files from 3.4. 2014-08-15 00:55:42 -04:00
Terry Jan Reedy 94ee51ed9e Issue #10291: Backport 004fe3449193 with a few changes due to 22095.
Will forward port 22095 changes separately.
2014-08-14 23:59:32 -04:00
Terry Jan Reedy 7e55db2bc5 Issue #17172: Add the ability to run turtledemo from Idle.
Make turtledemo start as active on Mac even when run with subprocess.
Patch by Ramchandra Apt, Lita Cho, and Ned Daily.
2014-07-28 22:23:59 -04:00
Terry Jan Reedy 8b95d5e0bf Modernize turtledemo with conditional expressions; remove duplicate line. 2014-07-27 03:01:13 -04:00
Terry Jan Reedy 5c1b8f3de6 Issue #22061: remove call of useless function slated for removal. 2014-07-25 03:06:32 -04:00
Terry Jan Reedy 280aace067 Issue #22053: Make help work, after previous patch for this issue disabled it
by removing global 'demo'. Refactor and remove duplicate code.
2014-07-25 01:56:24 -04:00
Terry Jan Reedy b8352e7253 Issue #22053: Cleanup turtledemo start and stop and fix debug shutdown warning. 2014-07-23 17:27:57 -04:00
Terry Jan Reedy b03f0422c5 Issue #21597: Turtledemo text pane can now be widened to view or copy complete
lines or narrowed for small screens.
Issie #19132: Turtledemo buttons no longer disappear when window is shrun.
Patch mostly by Lita Cho (21597) using idea from patch by Jan Kanis (18132).
2014-07-23 15:01:12 -04:00
Terry Jan Reedy f5ac57dc05 Issue #21882: In turtle demos, remove module scope gui and sys calls by
either deleting or moving to the module's main function.
2014-06-30 16:09:24 -04:00
Terry Jan Reedy c5a72e6971 Issue #14117: Inprove help text and docstrings, some for clarity, some just to
fit in the default width of the text window (45 chars).
2014-06-24 22:21:41 -04:00
Terry Jan Reedy f51531e257 Issue #21823: Catch turtle.Terminator exceptions in turtledemo.
Add note to demohelp.txt about doing so.
2014-06-22 01:18:54 -04:00
Serhiy Storchaka 8f8ec92de8 Issue #19936: Added executable bits or shebang lines to Python scripts which
requires them.  Disable executable bits and shebang lines in test and
benchmark files in order to prevent using a random system python, and in
source files of modules which don't provide command line interface.  Fixed
shebang lines in the unittestgui and checkpip scripts.
2014-01-16 17:33:23 +02:00
Serhiy Storchaka b992a0e102 Issue #19936: Added executable bits or shebang lines to Python scripts which
requires them.  Disable executable bits and shebang lines in test and
benchmark files in order to prevent using a random system python, and in
source files of modules which don't provide command line interface.  Fixed
shebang line to use python3 executable in the unittestgui script.
2014-01-16 17:15:49 +02:00
Brett Cannon e7e1deef17 Issue # 17177: Stop using imp in turtledemo 2013-06-15 17:33:27 -04:00
Sandro Tosi 2a389e4601 #12677: correct turtle orientation in doc 2011-08-07 17:12:19 +02:00
Ezio Melotti 3b3499ba69 #11565: Merge with 3.1. 2011-03-16 11:35:38 +02:00
Georg Brandl 076cbae4b9 Add the missing __main__.py in the turtledemo package. It seems to have been lost during some mass rename action (r86095). 2010-12-30 22:31:10 +00:00
Alexander Belopolsky e6fa3811f7 Translated German message into English. 2010-11-01 18:42:01 +00:00
Alexander Belopolsky f4b321b31e Issue #10199: Fixing r86095 - svn did not like combining rename and change of directory. 2010-11-01 18:17:20 +00:00