From d91bd574f06fed32f97b665bc3c8e2db4865086c Mon Sep 17 00:00:00 2001 From: yutent Date: Wed, 6 Sep 2023 17:40:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/control | 2 +- usr/lib/hosts-switch/hosts-switch.py | 2 +- usr/lib/hosts-switch/webapp/utils/index.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/control b/debian/control index b874a34..1ca2767 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Architecture: all Priority: optional Maintainer: Yutent Installed-Size: {{size}} -Depends: python3-webengine-gtk3 +Depends: python3-webengine-gtk3 (>=0.4.0) Homepage: https://git.wkit.fun/appcat/hosts-switch/ Author: yutent Description: 一个hosts绑定切换工具 diff --git a/usr/lib/hosts-switch/hosts-switch.py b/usr/lib/hosts-switch/hosts-switch.py index 93e0d0a..9a9f594 100755 --- a/usr/lib/hosts-switch/hosts-switch.py +++ b/usr/lib/hosts-switch/hosts-switch.py @@ -48,7 +48,7 @@ class Application(Gtk.Application): self.window.show_all() - def quit_all(self): + def quit_all(self, widget): self.remove_window(self.window) diff --git a/usr/lib/hosts-switch/webapp/utils/index.js b/usr/lib/hosts-switch/webapp/utils/index.js index bb362d9..3e3fc21 100644 --- a/usr/lib/hosts-switch/webapp/utils/index.js +++ b/usr/lib/hosts-switch/webapp/utils/index.js @@ -13,7 +13,7 @@ const LOCK_FILE = `${APP_CONFIG_DIR}/lock` export function noop() {} export function checkPermission() { - return native.fs.access('/etc/hosts', 'w') + return native.fs.access('/etc/hosts', 'a+') } export async function getHistory() { @@ -22,7 +22,7 @@ export async function getHistory() { return JSON.parse(cache) } - let cache = await native.fs.read('/etc/hosts').toString() + let cache = await native.fs.read('/etc/hosts') let records = cache.split(/[\n\r]+/) let list = [] let dict = {}