mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
32 lines
729 B
Python
32 lines
729 B
Python
import sys
|
|
from Qt import QtWidgets, QtGui
|
|
|
|
from .settings import style, MainWidget
|
|
|
|
|
|
def main(user_role=None):
|
|
if user_role is None:
|
|
user_role = "artist"
|
|
else:
|
|
user_role_low = user_role.lower()
|
|
allowed_roles = ("developer", "manager", "artist")
|
|
if user_role_low not in allowed_roles:
|
|
raise ValueError("Invalid user role \"{}\". Expected {}".format(
|
|
user_role, ", ".join(allowed_roles)
|
|
))
|
|
|
|
app = QtWidgets.QApplication(sys.argv)
|
|
app.setWindowIcon(QtGui.QIcon(style.app_icon_path()))
|
|
|
|
widget = MainWidget(user_role)
|
|
widget.show()
|
|
widget.reset()
|
|
|
|
sys.exit(app.exec_())
|
|
|
|
|
|
__all__ = (
|
|
"style",
|
|
"MainWidget",
|
|
"main"
|
|
)
|