Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
bd2cdae
bpo-45447: Add syntax highlighting for `.pyi` files in IDLE
AlexWaygood Oct 14, 2021
b12399d
Improve news entry.
AlexWaygood Oct 15, 2021
96d5a88
Improve docstring at top of util.py
AlexWaygood Oct 15, 2021
eee661e
Improve tests
AlexWaygood Oct 15, 2021
b9ef62b
Use keyword arguments in test_util.py
AlexWaygood Oct 15, 2021
44fb0f1
Correct alphabetical order in README.txt...
AlexWaygood Oct 15, 2021
2d8e0e8
Update coverage statistics in test files
AlexWaygood Oct 15, 2021
4bba476
Add __main__ block for util.py, tweak added test for iomenu.py, tweak…
AlexWaygood Oct 16, 2021
be0043e
Tweak test_util.py
AlexWaygood Oct 18, 2021
f8906a5
Merge branch 'python:main' into idle-pyi-syntax-highlighting
AlexWaygood Oct 28, 2021
5dc03fa
Update Lib/idlelib/util.py
AlexWaygood Jan 16, 2022
4b2c36c
Add example `.pyi` file
AlexWaygood Jan 16, 2022
e9dfeb1
Revert changes to coverage statistics
AlexWaygood Jan 24, 2022
a197c93
Rename `example.pyi` to `example_stub.pyi`
AlexWaygood Jan 24, 2022
eb754bd
Have stub files combined with other Python files in `iomenu.py`
AlexWaygood Jan 24, 2022
e32bfca
Merge remote-tracking branch 'origin/main' into idle-pyi-syntax-highl…
AlexWaygood Jan 24, 2022
c6bd524
Fix broken test, improve other tests
AlexWaygood Jan 24, 2022
5a74935
Add `example_noext` file
AlexWaygood Jan 24, 2022
84b9251
Add entry to 'What's new in 3.11'
AlexWaygood Jan 24, 2022
f790a82
Merge remote-tracking branch 'upstream/main' into pr_28950
terryjreedy Feb 6, 2022
b5e781e
Merge remote-tracking branch 'upstream/main' into pr_28950
terryjreedy Feb 11, 2022
58fef8e
Revert changes in browser.py
terryjreedy Feb 11, 2022
00a51b2
Revert changes to editor.EditorWindow.ispythonsource.
terryjreedy Feb 11, 2022
a589099
Revise util, removing new functions.
terryjreedy Feb 11, 2022
647ae1a
Revise test_util, deleting most tests.
terryjreedy Feb 11, 2022
a090db7
Use tuple instead of frozen set.
terryjreedy Feb 11, 2022
fc9e587
Update 2021-10-14-16-55-03.bpo-45447.FhiH5P.rst
terryjreedy Feb 11, 2022
70f06f1
Create 3.11.rst
terryjreedy Feb 11, 2022
d4d3906
Update 3.11.rst
terryjreedy Feb 11, 2022
aafd8e2
Revert unwanted changed to what's new
terryjreedy Feb 11, 2022
e4b289a
Remove commented-out line
AlexWaygood Feb 11, 2022
91651a7
Merge remote-tracking branch 'upstream/main' into pr_28950
terryjreedy Feb 12, 2022
4931b3f
Final tweaks.
terryjreedy Feb 12, 2022
38e5fc0
Merge branch 'idle-pyi-syntax-highlighting' of https://github.com/Ale…
terryjreedy Feb 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add __main__ block for util.py, tweak added test for iomenu.py, tweak…
… docstrings to keep line length within 72 chars
  • Loading branch information
AlexWaygood committed Oct 16, 2021
commit 4bba476b5107819b47499d61aed0e842dcdc09c0
6 changes: 3 additions & 3 deletions Lib/idlelib/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ def __init__(self, master, path, *, _htest=False, _utest=False):

Instance variables:
name: Module name.
file: Full path and module with a valid Python extension. Used in
creating ModuleBrowserTreeItem as the rootnode for
the tree and subsequently in the children.
file: Full path and module with a valid Python extension.
Used in creating ModuleBrowserTreeItem as the rootnode
for the tree and subsequently in the children.
"""
self.master = master
self.path = path
Expand Down
6 changes: 3 additions & 3 deletions Lib/idlelib/idle_test/test_iomenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_fixnewlines_end(self):

def _extension_is_in_IOBinding_dot_filetypes(extension):
return any(
extension in filetype_tuple[1]
f'*{extension}' in filetype_tuple[1]
for filetype_tuple in iomenu.IOBinding.filetypes
)

Expand All @@ -58,10 +58,10 @@ def test_python_source_files(self):
self.assertTrue(_extension_is_in_IOBinding_dot_filetypes(extension))

def test_text_files(self):
self.assertTrue(_extension_is_in_IOBinding_dot_filetypes('*.txt'))
self.assertTrue(_extension_is_in_IOBinding_dot_filetypes('.txt'))

def test_all_files(self):
self.assertTrue(_extension_is_in_IOBinding_dot_filetypes('*'))
self.assertTrue(_extension_is_in_IOBinding_dot_filetypes(''))


if __name__ == '__main__':
Expand Down
7 changes: 6 additions & 1 deletion Lib/idlelib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


def is_python_extension(extension, valid_extensions=PYTHON_EXTENSIONS):
"""Identify whether a given string is a valid Python file extension."""
"Identify whether a given string is a valid Python file extension."
return extension in valid_extensions


Expand All @@ -33,3 +33,8 @@ def is_python_source(filepath, firstline=None):
and firstline.startswith('#!')
and 'python' in firstline
)


if __name__ == '__main__':
from unittest import main
main('idlelib.idle_test.test_util', verbosity=2)