Skip to content

Commit

Permalink
支持 python3.9+
Browse files Browse the repository at this point in the history
  • Loading branch information
CallMeMhz committed Feb 26, 2023
1 parent 10358e7 commit 337e673
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

**支持 Mac OS 12.3 及以上版本。**

**支持 python3.9+** (如果缺少 `six` 请先安装:`pip3 install six`)

**请到 release 页面下载最新的 workflow,双击安装。**

**为了使用方便,请设置取词快捷键。**
Expand Down
5 changes: 3 additions & 2 deletions alfred/plist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 337e673

Please sign in to comment.