Beispiel #1
0
 def __init__(self, testInfo):
     self.testInfo = testInfo
     self.editorialDir = self.testInfo.getEditorialDir()
     self.fleMovDir = "%s/fleMov" % self.editorialDir
     self.pdfDir = "%s/pdf" % self.editorialDir
     self.jpgOutputDir = "%s/jpegs" % self.testInfo.outDir
     self.psdOutputDir = "%s/psds" % self.testInfo.outDir
     self.exportCheck = ExportCheck(self)
Beispiel #2
0
class Export:
    def __init__(self, testInfo):
        self.testInfo = testInfo
        self.editorialDir = self.testInfo.getEditorialDir()
        self.fleMovDir = "%s/fleMov" % self.editorialDir
        self.pdfDir = "%s/pdf" % self.editorialDir
        self.jpgOutputDir = "%s/jpegs" % self.testInfo.outDir
        self.psdOutputDir = "%s/psds" % self.testInfo.outDir
        self.exportCheck = ExportCheck(self)

    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'])
    
    def exportQuickTime(self, timeout=100):
        log('##### exportQuickTime')

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

        if os.path.isdir(self.fleMovDir):
            shutil.rmtree(self.fleMovDir)
    
        if self.testInfo.flixVersion < '5.2':
            click(sikuliUtils.switchPlugin('export', 'exportQuicktime.png'))
        else:
            sikuliUtils.switchPlugin('export', 'exportQuicktime.png')
    
        self.exportCheck.exportQuickTimeCheck(timeout)
    
        sikuliUtils.closeExplorerWindow('fleMov')

    def exportPDF(self, panelsPerPage=9):
        log("##### exportPDF")

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

        sikuliUtils.switchPlugin("pdf", "exportPdf%s.png" % panelsPerPage)

        self.exportCheck.exportPdfCheck(panelsPerPage)

        # sikuliUtils.closeExplorerWindow("pdf")
        sikuli.App.close("pdf")