def get_int_property(device_type, property, cf_number_type):
 key = cf.CFStringCreateWithCString(kCFAllocatorDefault, property.encode('mac_roman'), kCFStringEncodingMacRoman)
 CFContainer = iokit.IORegistryEntryCreateCFProperty(device_type, key, kCFAllocatorDefault, 0)
 if CFContainer:
  if (cf_number_type == kCFNumberSInt32Type):
   number = ctypes.c_uint32()
  elif (cf_number_type == kCFNumberSInt16Type):
   number = ctypes.c_uint16()
  cf.CFNumberGetValue(CFContainer, cf_number_type, ctypes.byref(number))
  cf.CFRelease(CFContainer)
  return number.value
 return None

def get_int_property ( device_type , property , cf_number_type ) : key = cf . CFStringCreateWithCString ( kCFAllocatorDefault , property . encode ( 'mac_roman' ) , kCFStringEncodingMacRoman ) CFContainer = iokit . IORegistryEntryCreateCFProperty ( device_type , key , kCFAllocatorDefault , 0 ) if CFContainer : if ( cf_number_type == kCFNumberSInt32Type ) : number = ctypes . c_uint32 ( ) elif ( cf_number_type == kCFNumberSInt16Type ) : number = ctypes . c_uint16 ( ) cf . CFNumberGetValue ( CFContainer , cf_number_type , ctypes . byref ( number ) ) cf . CFRelease ( CFContainer ) return number . value return None
search the given device for the specified string property .