diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-10-30 10:23:49 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-10-30 10:37:58 +0100 |
commit | f2bbfe83b4b23e87d8a049a2d698c6576a5bcd8c (patch) | |
tree | 0734cabcfe51036a011e46cd83ae7ac15c5dfa95 /python |
Initial commit
Diffstat (limited to 'python')
-rwxr-xr-x | python/qm-file-manager.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/python/qm-file-manager.py b/python/qm-file-manager.py new file mode 100755 index 0000000..c022d3e --- /dev/null +++ b/python/qm-file-manager.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 + +import os + +def get(url): + print("title %s" % url) + print("add_tab") + + if url != "/": + print("title Go to parent directory") + print("url ..") + print("thumbnail_url folder.png") + print("thumbnail_size 32x32") + print("add_body_item") + + for entry in os.scandir(url): + print("title %s" % entry.path) + print("url %s" % entry.path) + if entry.is_dir(): + print("thumbnail_url folder.png") + else: + print("thumbnail_url file.png") + print("thumbnail_size 32x32") + print("add_body_item") + +action = os.environ["ACTION"] +if action == "get": + get(os.environ["URL"]) +else: + print("error unexpected action %s" % action) + exit(1)
\ No newline at end of file |