@publisher(['animation', 'shot previs'])
def set_frame_range():
    """sets the frame range from the shot node
    """
    shot_node = pm.ls(type='shot')[0]
    start_frame = shot_node.startFrame.get()
    end_frame = shot_node.endFrame.get()

    handle_count = 1
    try:
        handle_count = shot_node.getAttr('handle')
    except __HOLE__:
        pass

    # set it in the playback
    pm.playbackOptions(
        ast=start_frame,
        aet=end_frame,
        min=start_frame-handle_count,
        max=end_frame+handle_count
    )
dataset/ETHPy150Open eoyilmaz/anima/anima/env/mayaEnv/publish.py/set_frame_range