def PlistValueToPlainValue(plist):
 if isinstance(plist, dict):
  ret_value = dict()
  for (key, value) in plist.items():
   ret_value[key] = PlistValueToPlainValue(value)
  return ret_value
 elif isinstance(plist, list):
  return [PlistValueToPlainValue(value) for value in plist]
 elif isinstance(plist, binplist.RawValue):
  return plist.value
 elif (isinstance(plist, binplist.CorruptReference) or isinstance(plist, binplist.UnknownObject)):
  return None
 elif isinstance(plist, datetime.datetime):
  return ((calendar.timegm(plist.utctimetuple()) * 1000000) + plist.microsecond)
 return plist

def PlistValueToPlainValue ( plist ) : if isinstance ( plist , dict ) : ret_value = dict ( ) for ( key , value ) in plist . items ( ) : ret_value [ key ] = PlistValueToPlainValue ( value ) return ret_value elif isinstance ( plist , list ) : return [ PlistValueToPlainValue ( value ) for value in plist ] elif isinstance ( plist , binplist . RawValue ) : return plist . value elif ( isinstance ( plist , binplist . CorruptReference ) or isinstance ( plist , binplist . UnknownObject ) ) : return None elif isinstance ( plist , datetime . datetime ) : return ( ( calendar . timegm ( plist . utctimetuple ( ) ) * 1000000 ) + plist . microsecond ) return plist
takes the plist contents generated by binplist and returns a plain dict .