mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Application can use UndefinedApplicationExecutable
This commit is contained in:
parent
f694275bc4
commit
5b9e8bb495
1 changed files with 17 additions and 11 deletions
|
|
@ -191,26 +191,32 @@ class Application:
|
|||
self.full_label = full_label
|
||||
self._environment = data.get("environment") or {}
|
||||
|
||||
arguments = data.get("arguments")
|
||||
if isinstance(arguments, dict):
|
||||
arguments = arguments.get(platform.system().lower())
|
||||
|
||||
if not arguments:
|
||||
arguments = []
|
||||
self.arguments = arguments
|
||||
|
||||
if "executables" not in data:
|
||||
self.executables = [
|
||||
UndefinedApplicationExecutable()
|
||||
]
|
||||
return
|
||||
|
||||
_executables = data["executables"]
|
||||
if isinstance(_executables, dict):
|
||||
_executables = _executables.get(platform.system().lower())
|
||||
|
||||
if not _executables:
|
||||
_executables = []
|
||||
|
||||
elif isinstance(_executables, dict):
|
||||
_executables = _executables.get(platform.system().lower()) or []
|
||||
|
||||
_arguments = data["arguments"]
|
||||
if not _arguments:
|
||||
_arguments = []
|
||||
|
||||
elif isinstance(_arguments, dict):
|
||||
_arguments = _arguments.get(platform.system().lower()) or []
|
||||
|
||||
executables = []
|
||||
for executable in _executables:
|
||||
executables.append(ApplicationExecutable(executable))
|
||||
|
||||
self.executables = executables
|
||||
self.arguments = _arguments
|
||||
|
||||
def __repr__(self):
|
||||
return "<{}> - {}".format(self.__class__.__name__, self.full_name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue