Skip to content

Instantly share code, notes, and snippets.

@bruienne
Created October 1, 2015 13:02
Show Gist options
  • Save bruienne/f81ea88253629abaf5f9 to your computer and use it in GitHub Desktop.
Save bruienne/f81ea88253629abaf5f9 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import objc
import plistlib
class attrdict(dict):
__getattr__ = dict.__getitem__
__setattr__ = dict.__setitem__
ServerInformation = attrdict()
ServerInformation_bundle = objc.loadBundle('ServerInformation', ServerInformation, \
bundle_path='/System/Library/PrivateFrameworks/ServerInformation.framework')
platformsupport = plistlib.readPlist('/System/Library/CoreServices/PlatformSupport.plist')
#
disabledsystems = platformsupport.get('SupportedBoardIds')
#
print('------------------------------------------------------------\n%i Board IDs in list\n------------------------------------------------------------\n' % len(disabledsystems))
unmatchedboardids = []
for system in disabledsystems:
for modelid in ServerInformation.ServerInformationComputerModelInfo.modelPropertiesForBoardIDs_([system]):
if system not in modelid:
print('Board ID: %s = System ID: %s' % (system, modelid))
else:
unmatchedboardids.append(system)
if len(unmatchedboardids) > 0:
print('------------------------------------------------------------')
for boardid in unmatchedboardids:
print('-- No match for Board ID %s --' % boardid)
print('------------------------------------------------------------\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment