2022-02-13 01:04:48 +01:00
|
|
|
"""
|
|
|
|
Idlelib objects with no external idlelib dependencies
|
|
|
|
which are needed in more than one idlelib module.
|
|
|
|
|
|
|
|
They are included here because
|
|
|
|
a) they don't particularly belong elsewhere; or
|
|
|
|
b) because inclusion here simplifies the idlelib dependency graph.
|
|
|
|
|
|
|
|
TODO:
|
|
|
|
* Python versions (editor and help_about),
|
|
|
|
* tk version and patchlevel (pyshell, help_about, maxos?, editor?),
|
|
|
|
* std streams (pyshell, run),
|
|
|
|
* warning stuff (pyshell, run).
|
|
|
|
"""
|
2024-05-21 05:32:00 +02:00
|
|
|
import sys
|
2022-02-13 01:04:48 +01:00
|
|
|
|
2023-12-17 01:51:25 +01:00
|
|
|
# .pyw is for Windows; .pyi is for typing stub files.
|
|
|
|
# The extension order is needed for iomenu open/save dialogs.
|
|
|
|
py_extensions = ('.py', '.pyw', '.pyi')
|
2023-12-04 07:36:40 +01:00
|
|
|
|
2024-05-21 05:32:00 +02:00
|
|
|
|
|
|
|
# Fix for HiDPI screens on Windows. CALL BEFORE ANY TK OPERATIONS!
|
|
|
|
# URL for arguments for the ...Awareness call below.
|
|
|
|
# https://msdn.microsoft.com/en-us/library/windows/desktop/dn280512(v=vs.85).aspx
|
|
|
|
if sys.platform == 'win32': # pragma: no cover
|
|
|
|
def fix_win_hidpi(): # Called in pyshell and turtledemo.
|
|
|
|
try:
|
|
|
|
import ctypes
|
|
|
|
PROCESS_SYSTEM_DPI_AWARE = 1 # Int required.
|
|
|
|
ctypes.OleDLL('shcore').SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE)
|
|
|
|
except (ImportError, AttributeError, OSError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2022-02-13 01:04:48 +01:00
|
|
|
if __name__ == '__main__':
|
|
|
|
from unittest import main
|
|
|
|
main('idlelib.idle_test.test_util', verbosity=2)
|