Skip to content

Commit 7635b97

Browse files
committed
Append fix for path encoding
1 parent 264110f commit 7635b97

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

scripts/list_apks.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ def main(wf):
1010
arg = wf.args[0].strip()
1111
log.debug(arg)
1212

13-
the_dir = subprocess.check_output(["osascript", "scripts/getFinder.applescript"])
14-
the_dir = the_dir.strip()
15-
log.debug("dir {}".format(the_dir))
16-
arr = os.listdir(the_dir.encode("utf-8"))
13+
the_dir = subprocess.check_output(["osascript", "scripts/getFinder.applescript"]).strip().decode("utf-8")
14+
15+
log.debug("dir")
16+
log.debug(the_dir)
17+
arr = os.listdir(the_dir)
1718

1819
log.debug("length {0}".format(len(arg)))
20+
log.debug("file length {0}".format(len(arr)))
1921
for file in arr:
2022
if file.endswith(".apk"):
21-
fileUtf = file.decode("utf-8")
22-
if len(arg) > 0 and (arg.lower() not in fileUtf.lower()):
23+
log.debug(file)
24+
if len(arg) > 0 and (arg.lower() not in file.lower()):
2325
continue
24-
log.debug("File " + fileUtf)
2526
fullPath = os.path.join(the_dir, file)
26-
# log.debug(fullPath)
2727
wf.add_item(title=file, subtitle=fullPath, uid=file, arg=fullPath, valid=True)
2828
wf.send_feedback()
2929

0 commit comments

Comments
 (0)