예제 #1
0
def switchPlugin(pluginGroup, image):
    """Switches the plugin from its default to the specified one and returns plugin location on screen.

    pluginGroup -- The group to which the plugin belongs to ('editing', 'editorial', 'pdf' or 'export')
    image -- PNG image corresponding to the plugin
    """
    pluginGroupImage = pluginGroup + '_default.png'
    # If the plugin isn't default any more, reload Flix to have all plugins reset to default.
    if not exists(pluginGroupImage, 3):
        if reloadFlix(pluginGroupImage) == 0:
            log('Could not find %s for the %s plugin group.' % (pluginGroupImage, pluginGroup), 'error')
            return 0

    # hover(pluginGroupImage)
    # pluginLocation = sikuli.Env.getMouseLocation()
    # mouseDown(sikuli.Button.LEFT)
    # hover(image)
    # mouseUp(sikuli.Button.LEFT)

    hover(pluginGroupImage); wait(1) # wait for the tooltip to appear and go away
    pluginLocation = sikuli.Env.getMouseLocation()
    mouseDown(sikuli.Button.LEFT)
    # hover('projectBrowserBtn.PNG') # makes sure the tooltip isn't in the way
    click(image)

    return pluginLocation
예제 #2
0
def waitForResync():

    timeout = 120
    startTime = time.time()

    while time.time() <= startTime + timeout:
        hover(sikuli.Pattern('flixSettings.png').targetOffset(25, 0))
        if exists('doneSyncing.png', 5):
            return 1

    log('waitForResync: There are still files syncing after %s seconds.' % timeout)
    return 0