add multi_apps; update chrome utilities
This commit is contained in:
@@ -61,6 +61,18 @@ def execute_command():
|
||||
}), 500
|
||||
|
||||
|
||||
def _get_machine_architecture() -> str:
|
||||
""" Get the machine architecture, e.g., x86_64, arm64, aarch64, i386, etc.
|
||||
"""
|
||||
architecture = platform.machine().lower()
|
||||
if architecture in ['amd32', 'amd64', 'x86', 'x86_64', 'x86-64', 'x64', 'i386', 'i686']:
|
||||
return 'amd'
|
||||
elif architecture in ['arm64', 'aarch64', 'aarch32']:
|
||||
return 'arm'
|
||||
else:
|
||||
return 'unknown'
|
||||
|
||||
|
||||
@app.route('/setup/launch', methods=["POST"])
|
||||
def launch_app():
|
||||
data = request.json
|
||||
@@ -71,6 +83,9 @@ def launch_app():
|
||||
command = shlex.split(command)
|
||||
|
||||
try:
|
||||
if 'google-chrome' in command and _get_machine_architecture() == 'arm':
|
||||
index = command.index('google-chrome')
|
||||
command[index] = 'chromium-browser' # arm64 chrome is not available yet, can only use chromium
|
||||
subprocess.Popen(command, shell=shell)
|
||||
return "{:} launched successfully".format(command if shell else " ".join(command))
|
||||
except Exception as e:
|
||||
@@ -287,6 +302,11 @@ def _create_atspi_node(node: Accessible) -> _Element:
|
||||
)
|
||||
if "text" in locals() and len(text) > 0:
|
||||
xml_node.text = text
|
||||
|
||||
# HACK: libreoffice has a problem -> billions of children for parent with RoleName "document spreadsheet"
|
||||
if node.getRoleName() == "document spreadsheet":
|
||||
return xml_node
|
||||
|
||||
for ch in node:
|
||||
xml_node.append(_create_atspi_node(ch))
|
||||
return xml_node
|
||||
|
||||
Reference in New Issue
Block a user