修复初始化异常的bug
parent
26a340ac56
commit
d91bd574f0
|
@ -5,7 +5,7 @@ Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Maintainer: Yutent <yutent.io@gmail.com>
|
Maintainer: Yutent <yutent.io@gmail.com>
|
||||||
Installed-Size: {{size}}
|
Installed-Size: {{size}}
|
||||||
Depends: python3-webengine-gtk3
|
Depends: python3-webengine-gtk3 (>=0.4.0)
|
||||||
Homepage: https://git.wkit.fun/appcat/hosts-switch/
|
Homepage: https://git.wkit.fun/appcat/hosts-switch/
|
||||||
Author: yutent
|
Author: yutent
|
||||||
Description: 一个hosts绑定切换工具
|
Description: 一个hosts绑定切换工具
|
||||||
|
|
|
@ -48,7 +48,7 @@ class Application(Gtk.Application):
|
||||||
self.window.show_all()
|
self.window.show_all()
|
||||||
|
|
||||||
|
|
||||||
def quit_all(self):
|
def quit_all(self, widget):
|
||||||
self.remove_window(self.window)
|
self.remove_window(self.window)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ const LOCK_FILE = `${APP_CONFIG_DIR}/lock`
|
||||||
export function noop() {}
|
export function noop() {}
|
||||||
|
|
||||||
export function checkPermission() {
|
export function checkPermission() {
|
||||||
return native.fs.access('/etc/hosts', 'w')
|
return native.fs.access('/etc/hosts', 'a+')
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getHistory() {
|
export async function getHistory() {
|
||||||
|
@ -22,7 +22,7 @@ export async function getHistory() {
|
||||||
return JSON.parse(cache)
|
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 records = cache.split(/[\n\r]+/)
|
||||||
let list = []
|
let list = []
|
||||||
let dict = {}
|
let dict = {}
|
||||||
|
|
Loading…
Reference in New Issue