Skip to content

Commit

Permalink
Fixed bug on 10.14
Browse files Browse the repository at this point in the history
Found by arDis on Slack
  • Loading branch information
tuxudo authored Mar 28, 2019
1 parent 534ab61 commit 38aae36
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion scripts/displays.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
import subprocess
import plistlib
import platform

sys.path.insert(0, '/usr/local/munki')

Expand Down Expand Up @@ -206,6 +207,11 @@ def type_get(s):
else:
return 1

def getOsVersion():
"""Returns the minor OS version."""
os_version_tuple = platform.mac_ver()[0].split('.')
return int(os_version_tuple[1])

def main():
"""Main"""
# Create cache dir if it does not exist
Expand All @@ -224,7 +230,10 @@ def main():
info = get_displays_info()

# Read in English localizations from SystemProfiler
localization = FoundationPlist.readPlist('/System/Library/SystemProfiler/SPDisplaysReporter.spreporter/Contents/Resources/English.lproj/Localizable.strings')
if getOsVersion() > 13:
localization = FoundationPlist.readPlist('/System/Library/SystemProfiler/SPDisplaysReporter.spreporter/Contents/Resources/en.lproj/Localizable.strings')
else:
localization = FoundationPlist.readPlist('/System/Library/SystemProfiler/SPDisplaysReporter.spreporter/Contents/Resources/English.lproj/Localizable.strings')

result = flatten_displays_info(info, localization)

Expand Down

0 comments on commit 38aae36

Please sign in to comment.