def __init__(self, testInfo, launch): self.testInfo = testInfo self.launch = launch self.projectBrowser = self.launch.projectBrowser self.editorialProjectBrowser = ProjectBrowser(self.testInfo) self.assetsDir = "%s/assets/fromEditorial" % self.testInfo.testPath self.editorialDir = self.testInfo.getEditorialDir() self.mp3Dir = "%s/mp3" % self.editorialDir self.movDir = "%s/mov" % self.editorialDir self.fromEditorialCheck = FromEditorialCheck(self)
class FromEditorial: def __init__(self, testInfo, launch): self.testInfo = testInfo self.launch = launch self.projectBrowser = self.launch.projectBrowser self.editorialProjectBrowser = ProjectBrowser(self.testInfo) self.assetsDir = "%s/assets/fromEditorial" % self.testInfo.testPath self.editorialDir = self.testInfo.getEditorialDir() self.mp3Dir = "%s/mp3" % self.editorialDir self.movDir = "%s/mov" % self.editorialDir self.fromEditorialCheck = FromEditorialCheck(self) def publishToFlix2(self, comment="Publish to Flix", assetName="refsFromPremiere", toShotgun=False, branch="main", asStills=True): log('##### publishToFlix') branch = "main" log("publishToFlix: branch set to 'main' by default as other branches aren't supported yet") self.testInfo.allAudio = pyUtils.countFiles(self.mp3Dir, "*.mp3") self.launch.openEditorialGUI(20, True) self.editorialProjectBrowser.selectEditorialProject() click(sikuli.Pattern('toAvidToFlix.png').targetOffset(20, 0)); wait(1) type(sikuli.Key.TAB); wait(1) type(sikuli.Key.TAB); wait(1) type(sikuli.Key.TAB); wait(1) movPath = "%s/%s.mov" % (self.assetsDir, assetName) type(movPath) type(sikuli.Key.TAB); wait(1) edlPathBase = "%s/%s" % (self.assetsDir, assetName) edlPathAvid = "%s.txt" % edlPathBase edlPathFcp = "%s.xml" % edlPathBase if os.path.exists(edlPathAvid): edlPath = edlPathAvid elif os.path.exists(edlPathFcp): edlPath = edlPathFcp else: log("publishToFlix: Could not find EDL file for %s editorial asset." % assetName, "error") # Close the Editorial GUI sikuliUtils.closeChromeTab() # Come back to Flix self.launch.openFlixGUI(10) self.projectBrowser.loadShow() self.projectBrowser.loadSequence() click("loadLatestVersion.png") return # settings['edl'] = edlPath type(edlPath) type(sikuli.Key.TAB); wait(1) if toShotgun: type(sikuli.Key.SPACE); wait(1) type(sikuli.Key.TAB); wait(1) if branch != "main": type(sikuli.Key.ENTER); wait(1) type(sikuli.Key.TAB); wait(1) if not asStills: type(sikuli.Key.SPACE); wait(1) type(sikuli.Key.TAB); wait(1) type(comment); wait(1) type(sikuli.Key.TAB); wait(1) type(sikuli.Key.ENTER) loadLatestVersion = self.fromEditorialCheck.publishToFlixCheck2(comment, assetName, toShotgun, branch, asStills) # Close the Editorial GUI sikuliUtils.closeChromeTab() # Come back to Flix self.launch.openFlixGUI(10) self.projectBrowser.loadShow() self.projectBrowser.loadSequence() if branch != "main" and loadLatestVersion: self.projectBrowser.switchToBranch(branch) elif loadLatestVersion: click('loadLatestVersion.png') else: self.projectBrowser.createCleanVersion()