import maya.OpenMaya as OpenMaya

m_iterator = OpenMaya.MItDependencyNodes( OpenMaya.MFn.kFileTexture )
m_nodeFn   = OpenMaya.MFnDependencyNode()

while not m_iterator.isDone():
    m_object = m_iterator.thisNode()
    m_nodeFn.setObject( m_object )
    print( "  --- {0} --- ".format( m_nodeFn.name()) )
    for i in range( m_nodeFn.attributeCount() ):
        m_atrr   = m_nodeFn.attribute(i)
        m_fnAttr = OpenMaya.MFnAttribute( m_atrr )
        print( m_fnAttr.name() )
    m_iterator.next()