5 Star 0 Fork 4

OpenCloudOS Stream/avahi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0005-fix-bytestring-decoding-for-proper-display.patch 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
nilusyi 提交于 2022-06-22 14:26 . OCS package init
From a94f72081dd1d546a1d95d860311a1242315bb28 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89ric=20Araujo?= <merwok@netwok.org>
Date: Sat, 29 Feb 2020 19:14:04 -0500
Subject: [PATCH 10/11] fix bytestring decoding for proper display
---
avahi-python/avahi-discover/avahi-discover.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/avahi-python/avahi-discover/avahi-discover.py b/avahi-python/avahi-discover/avahi-discover.py
index 0db705d..4a2b575 100755
--- a/avahi-python/avahi-discover/avahi-discover.py
+++ b/avahi-python/avahi-discover/avahi-discover.py
@@ -238,12 +238,15 @@ class Main_window:
txts+="<b>" + _("TXT") + " <i>%s</i></b> = %s\n" % (k,v)
else:
txts = "<b>" + _("TXT Data:") + "</b> <i>" + _("empty") + "</i>"
+
+ txts = txts.decode("utf-8")
infos = "<b>" + _("Service Type:") + "</b> %s\n"
infos += "<b>" + _("Service Name:") + "</b> %s\n"
infos += "<b>" + _("Domain Name:") + "</b> %s\n"
infos += "<b>" + _("Interface:") + "</b> %s %s\n"
infos += "<b>" + _("Address:") + "</b> %s/%s:%i\n%s"
+ infos = infos.decode("utf-8")
infos = infos % (stype, name, domain, self.siocgifname(interface), self.protoname(protocol), host, address, port, txts.strip())
self.info_label.set_markup(infos)
--
2.25.2
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/opencloudos-stream/avahi.git
git@gitee.com:opencloudos-stream/avahi.git
opencloudos-stream
avahi
avahi
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891