• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python sikuliUtils.log函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中utils.sikuliUtils.log函数的典型用法代码示例。如果您正苦于以下问题:Python log函数的具体用法?Python log怎么用?Python log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了log函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: openFlixGUI

    def openFlixGUI(self, timeout):
        """Opens Flix's main GUI"""
        log('##### openFlixGUI')

        sikuliUtils.newChromeTab('http://127.0.0.1:35980/html/index.html#')

        self.launchCheck.openFlixGUICheck(timeout)
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:7,代码来源:launch.py


示例2: psCurrentImage

    def psCurrentImage(self, fileNames=["1"]):
        """Test method to send stills from Photoshop to an open Flix edit

        :param fileNames: Array of filenames to be open in Photoshop
        (without extension, files available in assets/psds directory)
        :return: None
        """
        log("##### psCurrentImage")

        psScriptPath = "%s/psCurrentImage.jsx" % self.assetsDir

        filePaths = []
        for fileName in fileNames:
            filePath = "%s/%s.psd" % (self.assetsDir, fileName)
            if os.path.exists(filePath):
                filePaths.append(filePath)
            else:
                log("psCurrentImage: Could not find %s in PSD assets folder; skipping..." % fileName)
        if not len(filePaths):
            self.testInfo.failed("psCurrentImage: No file to open in PS; exiting...")
            return

        if not self.__writePsScript(psScriptPath, filePaths, "Current Image"):
            self.testInfo.failed("psCurrentImage: Failed to write the PS script; exiting...")
            return

        self.__executePsScript(psScriptPath)

        # fromPs.psCurrentImageCheck(self.testInfo, len(filePaths))
        self.fromPsCheck.psCurrentImageCheck(len(filePaths))
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:30,代码来源:fromPS.py


示例3: replaceStill

    def replaceStill(self, mayaFile="pyramid.mb", frame=1):
        """Test method to replace the currently selected Flix panel with a still from Maya. Must make sure the current Flix
        edit contains at least one panel!
        Usage: fromMaya.replaceStill(self.testInfo, "pyramid.mb", 15)
    
        :param mayaFile: Name of the Maya scene file
        :param frame: Integer corresponding to the frame from the Maya scene to send to Flix
        :return: None
        """
        log("##### replaceStill")

        mayaSettings = checkUtils.readMayaSettings(self.testInfo, mayaFile)
        if not mayaSettings["inFrame"] <= frame <= mayaSettings["outFrame"]:
            log(
                "addStills: Frame %s not in Maya scene (In: %s Out: %s); stopping test..."
                % (frame, mayaSettings["inFrame"], mayaSettings["outFrame"]),
                "error",
            )
            return

        melScriptPath = "%s/replaceStill.mel" % self.assetsPath
        # Write Mel actions to execute in Maya
        scriptBody = "currentTime %s;\n" 'evalDeferred("replaceStill");\n\n' % frame
        self.__writeMelScript(melScriptPath, mayaFile, scriptBody)
        self.__executeMelScript(melScriptPath)

        # fromMaya.replaceStillCheck(self.testInfo)
        self.fromMayaCheck.replaceStillCheck()
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:28,代码来源:fromMaya.py


示例4: addDialogue

    def addDialogue(self, dialogue="Adding dialogue to panel [panelIndex].", firstPanel=1, lastPanel=3):
        """Adds dialogue to all of the panels currently in the sequence

        :param dialogue: String to add to every panel as the dialogue
        :param firstPanel: Panel index of first panel to add dialogue to
        :param lastPanel: Panel index of last panel to add dialogue to
        :return: None
        """
        log('##### addDialogue')

        panels = []
        for i in range(firstPanel, lastPanel+1):
            panels.append(i)
        log("addDialogue: Panel indices to add dialogue to: %s" % panels, "debug")
        url = "127.0.0.1:35980/html/index.html#show=%s;seq=%s;branch=%s;edit=%s;panel=%s" % \
              (self.testInfo.show,
               self.testInfo.sequence,
               self.testInfo.currentBranch,
               self.testInfo.getEditVersion(),
               panels[0])

        sikuliUtils.newChromeTab(url, closeCurrent=True); wait(5)

        click("dialogueField.png"); wait(1)
        for panel in panels:
            # Paste the dialogue (paste better than type as it keeps special characters)
            dial = dialogue.replace("[panelIndex]", str(panel))
            sikuli.paste(unicode(dial, "utf8")); wait(1)
            sikuli.type(sikuli.Key.ENTER, sikuli.KeyModifier.SHIFT); wait(1)

        self.editToolsCheck.addDialogueCheck(panels, dialogue)
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:31,代码来源:editTools.py


示例5: replaceSequencerShot

    def replaceSequencerShot(self, mayaFile="pyramidSequencer.mb", shotNumber=1):
        """Test method to replace the currently selected Flix panel with a shot from a Maya sequencer.
        Usage: fromMaya.replaceSequencerShot(self.testInfo, "pyramidSequencer.mb", 1)
    
        :param mayaFile: Name of the Maya scene file
        :param shotNumber: Position of the shot in the sequencer
        :return: None
        """
        log("##### replaceSequencerShot")

        mayaSettings = checkUtils.readMayaSettings(self.testInfo, mayaFile)
        if shotNumber > mayaSettings["nShots"]:
            shot = mayaSettings["shotNames"][0]
        else:
            shot = mayaSettings["shotNames"][shotNumber - 1]
        duration = mayaSettings["outFrame"] - mayaSettings["inFrame"] + 1

        melScriptPath = "%s/replaceSequencerShot.mel" % self.assetsPath
        # Write Mel actions to execute in Maya
        scriptBody = "select -add %s ;\n" 'evalDeferred("replaceSequencerShot");\n\n' % shot
        self.__writeMelScript(melScriptPath, mayaFile, scriptBody)
        self.__executeMelScript(melScriptPath)

        # fromMaya.replaceSequencerShotCheck(self.testInfo, duration)
        self.fromMayaCheck.replaceSequencerShotCheck(duration)
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:25,代码来源:fromMaya.py


示例6: addSequencerShots

    def addSequencerShots(self, mayaFile="pyramidSequencer.mb", nShots=1):
        """Test method to send a number of sequencer shots from Maya to the current Flix edit
        Usage: fromMaya.addSequencerShot(self.testInfo, "pyramidSequencer.mb", 3)
    
        :param mayaFile: Name of the Maya scene file
        :param nShots: Number of shots to be sent from Maya to Flix
        :return: None
        """
        log("##### addSequencerShots")

        mayaSettings = checkUtils.readMayaSettings(self.testInfo, mayaFile)
        if nShots > mayaSettings["nShots"]:
            shots = mayaSettings["shotNames"][0 : mayaSettings["nShots"]]
        else:
            shots = mayaSettings["shotNames"][0:nShots]
        log("addSequencerShots: shots to be sent to Flix: %s" % shots, "debug")

        melScriptPath = "%s/addSequencerShot.mel" % self.assetsPath
        # Write Mel actions to execute in Maya
        scriptBody = ""
        duration = 0
        for shot in shots:
            scriptBody += "select -add %s ;\n" % shot
            duration += mayaSettings["shotDurations"][shots.index(shot)]
        scriptBody += 'evalDeferred("addSequencerShot");\n\n'
        self.__writeMelScript(melScriptPath, mayaFile, scriptBody)
        self.__executeMelScript(melScriptPath)

        # fromMaya.addSequencerShotsCheck(self.testInfo, len(shots), duration)
        self.fromMayaCheck.addSequencerShotsCheck(len(shots), duration)
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:30,代码来源:fromMaya.py


示例7: addStills

    def addStills(self, mayaFile="pyramid.mb", frames=[1, 12, 24]):
        """Test method to send stills from Maya to an open Flix edit
        Usage: fromMaya.addStills(self.testInfo, "pyramid.mb", [1, 12, 24])
    
        :param mayaFile: Name of the Maya scene file
        :param frames: Array of frames for which to send panels from Maya
        :return: None
        """
        log("##### addStills")

        mayaSettings = checkUtils.readMayaSettings(self.testInfo, mayaFile)
        existingFrames = []
        for frame in frames:
            if mayaSettings["inFrame"] <= frame <= mayaSettings["outFrame"]:
                existingFrames.append(frame)
            else:
                log(
                    "addStills: Frame %s not in Maya scene (In: %s Out: %s); skipping..."
                    % (frame, mayaSettings["inFrame"], mayaSettings["outFrame"]),
                    "error",
                )

        melScriptPath = "%s/addStills.mel" % self.assetsPath
        # Write Mel actions to execute in Maya
        scriptBody = ""
        for frame in existingFrames:
            # For each frame, set the keyframe, perform mayaAddStill, wait for 3sec
            scriptBody += "currentTime %s;\n" 'evalDeferred("addStill");\n\n' % frame
        self.__writeMelScript(melScriptPath, mayaFile, scriptBody)
        self.__executeMelScript(melScriptPath)

        # fromMaya.addStillsCheck(self.testInfo, existingFrames)
        self.fromMayaCheck.addStillsCheck(existingFrames)
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:33,代码来源:fromMaya.py


示例8: getMarkersFromShotEdit

    def getMarkersFromShotEdit(self):
        """Returns a list of all the markers in the current shotEdit

        :return: list of markers' shotLabels
        """
        markerRecipes = []
        markers = []
        xml = self.getShotEdit()
        if xml == 0:
            log('TestInfo: cannot find panels in shot edit (xml not found).', 'error')
            return markers
        tree = ET.parse(xml)
        root = tree.getroot()

        for shot in root.findall('Shot'):
            recipe = shot.get('recipeLabelName').split('[')[0]
            # if '_marker_' in recipe:
            #     markerRecipes.append(recipe)
            if self.getPanelBeat(recipe) == 'marker':
                markerRecipes.append(recipe)

        # Read shotLabel from multitrack
        for markerRecipe in markerRecipes:
            multitrack = self.getPanelMultitrack(markerRecipe)
            shotLabel = pyUtils.parseMultitrack(multitrack, 'Pose', 'dialogue')
            markers.append(shotLabel)

        log('TestInfo: getMarkersFromShotEdit: %s' % markers, 'debug')
        return markers
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:29,代码来源:testInfo.py


示例9: __writePsScript

    def __writePsScript(scriptPath, filePaths, action):
        """Writes a Jsx script to open a PS file, execute actions and quit PS.

        :param scriptPath: Path to the PS script to be written (.jsx)
        :param filePaths: Array of filepaths to be opened in PS
        :param action: Name of the Photoshop action to be executed
        :return: 0 if failed, 1 if succeeded
        """
        # supportedActions = ["Current Image", "Replace Current Image", "Each Frame", "Each Layer"]
        # if action not in supportedActions:
        #     log("writePsScript: %s is not an existing or supported Flix Action; exiting...\n"
        #         "Supported Actions: %s" % (action, supportedActions))
        #     return 0

        scriptContents = (
            "var files = %s\n"
            "for (i = 0; i < files.length; i++){\n"
            "var file = File(files[i])\n"
            "app.open(file)\n"
            'app.doAction("%s", "Flix Actions")\n'
            "app.activeDocument.close(SaveOptions.DONOTSAVECHANGES)\n"
            "}\n"
            "photoshop.quit()\n" % (filePaths, action)
        )

        try:
            with open(scriptPath, "wb") as f:
                log("writePsScript: creating following script: %s" % scriptPath, "debug")
                f.write(scriptContents.replace("\\", "/"))
                return 1
        except Exception, e:
            log("writePsScript: Could not write PS script.\n%s" % e)
            return 0
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:33,代码来源:fromPS.py


示例10: psEachLayer

    def psEachLayer(self, fileName="5layers", BG=0, FG=0):
        log("##### psEachLayer")

        psScriptPath = "%s/psEachLayer.jsx" % self.assetsDir

        filePath = "%s/%s.psd" % (self.assetsDir, fileName)
        if not os.path.exists(filePath):
            self.testInfo.failed("psEachLayer: Could not find %s in PSD assets folder; exiting..." % fileName)
            return

        # TODO: Write a method that reads settings for each PSD to figure out how many frames it's got
        nLayers = 5

        if BG and FG:
            scriptName = "Each Layer + FG/BG"
            nLayers -= 1
        elif BG and not FG:
            scriptName = "Each Layer + BG"
        else:
            if FG and not BG:
                log("psEachLayer: Can't send FG but not BG, using Flix Each Layer script instead.")
            scriptName = "Each Layer"
            nLayers += 1

        if not self.__writePsScript(psScriptPath, [filePath], scriptName):
            self.testInfo.failed("psEachLayer: Failed to write the PS script; exiting...")
            return

        self.__executePsScript(psScriptPath)

        self.fromPsCheck.psEachLayerCheck(nLayers)
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:31,代码来源:fromPS.py


示例11: updateMarkers

    def updateMarkers(self, markers):
        """Updates the markers in the current edit"""

        for marker in markers:
            self.editMarkers.append(marker)
            self.allMarkers.append(marker)

        log('TestInfo: updateMarkers: %s' % self.editMarkers, 'debug')
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:8,代码来源:testInfo.py


示例12: __getAvailablePanels

    def __getAvailablePanels(self, ext):
        self.importPath = '%s/assets/%ss/' % (self.testInfo.testPath, ext)

        if not os.path.exists(self.importPath):
            log('importDrawings: Could not find an asset directory for %s; '
                'try with another file extension.' % ext, 'error')
            return 0
        else:
            return pyUtils.findFileNames(self.importPath, "*.%s" % ext)
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:9,代码来源:importDrawing.py


示例13: updateAllPanels

 def updateAllPanels(self, panels):
     """Updates the panels in the sequence"""
     for beats in panels:
         for panel in panels[beats]:
             beat = self.getPanelBeat(panel)
             if beat != 'unknown':
                 if panel not in self.allPanels[beat]:
                     self.allPanels[beat].append(panel)
             else:
                 log('TestInfo: updateAllPanels: %s\'s beat determined as unknown.' % panel, 'debug')
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:10,代码来源:testInfo.py


示例14: launchFlix

    def launchFlix(self, timeout):
        """Launches Flix's main UI via its bat or sh file

        path -- Path to the Flix launcher
        timeout -- Time in seconds before the Project Browser will open
        """
        log('##### launchFlix')

        # Flix is being launched from the Test Suite before Sikuli
        if self.launchCheck.launchFlixCheck(timeout) == 'login':
            self.logIn(timeout)
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:11,代码来源:launch.py


示例15: __publishFromFlix

    def __publishFromFlix(self, methodName, comment, checkMethod, windowName="fcp", importAAFs=False, createSgSeq=False):
        """Method that will select the specified editorial plugin, publish with a comment and call the relevant check
        method

        :param methodName: Name of the method calling me
        :param comment: Comment to add to the publish
        :param checkMethod: Method to call to check the publish results
        :param windowName: Name of the Explorer window Flix reveals after publishing
        :param importAAFs: Set to True to import AAFs after Avid publish (not relevant for other editorial publishes)
        :param createSgSeq: Set to True to create the Flix sequence in Shotgun (only relevant for Shotgun publish)
        :return: None
        """
        log("##### toEditorial: %s" % methodName)

        if methodName == "toShotgun" and createSgSeq:
            sikuliUtils.createShotgunSequence(self.testInfo)

        if self.testInfo.flixVersion < '5.2':
            click(sikuliUtils.switchPlugin('editorial', '%s.png' % methodName)); wait(1)
        else:
            sikuliUtils.switchPlugin('editorial', '%s.png' % methodName); wait(1)

        click('publishComment.png'); wait(1)

        type(comment); wait(1)
        type(sikuli.Key.TAB); wait(.5)
        type(sikuli.Key.ENTER)

        # Assuming .5 sec/frame is enough to publish an edit to editorial
        # timeout = self.testInfo.getDurationFromShotEdit()/2
        # Assuming 2 sec/panel for stills and 1.5 sec/frame for animated panels is enough to publish an edit
        stillPanels = len(self.testInfo.editPanels["p"]) + len(self.testInfo.editPanels["s"])
        animPanels = self.testInfo.editPanels["a"]
        animFrames = 0
        for panel in animPanels:
            animFrames += self.testInfo.getPanelDurationFromShotEdit(panel)
        if methodName == "toAvid":
            stillTimeout = 2
            animFrameTimeout = 1.5
        else:
            stillTimeout = 0.5
            animFrameTimeout = 0.5
        timeout = int((stillTimeout*stillPanels) + (animFrameTimeout*animFrames))
        if timeout < 20:
            timeout = 20

        checkMethod(timeout)

        if methodName in ["toSbp", "toPremiere"]:
            sikuliUtils.closeExplorerWindow("%s" % windowName)
        elif importAAFs:
            self.launch.openEditorialGUI(10)
            self.editorialProjectBrowser.selectEditorialProject()
            self.__importToAvid()
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:54,代码来源:toEditorial.py


示例16: __importToAvid

    def __importToAvid(self):
        """Imports the AAFs, ALE and marker.txt files that were created when publishing to Avid

        :return: None
        """
        log('##### importToAvid')

        if os.path.isdir(self.toAvidOutputDir):
            try:
                shutil.rmtree(self.toAvidOutputDir)
            except OSError, e:
                log('importToAvid: Could not delete %s.\n%s' % (self.toAvidOutputDir, e), 'debug')
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:12,代码来源:toEditorial.py


示例17: openEditorialGUI

    def openEditorialGUI(self, timeout, closeFlix=False):
        """Opens Flix's Editorial GUI"""
        log('##### openEditorialGUI')

        pyUtils.resetEditorialGuiState()

        if closeFlix:
            sikuliUtils.closeChromeTab()  # Close the main Flix tab

        sikuliUtils.newChromeTab('http://127.0.0.1:35980/html/editorial.html')

        self.launchCheck.openEditorialGUICheck(timeout)
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:12,代码来源:launch.py


示例18: createNewPanels

    def createNewPanels(self, n=3):
        """Creates n new panels using the New Button panel in Flix

        :param n: Number of new panels to be created
        :return: None
        """
        log('##### createNewPanels')

        for _ in range(0, n):
            click('newPanelBtn.png'); wait(2)

        self.editToolsCheck.createNewPanelsCheck(n)
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:12,代码来源:editTools.py


示例19: logIn

    def logIn(self, timeout):
        log('##### logIn')

        click('logInScreen.png'); wait(.5)

        type(sikuli.Key.TAB); wait(.5)
        type(self.testInfo.user); wait(1)
        type(sikuli.Key.TAB); wait(.5)
        type('latte'); wait(1)
        type(sikuli.Key.ENTER)

        self.launchCheck.launchFlixCheck(timeout)
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:12,代码来源:launch.py


示例20: getAvidNew

    def getAvidNew(self):
        """Returns a list of panels that haven't been published to Avid yet"""

        avidNew = []
        for beat in self.editPanels.iterkeys():
            if beat != 'ref':
                for panel in self.editPanels[beat]:
                    if panel not in self.avidPublished:
                        avidNew.append(panel)

        log('TestInfo: getAvidNew: New AAFs: %s' % avidNew, 'debug')
        return avidNew
开发者ID:briceFoundry,项目名称:flix_qa_2,代码行数:12,代码来源:testInfo.py



注:本文中的utils.sikuliUtils.log函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python ssh.SSHClient类代码示例发布时间:2022-05-26
下一篇:
Python shortcuts.success_response函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap