MacOS codenames

This commit is contained in:
Jay Lee
2019-09-06 11:14:03 -04:00
parent 78404c8cd3
commit eec0df14b5
2 changed files with 17 additions and 1 deletions

View File

@@ -810,7 +810,10 @@ def getOSPlatform():
pltfrm = ' '.join(platform.win32_ver())
elif myos == 'Darwin':
myos = 'MacOS'
pltfrm = platform.mac_ver()[0]
mac_ver = platform.mac_ver()[0]
minor_ver = int(pltfrm.split('.')[1]) # pltfrm 10.14.6 == mac_ver 14
codename = MACOS_CODENAMES.get(minor_ver, '')
pltfrm = ' '.join([codename, mac_ver])
else:
pltfrm = platform.platform()
return '%s %s' % (myos, pltfrm)

View File

@@ -381,6 +381,19 @@ GOOGLEDOC_VALID_EXTENSIONS_MAP = {
MIMETYPE_GA_SPREADSHEET: ['.csv', '.ods', '.pdf', '.xlsx', '.zip'],
}
MACOS_CODENAMES = {
6: 'Snow Leopard',
7: 'Lion',
8: 'Mountain Lion',
9: 'Mavericks',
10: 'Yosemite',
11: 'El Capitan',
12: 'Sierra',
13: 'High Sierra',
14: 'Mojave',
15: 'Catalina'
}
_MICROSOFT_FORMATS_LIST = [{'mime': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'ext': '.docx'},
{'mime': 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'ext': '.dotx'},
{'mime': 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'ext': '.pptx'},