Esempio n. 1
0
    def exportPanels(self, settings, deletePoses=False):
        log('##### exportPanels')

        if not self.testInfo.getShotEdit():
            log("Cannot use an export plugin when no edit is saved for this sequence; exiting...", "error")
            return

        if self.testInfo.OS == "mac":
            log("exportPanels is only supported on Windows at the moment. Exiting...", "error")
            return

        if deletePoses:
            pyUtils.deleteLocalPoses(self.testInfo)

        if settings['format'] == 'jpeg':
            plugin = 'exportJpegs.png'
            outputPath = self.jpgOutputDir
        elif settings['format'] == 'psd':
            plugin = 'exportPsds.png'
            outputPath = self.psdOutputDir
        else:
            self.testInfo.failed('%s is not a valid format. Must be \'psd\' or \'jpeg\'.' % settings['format'])
            return

        if os.path.isdir(outputPath):
            shutil.rmtree(outputPath)
    
        os.makedirs(outputPath)
    
        if self.testInfo.flixVersion < '5.2':
            pluginLocation = sikuliUtils.switchPlugin('export', plugin)
    
        click(settings['panels'][0])
        if len(settings['panels']) != 1:
            for panel in settings['panels'][1:]:
                sikuliUtils.ctrlClick(panel)
    
        if self.testInfo.flixVersion < '5.2':
            click(pluginLocation)
        else:
            sikuliUtils.switchPlugin('export', plugin)
    
        if not exists('exportFileBrowser.png', 10):
            self.testInfo.failed('Could not find the File Browser.')
        click('exportFileBrowserFolder.png')
    
        type(outputPath.replace('/', '\\')); wait(1)
        type(sikuli.Key.ENTER); wait(1)
        type(sikuli.Key.BACKSPACE)
        type(sikuli.Key.ENTER)
    
        self.exportCheck.exportPanelsCheck(settings)
    
        sikuliUtils.closeExplorerWindow('%ss' % settings['format'])
Esempio n. 2
0
    def openInPhotoshop(self, panels, psMethod):
        """Opens one or multiple panels in Photoshop using Layer Comps ('layerComp') or Timeline ('timeline')

        panels -- List of panels to open in Photoshop
        psMethod -- Either open the panels in 'layerComp' or 'timeline' view in PS
        """
        log('##### openInPhotoshop')

        click(panels[0])
        if len(panels) != 1:
            for panel in panels[1:]:
                # click(panel, sikuli.KeyModifier.CTRL)
                sikuliUtils.ctrlClick(panel)

            if psMethod == 'layerComp':
                plugin = 'photoshopLayerComp.png'
            elif psMethod == 'timeline':
                plugin = 'photoshopTimeline.png'
            else:
                log('openInPhotoshop: %s psMethod is not supported in this test.' % psMethod)
                return
            if self.testInfo.flixVersion < '5.2':
                click(sikuliUtils.switchPlugin('editing', plugin))
            else:
                sikuliUtils.switchPlugin('editing', plugin)

        wait(1)
        # type(sikuli.Key.ENTER, sikuli.KeyModifier.CTRL)
        sikuliUtils.ctrlType('', sikuli.KeyModifier.ENTER)

        # Need to find a way to make sure the panel is open in Photoshop
        psState = sikuliUtils.oneOrTheOther('psOpen.png', 'psOpening.png', 30)
        if psState == 0:
            wait(5)
        elif psState == 1:
            wait(30)
        elif psState == 2:
            self.testInfo.failed('openInPhotoshop: Photoshop is not open and not opening.')

        sikuliUtils.psEdit()

        sikuli.App.focus('Google Chrome')

        for panel in panels:
            toPs.openInPhotoshopCheck(self.testInfo, panel)