This command writes all shelves that are immediate children of the specified control layout to the prefs directory.
Derived from mel command maya.cmds.saveAllShelves
Example:
import pymel.core as pm
import maya.cmds as cmds
import maya.mel
gShelfTopLevel = maya.mel.eval('$tmpVar=$gShelfTopLevel')
pm.saveAllShelves( gShelfTopLevel )
# Result: u'1' #