script help armature bone rotation

I am trying to rotate the bone from script it. Using the head as the center position and the tail is the direction of the rotation. I need help on it that it part of the bone import stuff. The rotation doesn’t match the import. I am trying to create this simple rotation.

http://img233.imageshack.us/img233/7329/armaturerotationul2.th.jpg

Trying to convert (x,y,z,w) to (x,y,z) ,roll