From 5c68f3db41766e24d5fe6f7adbfd713bc83786a3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 19 Oct 2014 12:52:08 +0100 Subject: The name win32 is a misnomer. Use 'windows_support' instead. --- setuptools/dist.py | 4 ++-- setuptools/win32.py | 19 ------------------- setuptools/windows_support.py | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 21 deletions(-) delete mode 100644 setuptools/win32.py create mode 100644 setuptools/windows_support.py (limited to 'setuptools') diff --git a/setuptools/dist.py b/setuptools/dist.py index 2d9da8c4..4f302232 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -15,7 +15,7 @@ from distutils.errors import (DistutilsOptionError, DistutilsPlatformError, from setuptools.depends import Require from setuptools.compat import basestring, PY2, unicode -from setuptools import win32 +from setuptools import windows_support import pkg_resources def _get_unpatched(cls): @@ -310,7 +310,7 @@ class Distribution(_Distribution): egg_cache_dir = os.path.join(os.curdir, '.eggs') if not os.path.exists(egg_cache_dir): os.mkdir(egg_cache_dir) - win32.hide_file(unicode(egg_cache_dir)) + windows_support.hide_file(unicode(egg_cache_dir)) readme_txt_filename = os.path.join(egg_cache_dir, 'README.txt') with open(readme_txt_filename, 'w') as f: f.write('This directory contains eggs that were downloaded ' diff --git a/setuptools/win32.py b/setuptools/win32.py deleted file mode 100644 index fd373009..00000000 --- a/setuptools/win32.py +++ /dev/null @@ -1,19 +0,0 @@ -# From http://stackoverflow.com/questions/19622133/python-set-hide-attribute-on-folders-in-windows-os - -import ctypes - - -def hide_file(path): - """Sets the hidden attribute on a file or directory - - `path` must be unicode; be careful that you escape backslashes or use raw - string literals - e.g.: `u'G:\\Dir\\folder1'` or `ur'G:\Dir\folder1'`. - """ - - SetFileAttributesW = ctypes.windll.kernel32.SetFileAttributesW - - FILE_ATTRIBUTE_HIDDEN = 0x02 - - ret = SetFileAttributesW(path, FILE_ATTRIBUTE_HIDDEN) - if not ret: - raise ctypes.WinError() diff --git a/setuptools/windows_support.py b/setuptools/windows_support.py new file mode 100644 index 00000000..fd373009 --- /dev/null +++ b/setuptools/windows_support.py @@ -0,0 +1,19 @@ +# From http://stackoverflow.com/questions/19622133/python-set-hide-attribute-on-folders-in-windows-os + +import ctypes + + +def hide_file(path): + """Sets the hidden attribute on a file or directory + + `path` must be unicode; be careful that you escape backslashes or use raw + string literals - e.g.: `u'G:\\Dir\\folder1'` or `ur'G:\Dir\folder1'`. + """ + + SetFileAttributesW = ctypes.windll.kernel32.SetFileAttributesW + + FILE_ATTRIBUTE_HIDDEN = 0x02 + + ret = SetFileAttributesW(path, FILE_ATTRIBUTE_HIDDEN) + if not ret: + raise ctypes.WinError() -- cgit v1.2.3