aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rwxr-xr-xpython/qm-file-manager.py31
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