Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6d436bd

Browse filesBrowse files
authored
Merge pull request #1555 from stonebig/master
remove what is useless
2 parents 7c1675d + 63f0e95 commit 6d436bd
Copy full SHA for 6d436bd

File tree

Expand file treeCollapse file tree

1 file changed

+7
-16
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-16
lines changed

‎winpython/utils.py

Copy file name to clipboardExpand all lines: winpython/utils.py
+7-16Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ def onerror(function, path, excinfo):
5454
def getFileProperties(fname):
5555
"""Read all properties of the given file return them as a dictionary."""
5656
import win32api
57-
prop_names = (
58-
'Comments', 'InternalName', 'ProductName', 'CompanyName', 'LegalCopyright',
59-
'ProductVersion', 'FileDescription', 'LegalTrademarks', 'PrivateBuild',
60-
'FileVersion', 'OriginalFilename', 'SpecialBuild'
61-
)
57+
prop_names = ('ProductName', 'ProductVersion', 'FileDescription', 'FileVersion')
6258
props = {'FixedFileInfo': None, 'StringFileInfo': None, 'FileVersion': None}
6359

6460
try:
@@ -83,16 +79,11 @@ def getFileProperties(fname):
8379
def get_special_folder_path(path_name):
8480
"""Return special folder path."""
8581
from win32com.shell import shell, shellcon
86-
for maybe in """
87-
CSIDL_COMMON_STARTMENU CSIDL_STARTMENU CSIDL_COMMON_APPDATA
88-
CSIDL_LOCAL_APPDATA CSIDL_APPDATA CSIDL_COMMON_DESKTOPDIRECTORY
89-
CSIDL_DESKTOPDIRECTORY CSIDL_COMMON_STARTUP CSIDL_STARTUP
90-
CSIDL_COMMON_PROGRAMS CSIDL_PROGRAMS CSIDL_PROGRAM_FILES_COMMON
91-
CSIDL_PROGRAM_FILES CSIDL_FONTS""".split():
92-
if maybe == path_name:
93-
csidl = getattr(shellcon, maybe)
94-
return shell.SHGetSpecialFolderPath(0, csidl, False)
95-
raise ValueError(f"{path_name} is an unknown path ID")
82+
try:
83+
csidl = getattr(shellcon, path_name)
84+
return shell.SHGetSpecialFolderPath(0, csidl, False)
85+
except OSError:
86+
print(f"{path_name} is an unknown path ID")
9687

9788
def get_winpython_start_menu_folder(current=True):
9889
"""Return WinPython Start menu shortcuts folder."""
@@ -337,7 +328,7 @@ def buildflit_wininst(root, python_exe=None, copy_to=None, verbose=False):
337328
break
338329
else:
339330
raise RuntimeError(f"Build failed: not a pure Python package? {distdir}")
340-
331+
341332
src_fname = distdir / distname
342333
if copy_to:
343334
dst_fname = Path(copy_to) / distname

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.