本文整理汇总了Python中utils.pyUtils.log函数的典型用法代码示例。如果您正苦于以下问题:Python log函数的具体用法?Python log怎么用?Python log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了log函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: toAvidCheck
def toAvidCheck(self, timeout):
"""Method to check the Avid publish was successful
:param timeout: Time in sec before assuming the publish failed if there was no popup
:return: None
"""
log('## toAvidCheck')
if not self.__waitPopup(timeout, "toAvidCheck"):
return
# Check all the PNGs have been created
editPanels = self.toEditorial.testInfo.getPanelsFromShotEdit(perBeat=False)
checkUtils.checkPanelDir(self.toEditorial.testInfo, editPanels, ['hdPng'], 'toAvidCheck')
ale = self.__checkAleExists()
if ale:
self.__checkAleContents(ale, editPanels)
self.__checkAafs()
self.__checkMarkersTxt()
# TODO: Check the html email for details of what failed
log('All checks performed for toAvid.')
示例2: sbpToFlixCheck
def sbpToFlixCheck(self, sbpShow):
log('## sbpToFlixCheck')
# SBP creates an extra version for some reason
self.fromSbp.testInfo.incrementEditVersion()
if not self.__checkStartProcessing():
return
# Read the CSV settings file for the given show to know what to expect
self.settings = checkUtils.readSbpSettings(self.fromSbp.testInfo, sbpShow)
if not self.__waitPopup():
return
self.__waitProcessed()
# Save the edit after the SBP import was successful
sikuliUtils.saveVersion(self.fromSbp.testInfo, 'Imported %s from SBP.' % sbpShow)
self.__waitEmptyDir()
self.__countNewPanels()
editPanels = self.fromSbp.testInfo.getPanelsFromShotEdit()
self.__checkNewPanels(editPanels)
self.__checkMarkers()
# TODO: Check audio file was created and audio tracks were copied over
self.__updateTestInfo(editPanels)
log('All checks performed for sbpToFlix.')
示例3: toSBPCheck
def toSBPCheck(self, timeout):
"""Checks the publish to SBP was successful
:param timeout: Time in sec before assuming the publish failed if there was no popup
:return: None
"""
log('## toSBPCheck:')
if not self.__waitPopup(timeout, "toSBPCheck"):
return
# Check the XML was created
xml = self.__checkSbpXml()
if not xml:
return
# Check all the panels are in the XML
self.__checkPanelsInSbpXml(xml)
# Check the existing SBP panels have their Unique IDs in the XML
self.__checkSbpIds(xml)
# Check the audio is in the XML
self.__checkAudioSbpXml(xml)
log('All checks performed for toSBP.')
示例4: __waitProcessed
def __waitProcessed(self):
# Wait until all the panels have finished processing
if sikuli.waitVanish('processing.png', 30):
log("- All panels have finished processing.")
else:
self.fromSbp.testInfo.failed('sbpToFlixCheck: Some panels are still '
'processing 30sec after plugin finished.')
示例5: readSbpSettings
def readSbpSettings(testInfo, sbpShow):
"""Reads the sbpShow_settings.csv file containing all the info for what to expect from the SBP import
:param testInfo: TestInfo object
:param sbpShow: Name of the SBP project to be imported
:return: dict: dictionary containing information on what to expect from the SBP import
"""
# Setting defaults so that the check doesn't fail if something's missing from the csv file
settings = {"timeout": 200, "stills": 0, "animated": 0, "replace": 0, "markers": []}
sourceDir = "%s/assets/fromSBP/%s/" % (testInfo.testPath, sbpShow)
file = "%s/%s_settings.csv" % (sourceDir, sbpShow)
if not os.path.exists(file):
log("readSbpSettings: Could not find settings csv file for SBP show:\n%s" % file, "error")
return settings
with open(file, "rb") as csvfile:
csvreader = csv.reader(csvfile)
for row in csvreader:
for setting in settings:
if setting == "markers" and row[0] == setting:
for marker in row[1:]:
settings[setting].append(marker)
elif row[0] == setting:
settings[setting] = int(row[1])
log("readSbpSettings: Settings read from the SBP csv file:\n%s" % settings, "debug")
return settings
示例6: publishToFlixCheck2
def publishToFlixCheck2(self, comment, assetName, toShotgun, branch, asStills):
log("## publishToFlixCheck:")
publishSettings = checkUtils.readPublishSettings(self.fromEditorial.testInfo, assetName)
timeout = publishSettings["timeout"]
checkUtils.popupCheck(self.fromEditorial.testInfo, timeout, methodName="publishToFlixCheck")
# Check the audio was created
checkUtils.newAudioFile(self.fromEditorial.testInfo, methodName="publishToFlixCheck")
# Update self.fromEditorial.testInfo
if branch != "main":
self.fromEditorial.testInfo.currentBranch = branch
self.fromEditorial.testInfo.incrementEditVersion()
# Check the editorial branch was created, the shotEdit is there and it's got the comment
if not self.__checkShotEdit(comment):
return 0
self.__checkMarkers(publishSettings["markers"])
self.__checkDuration(publishSettings["duration"])
self.__checkNPanels(
publishSettings["stillRefs"] + publishSettings["animatedRefs"] + publishSettings["existing"]
)
self.__checkPanels(publishSettings["stillRefs"], publishSettings["animatedRefs"], publishSettings["existing"])
log("All checks performed for publishToFlix.")
return 1
示例7: readMayaSettings
def readMayaSettings(testInfo, assetName):
# Setting defaults so that the check doesn't fail if something's missing from the csv file
settings = {"inFrame": 1, "outFrame": 24, "nShots": 0, "shotNames": [], "shotDurations": [], "audio": 0}
sourceDir = "%s/assets/fromMaya/" % testInfo.testPath
infoFile = "%s/%s_info.csv" % (sourceDir, assetName.strip(".mb"))
if not os.path.exists(infoFile):
log("readMayaSettings: Could not find info csv file %s." % infoFile, "error")
return settings
with open(infoFile, "rb") as csvfile:
csvreader = csv.reader(csvfile)
for row in csvreader:
if row[0] == "frameRange":
settings["inFrame"] = int(row[1])
settings["outFrame"] = int(row[2])
elif row[0] == "nShots":
settings["nShots"] = int(row[1])
elif row[0] == "shotNames":
for shot in range(1, settings["nShots"] + 1):
settings["shotNames"].append(row[shot])
elif row[0] == "shotDurations":
for shot in range(1, settings["nShots"] + 1):
settings["shotDurations"].append(int(row[shot]))
elif row[0] == "audio":
settings["audio"] = int(row[1])
log("readMayaSettings: Settings read from the Maya csv file:\n%s" % settings, "debug")
return settings
示例8: readPublishSettings
def readPublishSettings(testInfo, assetName):
# Setting defaults so that the check doesn't fail if something's missing from the csv file
settings = {
"timeout": 300,
"stillRefs": 0,
"animatedRefs": 0,
"undefinedRefs": 0,
"existing": 0,
"markers": [],
"duration": 300,
}
sourceDir = "%s/assets/fromEditorial/" % testInfo.testPath
file = "%s/%s_settings.csv" % (sourceDir, assetName)
if not os.path.exists(file):
log("readPublishSettings: Could not find settings csv file %s." % file, "error")
return settings
with open(file, "rb") as csvfile:
csvreader = csv.reader(csvfile)
for row in csvreader:
for setting in settings:
if setting == "markers" and row[0] == setting:
for marker in row[1:]:
settings[setting].append(marker)
elif row[0] == setting:
settings[setting] = int(row[1])
log("readPublishSettings: Settings read from the Publish csv file:\n%s" % settings, "debug")
return settings
示例9: importPanelsCheck
def importPanelsCheck(self, ext, nPanels, panelList, checkImage=True, replace=0):
log('## importPanelsCheck')
if checkImage:
self.__checkImage(ext, nPanels, panelList)
else:
self.__checkDoneProcessing(ext, nPanels)
sikuliUtils.saveVersion(self.importDrawing.testInfo, 'Imported %s %ss.' % (nPanels, ext))
# Check there's nPanels more panels in the current shotEdit
if ext == 'mov':
beat = 'a'
else:
beat = 'p'
newPanels = checkUtils.newPanelsInShotEdit(self.importDrawing.testInfo,
{beat: nPanels},
replace,
beats=[beat],
methodName='importPanelsCheck')
checkUtils.checkPanelDir(self.importDrawing.testInfo, newPanels,
['multitrack', 'jpg', 'xml'], 'importPanelsCheck')
# Check the pose for each panel was copied
checkUtils.checkPanelPose(self.importDrawing.testInfo, newPanels, 'importPanelsCheck')
if not replace:
self.__checkDuration(ext, nPanels, panelList)
log('All checks performed for importPanels.')
示例10: addDialogueCheck
def addDialogueCheck(self, panels, dialogue):
"""Checks the dialogue has been saved in each panel's multitrack
:param panels: Array of panel indices to check for dialogue
:param dialogue: String added to each panel as dialogue
:return: None
"""
log('## addDialogueCheck')
sikuliUtils.saveVersion(self.editTools.testInfo, 'Added dialogue to %s panels.' % len(panels))
editPanels = self.editTools.testInfo.getPanelsFromShotEdit(perBeat=False)
missing = []
for panel in panels:
multitrackDialogue = self.editTools.testInfo.getPanelDialogue(editPanels[panel-1])
if dialogue.replace("[panelIndex]", str(panel)) == multitrackDialogue:
log("addDialogueCheck: Found dialogue in %s's multitrack." % editPanels[panel-1], "debug")
else:
missing.append(editPanels[panel-1])
log("addDialogueCheck: Couldn't find dialogue in %s's multitrack." % editPanels[panel-1], "error")
self.editTools.testInfo.dialogue[editPanels[panel-1]] = multitrackDialogue
if len(missing):
self.editTools.testInfo.failed("addDialogue: Failed to find dialogue in the following panels' multitracks: "
"%s" % missing)
else:
log("addDialogueCheck: Found dialogue in every panel's multitrack.")
log('All checks performed for addDialogue.')
示例11: __waitEmptyDir
def __waitEmptyDir(self):
# Wait until the ~/flix directory is empty, meaning the import is complete
if pyUtils.waitUntilEmpty(self.fromSbp.sbpDir, 5) == 0:
self.fromSbp.testInfo.failed('sbpToFlixCheck: ~/flix directory still '
'not empty after %s seconds.' % (self.settings["timeout"] + 5))
pyUtils.emptyDir(self.fromSbp.sbpDir)
else:
log('- ~/flix directory emptied after SBP import.')
示例12: __checkPanelsInSbpXml
def __checkPanelsInSbpXml(self, xml):
expectedAnyClips = self.toEditorial.testInfo.getEditPanels(True)
foundAnyClips = pyUtils.findOccurences('<mastercomment1>', xml)
if foundAnyClips != expectedAnyClips:
self.toEditorial.testInfo.failed('toSBPCheck: Expected %s clips in the XML, '
'found %s instead.' % (expectedAnyClips, foundAnyClips))
else:
log('- Found all expected clips in the XML.')
示例13: __getFcpNewPanels
def __getFcpNewPanels(self):
fcpNew = []
for beat in self.toEditorial.testInfo.editPanels.iterkeys():
if beat in ['a', 'p', 's']:
for panel in self.toEditorial.testInfo.editPanels[beat]:
if panel not in self.toEditorial.testInfo.fcpPublished:
fcpNew.append(panel)
log('toPremiereCheck: fcpNew: %s' % fcpNew, 'debug')
return fcpNew
示例14: __checkAleImported
def __checkAleImported(self):
# Check the ALE is in the output path
if not os.path.exists('%s/%s_%s_v%s.ale' % (self.toEditorial.toAvidOutputDir,
self.toEditorial.testInfo.sequence,
self.toEditorial.testInfo.currentBranch,
self.toEditorial.testInfo.mainVersion)):
self.toEditorial.testInfo.failed('importToAvidCheck: Did not find the ALE imported.')
else:
log('- Found the ALE after import.')
示例15: loadLatestVersionCheck
def loadLatestVersionCheck(self):
"""Checks whether the latest version of the sequence was loaded
:return: None
"""
log('## loadLatestVersionCheck')
log("No check for this method yet!")
self.projectBrowser.showing = False