From 4a52a71956a8d46fcb7294ac71734504bb09bcc2 Mon Sep 17 00:00:00 2001 From: S. Solomon Darnell Date: Fri, 28 Mar 2025 21:52:21 -0500 Subject: two version of R2R are here --- .../site-packages/setuptools/windows_support.py | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .venv/lib/python3.12/site-packages/setuptools/windows_support.py (limited to '.venv/lib/python3.12/site-packages/setuptools/windows_support.py') diff --git a/.venv/lib/python3.12/site-packages/setuptools/windows_support.py b/.venv/lib/python3.12/site-packages/setuptools/windows_support.py new file mode 100644 index 00000000..7a2b53a2 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/setuptools/windows_support.py @@ -0,0 +1,30 @@ +import platform + + +def windows_only(func): + if platform.system() != 'Windows': + return lambda *args, **kwargs: None + return func + + +@windows_only +def hide_file(path: str) -> None: + """ + Set the hidden attribute on a file or directory. + + From https://stackoverflow.com/questions/19622133/ + + `path` must be text. + """ + import ctypes + import ctypes.wintypes + + SetFileAttributes = ctypes.windll.kernel32.SetFileAttributesW + SetFileAttributes.argtypes = ctypes.wintypes.LPWSTR, ctypes.wintypes.DWORD + SetFileAttributes.restype = ctypes.wintypes.BOOL + + FILE_ATTRIBUTE_HIDDEN = 0x02 + + ret = SetFileAttributes(path, FILE_ATTRIBUTE_HIDDEN) + if not ret: + raise ctypes.WinError() -- cgit v1.2.3