def get_string_property(device_type, property):
 key = cf.CFStringCreateWithCString(kCFAllocatorDefault, property.encode('mac_roman'), kCFStringEncodingMacRoman)
 CFContainer = iokit.IORegistryEntryCreateCFProperty(device_type, key, kCFAllocatorDefault, 0)
 output = None
 if CFContainer:
  output = cf.CFStringGetCStringPtr(CFContainer, 0)
  if (output is not None):
   output = output.decode('mac_roman')
  cf.CFRelease(CFContainer)
 return output

def get_string_property ( device_type , property ) : key = cf . CFStringCreateWithCString ( kCFAllocatorDefault , property . encode ( 'mac_roman' ) , kCFStringEncodingMacRoman ) CFContainer = iokit . IORegistryEntryCreateCFProperty ( device_type , key , kCFAllocatorDefault , 0 ) output = None if CFContainer : output = cf . CFStringGetCStringPtr ( CFContainer , 0 ) if ( output is not None ) : output = output . decode ( 'mac_roman' ) cf . CFRelease ( CFContainer ) return output
search the given device for the specified string property .