From 337e67307bbdaa559d6778934e5f45733d6f293f Mon Sep 17 00:00:00 2001 From: callmemhz Date: Sun, 26 Feb 2023 13:27:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=20python3.9+?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ alfred/plist.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 19bebd4..88d223d 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ **支持 Mac OS 12.3 及以上版本。** +**支持 python3.9+** (如果缺少 `six` 请先安装:`pip3 install six`) + **请到 release 页面下载最新的 workflow,双击安装。** **为了使用方便,请设置取词快捷键。** diff --git a/alfred/plist.py b/alfred/plist.py index 03f31e3..2787e82 100644 --- a/alfred/plist.py +++ b/alfred/plist.py @@ -21,7 +21,8 @@ def __init__(self): self.__branches = {} def read(self, path): - self.__plist = plistlib.readPlist(path) + with open(path, 'rb') as f: + self.__plist = plistlib.load(f) for obj in self.__plist['objects']: if 'keyword' in obj['config']: self.__base = obj @@ -37,7 +38,7 @@ def read(self, path): def write(self, path): if self.__plist: - plistlib.writePlist(self.__plist, path) + plistlib.dump(self.__plist, path) def get_keyword(self): if self.__base: