It is very straight forward, but rather than giving you the code, I suggest you go and read a bit on the topic, try this one: http://www.jonobacon.org/2006/08/28/getting-started-with-gstreamer-with-python/
The srcpadname for h264parse is 'src', not 'src0' and that is why it returns NoneType. 'src0' is usually only used when you have an element with request-pads (like the Tee) but this is not the case for h264parse.
Feel free to post a more complete code-attempt if you still can not make it work.