adding context related functions to pype/template.py and other small changes, fixing typo on get_hierarchy(), rename fill_avalon_workdir to set_*, rename make_wordir_template to get_*,

This commit is contained in:
Jakub Jezek 2019-01-10 15:50:18 +01:00
parent eaa22dc082
commit 61bbfebb1e
20 changed files with 475 additions and 178 deletions

View file

@ -0,0 +1,50 @@
import sys
import logging
from avalon.vendor.Qt.QtWidgets import QApplication, QWidget, QPushButton, QMessageBox
log = logging.getLogger(__name__)
class Window(QWidget):
def __init__(self, title, message, level):
super().__init__()
self.title = title
self.message = message
self.level = level
if self.level is "info":
self._info()
elif self.level is "warning":
self._warning()
elif self.level is "critical":
self._critical()
def _info(self):
self.setWindowTitle(self.title)
rc = QMessageBox.information(
self, self.title, self.message)
if rc:
sys.exit(app.exec_())
def _warning(self):
self.setWindowTitle(self.title)
rc = QMessageBox.warning(
self, self.title, self.message)
if rc:
sys.exit(app.exec_())
def _critical(self):
self.setWindowTitle(self.title)
rc = QMessageBox.critical(
self, self.title, self.message)
if rc:
sys.exit(app.exec_())
def message(title=None, message=None, level="info"):
global app
app = QApplication(sys.argv)
ex = Window(title, message, level)
ex.show()
sys.exit(app.exec_())