示例#1
0
    def importPanels2(self, ext, nPanels=10):
        """Imports nPanels panels without checking image in Flix

        :param ext: extension of the files to import
        :param nPanels: Number of panels to import, 10 by default
        :return: None
        """
        log('##### importPanels2')

        if self.testInfo.OS == "mac":
            log("importPanels only supported on Windows right now. Using importDrawings instead...", "error")
            self.importDrawings(ext, nPanels)
            return

        availablePanels = self.__getAvailablePanels(ext)

        panelList = []
        while len(panelList) < nPanels:
            rest = nPanels - len(panelList)
            if rest > len(availablePanels):
                for panel in availablePanels:
                    panelList.append(panel)
            else:
                for panel in availablePanels[0:rest]:
                    panelList.append(panel)

        # Got to do it in chunks of 10 panels
        for i in range(0, len(panelList), 10):
            chunk = panelList[i:i+10]
            click('importDrawingsButton.png')

            if not exists('importFileBrowserFilename.png', 20):
                log('importPanels2: Could not find importFileBrowserFilename after 20 seconds.', 'error')
                return
            click('importFileBrowserFilename.png'); wait(1)

            if i == 0:
                type(self.importPath.replace('/', '\\')); wait(1)
                type(sikuli.Key.ENTER); wait(1)

            for panel in chunk:
                type("\"" + panel + "\" ")

            type(sikuli.Key.ENTER)
            # wait(len(chunk))

            # Wait until the 'processing' image for the first panel
            timeout = int((len(chunk) * 1.5))
            if ext == 'mov':
                timeout = 0
                for movie in chunk:
                    timeout += pyUtils.readMovSettings(self.testInfo, movie)['timeout']
            log('importPanels2: timeout set to %ssec.' % timeout, 'debug')
            wait(timeout)

        self.importDrawingCheck.importPanels2Check(ext, nPanels, panelList)
示例#2
0
 def __checkDuration(self, ext, nPanels, panelList):
     # Check the new duration of the edit
     addedDuration = 0
     if ext == 'mov':
         for panel in panelList:
             addedDuration += pyUtils.readMovSettings(self.importDrawing.testInfo, panel)['duration']
     else:
         addedDuration += (nPanels*12)
     log('importPanelsCheck: The edit should be longer by %s frames.' % addedDuration, 'debug')
     expectedDur = self.importDrawing.testInfo.editDuration + addedDuration
     foundDur = self.importDrawing.testInfo.getDurationFromShotEdit()
     if foundDur != expectedDur:
         self.importDrawing.testInfo.failed('importPanelsCheck: Expected duration to be %s, '
                                            'is %s instead.' % (expectedDur, foundDur))
     else:
         log('- Edit duration increased by %s frames as expected.' % addedDuration)
     self.importDrawing.testInfo.editDuration = foundDur