fixed attributes usage

This commit is contained in:
iLLiCiTiT 2021-03-30 19:43:05 +02:00
parent b6b1ab4b3a
commit a507d78f9c
4 changed files with 13 additions and 12 deletions

View file

@ -32,7 +32,7 @@ class GlobalHostDataHook(PreLaunchHook):
"project_name": self.data["project_name"],
"asset_name": self.data["asset_name"],
"task_name": self.data["task_name"],
"app_name": app.app_name,
"app": app,
"dbcon": self.data["dbcon"],

View file

@ -418,7 +418,7 @@ class LaunchHook:
return False
if cls.app_groups:
if launch_context.app_group not in cls.app_groups:
if launch_context.app_group.name not in cls.app_groups:
return False
if cls.app_names:
@ -445,11 +445,11 @@ class LaunchHook:
@property
def app_group(self):
return getattr(self.application, "app_group", None)
return getattr(self.application, "group", None)
@property
def app_name(self):
return getattr(self.application, "app_name", None)
return getattr(self.application, "name", None)
def validate(self):
"""Optional validation of launch hook on initialization.
@ -718,7 +718,7 @@ class ApplicationLaunchContext:
@property
def app_name(self):
return self.application.app_name
return self.application.name
@property
def host_name(self):
@ -726,7 +726,7 @@ class ApplicationLaunchContext:
@property
def app_group(self):
return self.application.app_group
return self.application.group
@property
def manager(self):
@ -1060,7 +1060,8 @@ def prepare_context_environments(data):
"AVALON_ASSET": asset_doc["name"],
"AVALON_TASK": task_name,
"AVALON_APP": app.host_name,
"AVALON_APP_NAME": app.app_name,
# TODO this hould be `app.full_name` in future PRs
"AVALON_APP_NAME": app.name,
"AVALON_WORKDIR": workdir
}
log.debug(

View file

@ -133,8 +133,8 @@ class AppplicationsAction(BaseAction):
app_icon = None
items.append({
"label": app.label,
"variant": app.variant_label,
"label": app.group.label,
"variant": app.label,
"description": None,
"actionIdentifier": self.identifier + app_name,
"icon": app_icon

View file

@ -162,9 +162,9 @@ class ActionModel(QtGui.QStandardItemModel):
(ApplicationAction,),
{
"application": app,
"name": app.app_name,
"label": app.label,
"label_variant": app.variant_label,
"name": app.name,
"label": app.group.label,
"label_variant": app.label,
"group": None,
"icon": app.icon,
"color": getattr(app, "color", None),