No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

submitToMuster_leonardo.py 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. '''
  2. **
  3. ** File library
  4. **
  5. ** Name : submitToMuster.py
  6. ** Author : Leonardo Bernardini
  7. ** Version : 2.0, Thu Feb 20th 2014
  8. **
  9. ** Copyright 2000-2017, Virtual Vertex
  10. ** All Rights Reserved.
  11. **
  12. ** This file contains UNPUBLISHED PROPRIETARY SOURCE CODE.
  13. ** The contents of this file may not be disclosed to third parties, copied
  14. ** or duplicated in any form, in whole or in part, without the prior written
  15. ** permission of the author.
  16. **
  17. '''
  18. import nuke
  19. import nukescripts
  20. import os
  21. import sys
  22. import ConfigParser
  23. import PySide2.QtCore as QtCore
  24. import PySide2.QtWidgets as QtWidgets
  25. def getMusterPath(installationPath):
  26. if os.name != "posix":
  27. return installationPath
  28. else:
  29. if sys.platform == "darwin":
  30. return (os.path.join(installationPath,"Contents"))
  31. return installationPath
  32. def getMrtoolPath(installationPath):
  33. if os.name != "posix":
  34. return os.path.join(getMusterPath(installationPath),"mrtool.exe")
  35. return os.path.join(getMusterPath(installationPath),"mrtool")
  36. def checkMusterPath(path):
  37. mrtool = getMrtoolPath(path)
  38. if not os.path.isfile(mrtool):
  39. return None
  40. return mrtool
  41. def submitToMuster():
  42. rootNode = nuke.toNode("root")
  43. if not rootNode:
  44. nuke.message("Please save your job before submitting to Muster !")
  45. return None
  46. curScript = rootNode.name()
  47. job = os.path.splitext(os.path.basename(curScript))[0]
  48. homedir = os.path.expanduser("~")
  49. settingsDir = os.path.join(homedir,".Muster")
  50. if not os.path.isdir(settingsDir):
  51. os.mkdir(settingsDir)
  52. settingsFile = os.path.join(settingsDir,"nuke_connector.ini")
  53. config = ConfigParser.RawConfigParser()
  54. config.read(settingsFile)
  55. try:
  56. musterLocation = config.get('Muster', 'installationPath')
  57. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  58. musterLocation = os.getenv("MUSTER")
  59. if not musterLocation:
  60. nuke.message("MUSTER environmental variable not defined. Please select the location of Muster mrtool executable!")
  61. try:
  62. dispatcherAddress = config.get('Muster', 'address')
  63. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  64. dispatcherAddress = "127.0.0.1"
  65. try:
  66. musterVersion = int(config.get('Muster', 'version'))
  67. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  68. musterVersion = 0
  69. try:
  70. dispatcherPort = config.get('Muster', 'port')
  71. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  72. dispatcherPort = "9781"
  73. try:
  74. login = config.get('Muster', 'login')
  75. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  76. login = "admin"
  77. try:
  78. packetSize = config.get('Muster', 'packetSize')
  79. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  80. packetSize = "10"
  81. try:
  82. skipTemplates = config.get('Muster', 'skipTemplates')
  83. if skipTemplates == "1": skipTemplates = QtCore.Qt.Checked
  84. else: skipTemplates = QtCore.Qt.Unchecked
  85. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  86. skipTemplates = QtCore.Qt.Checked
  87. try:
  88. nukeTemplateId = config.get('Muster', 'nukeTemplateId')
  89. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  90. nukeTemplateId = "40"
  91. try:
  92. nukeTemplateVersion = config.get('Muster', 'nukeTemplateVersion')
  93. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  94. nukeTemplateVersion = ""
  95. try:
  96. includedPools = config.get('Muster', 'includedPools')
  97. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  98. includedPools = ""
  99. try:
  100. excludedPools = config.get('Muster', 'excludedPools')
  101. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  102. excludedPools = ""
  103. try:
  104. errorCheck = config.get('Muster', 'errorCheck')
  105. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  106. errorCheck = 0
  107. try:
  108. exitErrorCheck = config.get('Muster', 'exitErrorCheck')
  109. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  110. exitErrorCheck = 0
  111. try:
  112. additionalFlags = config.get('Muster', 'additionalFlags')
  113. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  114. additionalFlags = ""
  115. try:
  116. jobDepartment = config.get('Muster', 'jobDepartment')
  117. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  118. jobDepartment = ""
  119. try:
  120. jobProject = config.get('Muster', 'jobProject')
  121. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  122. jobProject = ""
  123. try:
  124. jobParent = config.get('Muster', 'jobParent')
  125. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  126. jobParent = ""
  127. try:
  128. jobMaximumInstances = config.get('Muster', 'jobMaximumInstances')
  129. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  130. jobMaximumInstances = "0"
  131. try:
  132. jobDependancies = config.get('Muster', 'jobDependancies')
  133. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  134. jobDependancies = ""
  135. try:
  136. jobSubmitPaused = config.get('Muster', 'jobSubmitPaused')
  137. if jobSubmitPaused == "1": jobSubmitPaused = QtCore.Qt.Checked
  138. else: jobSubmitPaused = QtCore.Qt.Unchecked
  139. except (ConfigParser.NoSectionError,ConfigParser.NoOptionError):
  140. jobSubmitPaused = QtCore.Qt.Unchecked
  141. dlg = SubmitToMuster()
  142. try:
  143. nuke.scriptSave()
  144. except:
  145. return None
  146. dlg.jobName.setText(job)
  147. dlg.musterVersion.setCurrentIndex(musterVersion)
  148. dlg.dispatcherPort.setText(dispatcherPort)
  149. dlg.startFrame.setText("%s" % nuke.root().firstFrame())
  150. dlg.endFrame.setText("%s" % nuke.root().lastFrame())
  151. dlg.byFrame.setText("1")
  152. dlg.packetSize.setText("10")
  153. dlg.jobPriority.setText("1");
  154. dlg.installationPath.setText(musterLocation)
  155. dlg.dispatcherIpAddress.setText(dispatcherAddress)
  156. dlg.username.setText(login)
  157. dlg.packetSize.setText(packetSize)
  158. dlg.nukeTemplateID.setText(nukeTemplateId)
  159. dlg.nukeTemplateVersion.setText(nukeTemplateVersion)
  160. dlg.skipTemplates.setCheckState(skipTemplates)
  161. dlg.musterVersion.currentIndexChanged.connect(dlg.onMusterVersionChanged)
  162. dlg.includedPools.setText(includedPools)
  163. dlg.excludedPools.setText(excludedPools)
  164. dlg.additionalFlags.setText(additionalFlags)
  165. dlg.jobDepartment.setText(jobDepartment)
  166. dlg.jobProject.setText(jobProject)
  167. dlg.jobParent.setText(jobParent)
  168. dlg.errorCheck.setCurrentIndex(int(errorCheck))
  169. dlg.exitErrorCheck.setCurrentIndex(int(exitErrorCheck))
  170. dlg.jobMaximumInstances.setText(jobMaximumInstances)
  171. dlg.jobDependancies.setText(jobDependancies)
  172. dlg.jobSubmitPaused.setCheckState(jobSubmitPaused)
  173. res = dlg.exec_()
  174. if res != QtWidgets.QDialog.Accepted:
  175. return None
  176. try:
  177. config.add_section('Muster')
  178. except ConfigParser.DuplicateSectionError:
  179. pass
  180. config.set('Muster', 'installationPath', dlg.installationPath.text())
  181. config.set('Muster', 'address', dlg.dispatcherIpAddress.text())
  182. config.set('Muster', 'login', dlg.username.text())
  183. config.set('Muster', 'packetSize', dlg.packetSize.text())
  184. config.set('Muster', 'port', dlg.dispatcherPort.text())
  185. config.set('Muster', 'version', dlg.musterVersion.currentIndex())
  186. config.set('Muster', 'nukeTemplateId', dlg.nukeTemplateID.text())
  187. config.set('Muster', 'nukeTemplateVersion', dlg.nukeTemplateVersion.text())
  188. skipTemplates = "0"
  189. if dlg.skipTemplates.checkState() == QtCore.Qt.Checked: skipTemplates = "1"
  190. config.set('Muster', 'skipTemplates',skipTemplates)
  191. config.set('Muster', 'includedPools', dlg.includedPools.text())
  192. config.set('Muster', 'excludedPools', dlg.excludedPools.text())
  193. config.set('Muster', 'additionalFlags', dlg.additionalFlags.text())
  194. config.set('Muster', 'errorCheck', dlg.errorCheck.currentIndex())
  195. config.set('Muster', 'exitErrorCheck', dlg.exitErrorCheck.currentIndex())
  196. config.set('Muster', 'jobDepartment', dlg.jobDepartment.text())
  197. config.set('Muster', 'jobProject', dlg.jobProject.text())
  198. config.set('Muster', 'jobParent', dlg.jobParent.text())
  199. config.set('Muster', 'jobMaximumInstances', dlg.jobMaximumInstances.text())
  200. config.set('Muster', 'jobDependancies', dlg.jobDependancies.text())
  201. jobSubmitPaused = "0"
  202. if dlg.jobSubmitPaused.checkState() == QtCore.Qt.Checked: jobSubmitPaused = "1"
  203. config.set('Muster', 'jobSubmitPaused',jobSubmitPaused)
  204. with open(settingsFile, 'wb') as configfile:
  205. config.write(configfile)
  206. class mrtoolMonitor(QtWidgets.QDialog):
  207. aborted = QtCore.Signal()
  208. def __init__(self, parent=None):
  209. QtWidgets.QDialog.__init__(self, parent)
  210. self.setWindowTitle("Mrtool output")
  211. self.setLayout(QtWidgets.QVBoxLayout())
  212. self.textView = QtWidgets.QTextEdit()
  213. self.abortButton = QtWidgets.QPushButton("Abort")
  214. self.layout().addWidget(self.textView)
  215. self.layout().addWidget(self.abortButton)
  216. self.abortButton.pressed.connect(self.onAbort)
  217. def addString(self,text):
  218. self.textView.append(text)
  219. def onAbort(self):
  220. self.aborted.emit()
  221. def closeEvent(self, event):
  222. event.ignore()
  223. class SubmitToMuster(QtWidgets.QDialog):
  224. def onMusterVersionChanged(self,index):
  225. if self.musterVersion.currentIndex() == 0:
  226. self.dispatcherPort.setText("9881")
  227. elif self.musterVersion.currentIndex() == 1:
  228. self.dispatcherPort.setText("9781")
  229. else:
  230. self.dispatcherPort.setText("9681")
  231. def onInstallationPathPressed(self):
  232. path = QtWidgets.QFileDialog.getExistingDirectory (self,"Select installation path", self.installationPath.text());
  233. if len(path):
  234. if checkMusterPath(path):
  235. self.installationPath.setText(path)
  236. else:
  237. nuke.message("The specified path does not contains Muster mrtool command line application !")
  238. def onProcessFinished(self,exitCode):
  239. out = self.process.readAllStandardOutput()
  240. if self.mrtoolMon != None:
  241. self.mrtoolMon.addString(out.data())
  242. out = self.process.readAllStandardError()
  243. if self.mrtoolMon != None:
  244. self.mrtoolMon.addString(out.data())
  245. self.mrtoolMon.abortButton.setText("Close")
  246. self.submitButton.setEnabled(1)
  247. self.closeButton.setEnabled(1)
  248. def onProcessErrDataReady(self):
  249. out = self.process.readAllStandardError()
  250. self.mrtoolMon.addString(out.data())
  251. def onProcessOutDataReady(self):
  252. out = self.process.readAllStandardOutput()
  253. self.mrtoolMon.addString(out.data())
  254. def onMrtoolAbort(self):
  255. self.process.terminate()
  256. self.mrtoolMon.hide()
  257. self.mrtoolMon = None
  258. def fireMrtool(self,jobFile):
  259. mrtoolPath = checkMusterPath(self.installationPath.text())
  260. if not mrtoolPath:
  261. nuke.message("The specified path does not contains Muster mrtool command line application !")
  262. return None
  263. musterEnv = getMusterPath (self.installationPath.text())
  264. arguments = []
  265. arguments.append("-v")
  266. arguments.append("1")
  267. if self.skipTemplates.checkState() == QtCore.Qt.Checked:
  268. arguments.append("-usecache")
  269. arguments.append("-b")
  270. arguments.append("-n")
  271. arguments.append(self.jobName.text())
  272. arguments.append("-e")
  273. arguments.append(self.nukeTemplateID.text())
  274. arguments.append("-u")
  275. arguments.append(self.username.text())
  276. arguments.append("-p")
  277. arguments.append(self.password.text())
  278. arguments.append("-sf")
  279. arguments.append(self.startFrame.text())
  280. arguments.append("-ef")
  281. arguments.append(self.endFrame.text())
  282. arguments.append("-bf")
  283. arguments.append(self.byFrame.text())
  284. arguments.append("-pr")
  285. arguments.append(self.jobPriority.text())
  286. if len(self.nukeTemplateVersion.text()):
  287. arguments.append("-tv")
  288. arguments.append(self.nukeTemplateVersion.text())
  289. if len(self.includedPools.text()):
  290. arguments.append("-pool")
  291. arguments.append(self.includedPools.text())
  292. if len(self.excludedPools.text()):
  293. arguments.append("-excludepool")
  294. arguments.append(self.excludedPools.text())
  295. if len(self.jobDepartment.text()):
  296. arguments.append("-department")
  297. arguments.append(self.jobDepartment.text())
  298. if len(self.jobProject.text()):
  299. if self.musterVersion.currentIndex() == 0:
  300. arguments.append("-project")
  301. else:
  302. arguments.append("-group")
  303. arguments.append(self.jobProject.text())
  304. if len(self.jobParent.text()):
  305. arguments.append("-parent")
  306. arguments.append(self.jobParent.text())
  307. if len(self.jobMaximumInstances.text()):
  308. arguments.append("-max")
  309. arguments.append(self.jobMaximumInstances.text())
  310. if len(self.jobDependancies.text()):
  311. arguments.append("-wait")
  312. arguments.append(self.jobDependancies.text())
  313. if self.jobSubmitPaused.checkState() == QtCore.Qt.Checked:
  314. arguments.append("-ojs")
  315. arguments.append("2")
  316. if self.errorCheck.currentIndex() == 1:
  317. arguments.append("-logerrtype")
  318. arguments.append(str(self.errorCheck.currentIndex()))
  319. if self.errorCheck.currentIndex() == 2:
  320. arguments.append("-logerrtype")
  321. arguments.append(str(self.errorCheck.currentIndex()))
  322. if self.errorCheck.currentIndex() == 3:
  323. arguments.append("-logerrtype")
  324. arguments.append(str(self.errorCheck.currentIndex()))
  325. if self.exitErrorCheck.currentIndex() == 1:
  326. arguments.append("-ecerrtype")
  327. arguments.append(str(self.exitErrorCheck.currentIndex()))
  328. if self.exitErrorCheck.currentIndex() == 2:
  329. arguments.append("-ecerrtype")
  330. arguments.append(str(self.exitErrorCheck.currentIndex()))
  331. if self.exitErrorCheck.currentIndex() == 3:
  332. arguments.append("-ecerrtype")
  333. arguments.append(str(self.exitErrorCheck.currentIndex()))
  334. if len(self.additionalFlags.text()):
  335. arguments.append("-add")
  336. arguments.append(self.additionalFlags.text())
  337. arguments.append("-s")
  338. arguments.append(self.dispatcherIpAddress.text())
  339. arguments.append("-pk")
  340. arguments.append(self.packetSize.text())
  341. arguments.append("-f")
  342. arguments.append(jobFile)
  343. self.mrtoolMon = mrtoolMonitor()
  344. self.mrtoolMon.aborted.connect(self.onMrtoolAbort)
  345. self.mrtoolMon.setModal(1)
  346. self.mrtoolMon.show()
  347. self.mrtoolMon.addString("Starting " + mrtoolPath + " with the following arguments: " + '%s' % ' '.join(map(str, arguments)) + "\n")
  348. self.process = QtCore.QProcess()
  349. self.process.setProcessChannelMode(QtCore.QProcess.MergedChannels)
  350. processEnvironment = QtCore.QProcessEnvironment.systemEnvironment()
  351. processEnvironment.insert("MUSTER",musterEnv)
  352. self.process.setProcessEnvironment(processEnvironment)
  353. self.process.finished.connect(self.onProcessFinished)
  354. self.process.readyReadStandardError.connect(self.onProcessErrDataReady)
  355. self.process.readyReadStandardOutput.connect(self.onProcessOutDataReady)
  356. self.submitButton.setEnabled(0)
  357. self.closeButton.setEnabled(0)
  358. self.process.start(mrtoolPath , arguments)
  359. if not self.process.waitForStarted() :
  360. nuke.message("Failed to start Muster Mrtool process!")
  361. return None
  362. def onSubmit(self):
  363. if not checkMusterPath(self.installationPath.text()):
  364. nuke.message("The specified path does not contains Muster mrtool command line application !")
  365. return None
  366. rootNode = nuke.toNode("root")
  367. if not rootNode:
  368. nuke.message("Please save your job before submitting to Muster !")
  369. return None
  370. curScript = rootNode.name()
  371. job = os.path.splitext(os.path.basename(curScript))[0]
  372. self.fireMrtool(curScript)
  373. def onClose(self):
  374. self.accept()
  375. def onReset(self):
  376. rootNode = nuke.toNode("root")
  377. if rootNode:
  378. curScript = rootNode.name()
  379. job = os.path.splitext(os.path.basename(curScript))[0]
  380. self.jobName.setText(job)
  381. self.startFrame.setText("%s" % rootNode.firstFrame())
  382. self.endFrame.setText("%s" % rootNode.lastFrame())
  383. else:
  384. self.jobName.setText("Untitled")
  385. self.startFrame.setText("1")
  386. self.endFrame.setText("1")
  387. self.byFrame.setText("1")
  388. self.packetSize.setText("10")
  389. self.jobPriority.setText("1");
  390. self.nukeTemplateID.setText("40")
  391. self.nukeTemplateVersion.setText("")
  392. self.includedPools.setText("")
  393. self.excludedPools.setText("")
  394. self.additionalFlags.setText("")
  395. self.jobDepartment.setText("")
  396. self.jobProject.setText("")
  397. self.jobParent.setText("")
  398. self.jobMaximumInstances.setText("0")
  399. self.jobDependancies.setText("")
  400. self.jobSubmitPaused.setCheckState(QtCore.Qt.Unchecked)
  401. self.exitErrorCheck.setCurrentIndex(0)
  402. self.errorCheck.setCurrentIndex(0)
  403. def __init__(self, parent=None):
  404. QtWidgets.QDialog.__init__(self, parent)
  405. self.setWindowTitle("Submit to Muster")
  406. self.setLayout(QtWidgets.QVBoxLayout())
  407. self.tabWidget = QtWidgets.QTabWidget()
  408. self.jobTabWidget = QtWidgets.QWidget()
  409. self.dispatcherTabWidget = QtWidgets.QWidget()
  410. self.tabWidget.addTab(self.jobTabWidget,"Job")
  411. self.tabWidget.addTab(self.dispatcherTabWidget,"Dispatcher")
  412. self.layout().addWidget(self.tabWidget)
  413. self.dispatcherFormLayout = QtWidgets.QFormLayout()
  414. self.jobFormLayout = QtWidgets.QFormLayout()
  415. self.jobTabWidget.setLayout(self.jobFormLayout)
  416. self.dispatcherTabWidget.setLayout(self.dispatcherFormLayout)
  417. self.installationPath = QtWidgets.QLineEdit()
  418. self.installationPathLabel = QtWidgets.QLabel()
  419. self.installationPathLabel.setText("")
  420. self.pickInstallationPath = QtWidgets.QPushButton()
  421. self.pickInstallationPath.setText("...")
  422. self.installationLayout = QtWidgets.QHBoxLayout()
  423. self.installationLayout.addWidget(self.installationPath)
  424. self.installationLayout.addWidget(self.pickInstallationPath)
  425. self.musterVersion = QtWidgets.QComboBox()
  426. self.musterVersion.addItem("9.0 or greater")
  427. self.musterVersion.addItem("8.X")
  428. self.musterVersion.addItem("7.X")
  429. self.skipTemplates = QtWidgets.QCheckBox()
  430. self.dispatcherIpAddress = QtWidgets.QLineEdit()
  431. self.dispatcherPort = QtWidgets.QLineEdit()
  432. self.dispatcherPort.setInputMask("000000")
  433. self.username = QtWidgets.QLineEdit()
  434. self.jobName = QtWidgets.QLineEdit()
  435. self.password = QtWidgets.QLineEdit()
  436. self.password.setEchoMode(QtWidgets.QLineEdit.Password)
  437. self.startFrame = QtWidgets.QLineEdit()
  438. self.startFrame.setInputMask("0000000")
  439. self.endFrame = QtWidgets.QLineEdit()
  440. self.endFrame.setInputMask("0000000")
  441. self.byFrame = QtWidgets.QLineEdit()
  442. self.byFrame.setInputMask("0000000")
  443. self.packetSize = QtWidgets.QLineEdit()
  444. self.packetSize.setInputMask("0000")
  445. self.jobPriority = QtWidgets.QLineEdit()
  446. self.jobPriority.setInputMask("000");
  447. self.includedPools = QtWidgets.QLineEdit()
  448. self.excludedPools = QtWidgets.QLineEdit()
  449. self.errorCheck = QtWidgets.QComboBox()
  450. self.errorCheck.addItem("Default");
  451. self.errorCheck.addItem("Skip warnings");
  452. self.errorCheck.addItem("Skip errors");
  453. self.errorCheck.addItem("Skip both");
  454. self.exitErrorCheck = QtWidgets.QComboBox()
  455. self.exitErrorCheck.addItem("Default");
  456. self.exitErrorCheck.addItem("Skip warnings");
  457. self.exitErrorCheck.addItem("Skip errors");
  458. self.exitErrorCheck.addItem("Skip both");
  459. self.additionalFlags = QtWidgets.QLineEdit()
  460. self.nukeTemplateVersion = QtWidgets.QLineEdit()
  461. self.nukeTemplateID = QtWidgets.QLineEdit()
  462. self.nukeTemplateID.setInputMask("0000");
  463. self.jobDepartment = QtWidgets.QLineEdit()
  464. self.jobProject = QtWidgets.QLineEdit()
  465. self.jobParent = QtWidgets.QLineEdit()
  466. self.jobParent.setInputMask("00000000");
  467. self.jobMaximumInstances = QtWidgets.QLineEdit()
  468. self.jobMaximumInstances.setInputMask("00000000");
  469. self.jobDependancies = QtWidgets.QLineEdit()
  470. self.jobSubmitPaused = QtWidgets.QCheckBox()
  471. self.dispatcherFormLayout.addRow("Installation path:",self.installationLayout)
  472. self.dispatcherFormLayout.addRow("Muster version:",self.musterVersion)
  473. self.dispatcherFormLayout.addRow("Dispatcher address:",self.dispatcherIpAddress)
  474. self.dispatcherFormLayout.addRow("Dispatcher port:",self.dispatcherPort)
  475. self.dispatcherFormLayout.addRow("Login:",self.username)
  476. self.dispatcherFormLayout.addRow("Password:",self.password)
  477. self.dispatcherFormLayout.addRow("Skip templates sync:" ,self.skipTemplates)
  478. self.dispatcherFormLayout.addRow("Nuke template ID:",self.nukeTemplateID)
  479. self.jobFormLayout.addRow("Job name:",self.jobName)
  480. self.jobFormLayout.addRow("Job department:",self.jobDepartment)
  481. self.jobFormLayout.addRow("Job project:",self.jobProject)
  482. self.jobFormLayout.addRow("Start frame:",self.startFrame)
  483. self.jobFormLayout.addRow("End frame:",self.endFrame)
  484. self.jobFormLayout.addRow("By frame:",self.byFrame)
  485. self.jobFormLayout.addRow("Packet size:",self.packetSize)
  486. self.jobFormLayout.addRow("Job priority:",self.jobPriority)
  487. self.jobFormLayout.addRow("Job parent ID:",self.jobParent)
  488. self.jobFormLayout.addRow("Logs error check:",self.errorCheck)
  489. self.jobFormLayout.addRow("Exit codes error check:",self.exitErrorCheck)
  490. self.jobFormLayout.addRow("Job maximum instances:",self.jobMaximumInstances)
  491. self.jobFormLayout.addRow("Job dependancies:",self.jobDependancies)
  492. self.jobFormLayout.addRow("Destination pools:",self.includedPools)
  493. self.jobFormLayout.addRow("Excluded pools:",self.excludedPools)
  494. self.jobFormLayout.addRow("Submit paused:",self.jobSubmitPaused)
  495. self.jobFormLayout.addRow("Nuke template version:",self.nukeTemplateVersion)
  496. self.jobFormLayout.addRow("Additional flags:",self.additionalFlags)
  497. self.buttonsLayout = QtWidgets.QHBoxLayout()
  498. self.submitButton = QtWidgets.QPushButton("Submit")
  499. self.resetButton = QtWidgets.QPushButton("Reset")
  500. self.closeButton = QtWidgets.QPushButton("Close")
  501. self.buttonsLayout.addWidget(self.submitButton)
  502. self.buttonsLayout.addStretch()
  503. self.buttonsLayout.addWidget(self.resetButton)
  504. self.buttonsLayout.addWidget(self.closeButton)
  505. self.closeButton.pressed.connect(self.onClose)
  506. self.resetButton.pressed.connect(self.onReset)
  507. self.submitButton.pressed.connect(self.onSubmit)
  508. self.layout().addLayout(self.buttonsLayout)
  509. self.pickInstallationPath.pressed.connect(self.onInstallationPathPressed)
  510. self.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed))