From 50a887ebb6d59489bbcf38c5ca83f5d2f5f6c1b2 Mon Sep 17 00:00:00 2001 From: Timothyxxx <384084775@qq.com> Date: Fri, 23 Aug 2024 16:12:27 +0800 Subject: [PATCH] Fix the get terminal output error caused by namespace parameter changes --- desktop_env/server/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_env/server/main.py b/desktop_env/server/main.py index f0d8a6d..7ba8800 100644 --- a/desktop_env/server/main.py +++ b/desktop_env/server/main.py @@ -206,7 +206,7 @@ def get_terminal_output(): # 1. the terminal window (frame of application is st:active) is open and active # 2. the terminal tab (terminal status is st:focused) is focused xpath = '//application[@name="gnome-terminal-server"]/frame[@st:active="true"]//terminal[@st:focused="true"]' - terminals: List[_Element] = desktop_xml.xpath(xpath, namespaces=_accessibility_ns_map) + terminals: List[_Element] = desktop_xml.xpath(xpath, namespaces=_accessibility_ns_map_ubuntu) output = terminals[0].text.rstrip() if len(terminals) == 1 else None else: # windows and macos platform is not implemented currently # raise NotImplementedError