Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added waitforlicense options to settings #3732

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pyaedt/desktop.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def launch_desktop_on_port():
command = [full_path, "-grpcsrv", str(port)]
if non_graphical:
command.append("-ng")
if settings.wait_for_license:
command.append("-waitforlicense")
my_env = os.environ.copy()
for env, val in settings.aedt_environment_variables.items():
my_env[env] = val
Expand Down Expand Up @@ -131,6 +133,8 @@ def launch_aedt_in_lsf(non_graphical, port): # pragma: no cover
]
if non_graphical:
command.append("-ng")
if settings.wait_for_license:
command.append("-waitforlicense")
print(command)
p = subprocess.Popen(command, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
timeout = settings.lsf_timeout
Expand Down
16 changes: 16 additions & 0 deletions pyaedt/generic/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,22 @@ def __init__(self):
self._desktop_launch_timeout = 90
self._number_of_grpc_api_retries = 6
self._retry_n_times_time_interval = 0.1
self._wait_for_license = False

@property
def wait_for_license(self):
"""Whether if Electronics Desktop has to be launched with ``-waitforlicense`` flag enabled or not.
Default is ``False``.

Returns
-------
bool
"""
return self._wait_for_license

@wait_for_license.setter
def wait_for_license(self, value):
self._wait_for_license = value

@property
def retry_n_times_time_interval(self):
Expand Down
Loading