8 Star 0 Fork 5

src-anolis-os/tuna

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
tuna-Don-t-start-the-gui-if-a-display-is-not-availab.patch 883 Bytes
一键复制 编辑 原始数据 按行查看 历史
Zhao Hang 提交于 2024-07-22 11:05 +08:00 . update to tuna-0.18-9.src.rpm
From f2763aaed8f421bcf266a3122a84c41a7441a5d9 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Mon, 11 Dec 2023 16:29:02 -0500
Subject: [PATCH] tuna: Don't start the gui if a display is not available
This is intended for the getopt branch of tuna
Don't start the gui if a display is not available.
Signed-off-by: John Kacur <jkacur@redhat.com>
---
tuna-cmd.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tuna-cmd.py b/tuna-cmd.py
index 38e7017336a5..ff2920f06d6f 100755
--- a/tuna-cmd.py
+++ b/tuna-cmd.py
@@ -821,6 +821,12 @@ def main():
sys.exit(2)
if run_gui:
+ # Don't try to start the gui if no display is available
+ display = os.getenv("DISPLAY")
+ if not display:
+ usage()
+ return
+
try:
from tuna import tuna_gui
except ImportError:
--
2.42.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-os/tuna.git
git@gitee.com:src-anolis-os/tuna.git
src-anolis-os
tuna
tuna
a8

搜索帮助

371d5123 14472233 46e8bd33 14472233