bpo-45447: Add syntax highlighting for .pyi files in IDLE (GH-28950)

Also add .pyi to the python extensions in the "File-open" and "File-save" dialogues.
Add util.py to contain objects that are used in multiple idlelib modules
and have no dependencies on any of them.

Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 50cf4991c4)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Terry Jan Reedy 2022-02-12 19:52:37 -05:00 committed by GitHub
parent b7a65c939c
commit 9fabcfbe68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 77 additions and 3 deletions

View file

@ -11,6 +11,9 @@
import idlelib
from idlelib.config import idleConf
from idlelib.util import py_extensions
py_extensions = ' '.join("*"+ext for ext in py_extensions)
encoding = 'utf-8'
if sys.platform == 'win32':
@ -348,7 +351,7 @@ def print_window(self, event):
savedialog = None
filetypes = (
("Python files", "*.py *.pyw", "TEXT"),
("Python files", py_extensions, "TEXT"),
("Text files", "*.txt", "TEXT"),
("All files", "*"),
)