Accessing settings for a posebone constraint

I’m still pretty new to python and the blender API. I’m trying to write a script to export an armature to XML. I can’t figure out how to access the constraint settings. Here’s what I’ve got so far in the constraints function:

 
def dump_constraints(armName):
 print '<constraints>'
 obj = Object.Get(armName)
 pose =obj.getPose()
 for bone in pose.bones.values():
  if len(bone.constraints) != 0:
   print '	<bone, name = ',bone.name,'>'
   for const in bone.constraints:
    print '		<const ',const,const.type,'/>'
#    print const.Settings
   print '	</bone>'
 print '</constraints>'
 

The API documentation says that the Settings are a constant dictionary, and the content changes depending on the constant.type, but I simply can’t figrure out how to get to them. I’ve looked through the forums, the API documentation, and all of the tutorials I can find, but nothing seemes to work.

Any help would be appreciated.

never mind, I figured it out (all it took was exposing my ignorance to a worldwide audience of my peers - no surprise there)

here’s what the code should look like:


def dump_constraints(armName):
 print '<constraints>'
 obj = Object.Get(armName)
 pose =obj.getPose()
 for bone in pose.bones.values():
  if len(bone.constraints) != 0:
   print '	<bone, name = ',bone.name,'>'
   for const in bone.constraints:
    print '		<const name = ',const.name, '/>'
    # did you know that there's no SWITCH construct in Python?
    if const.type == 12: #action constraint
     print '			<type = ACTION>'
     print '			<action = "', const[Blender.Constraint.Settings['ACTION']].name,'"/>'
     print '			<start = "', const[Blender.Constraint.Settings['START']].real,'"/>'
     print '			<end = "', const[Blender.Constraint.Settings['END']].real,'"/>'
     print '			<min = "', const[Blender.Constraint.Settings['MIN']].real,'"/>'
     print '			<max= "', const[Blender.Constraint.Settings['MAX']].real,'"/>'
     print '			<keyon = "', const[Blender.Constraint.Settings['KEYON']].real,'"/>'
    elif const.type == 8: #copy rotation
     print '			<type = COPYROTATION>'
     #stub
    elif const.type == 9: #copy location
     print '			<type = COPYLOCATION>'
     #stub
    elif const.type == 3: #IK
     print '			<type = IK>'
     #stub
    elif const.type == 15: #Stretch to
     print '			<type = STRETCHTO>'
     #stub
 
    print '		</const>'
   print '	</bone>'
 print '</constraints>'