MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / get_executable_version

Function get_executable_version

emrun.py:942–970  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

940
941
942def get_executable_version(filename):
943 try:
944 if WINDOWS:
945 import win32api
946 info = win32api.GetFileVersionInfo(filename, "\\")
947 ms = info['FileVersionMS']
948 ls = info['FileVersionLS']
949 version = win32api.HIWORD(ms), win32api.LOWORD(ms), win32api.HIWORD(ls), win32api.LOWORD(ls)
950 return '.'.join(map(str, version))
951 elif MACOS:
952 plistfile = filename[0:filename.find('MacOS')] + 'Info.plist'
953 info = plistlib.readPlist(plistfile)
954 # Data in Info.plists is a bit odd, this check combo gives best information on each browser.
955 if 'firefox' in filename.lower():
956 return info['CFBundleShortVersionString']
957 if 'opera' in filename.lower():
958 return info['CFBundleVersion']
959 else:
960 return info['CFBundleShortVersionString']
961 elif LINUX:
962 if 'firefox' in filename.lower():
963 version = check_output([filename, '-v'])
964 version = version.replace('Mozilla Firefox ', '')
965 return version.strip()
966 else:
967 return ""
968 except Exception as e:
969 logv(e)
970 return ""
971
972
973def get_browser_build_date(filename):

Callers 2

get_browser_infoFunction · 0.85
list_pc_browsersFunction · 0.85

Calls 6

check_outputFunction · 0.85
logvFunction · 0.85
lowerMethod · 0.80
mapClass · 0.50
joinMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected