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 Linux support to Console.py_build #2670

Merged
merged 4 commits into from
Mar 22, 2023
Merged
Changes from 1 commit
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
18 changes: 18 additions & 0 deletions pyaedt/misc/Console.py_build
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,25 @@ pyaedt_toolkit_dir = os.path.normpath(os.path.join(current_dir, r"##TOOLKIT_REL_
python_exe = r"##IPYTHON_EXE##" % version
pyaedt_script = os.path.join(pyaedt_toolkit_dir, "console_setup.py")
if os.name =="posix":
terminals = ['x-terminal-emulator', 'xterm', 'gnome-terminal', 'konsole', 'lxterminal', 'mlterm']
term = None
for terminal in terminals:
p = subprocess.Popen(['which',terminal], stdout=subprocess.PIPE)
kbhagat-ansys marked this conversation as resolved.
Show resolved Hide resolved
output = p.stdout.readlines()
if "which: no" in output or output == []:
continue
else:
term = terminal
break
if not term:
oDesktop.AddMessage("", "", 2, "No Terminals found.")
sys.exit()
em_var = "ANSYSEM_ROOT{}".format(version)
os.environ[em_var]= oDesktop.GetExeDir()

command = [
term,
"-e",
'{}'.format(python_exe),
"-i",
'{}'.format(pyaedt_script),
Expand Down