aboutsummaryrefslogtreecommitdiff
path: root/client.py
diff options
context:
space:
mode:
authorAnthony Wang2024-07-27 16:09:57 -0500
committerAnthony Wang2024-07-27 16:09:57 -0500
commit6cfff24189ffce3b239c1af2cb744a26a07b9177 (patch)
treebbcc91dbe3d2391d50a56bc011b4ee790ae871fc /client.py
parentebef0bf87a22630ea2d5160aaf51051767e92fa6 (diff)
Add symlinks in cwd to results
Diffstat (limited to 'client.py')
-rw-r--r--client.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/client.py b/client.py
index 8c6cbec..4249bcd 100644
--- a/client.py
+++ b/client.py
@@ -3,4 +3,12 @@ import sys
import xmlrpc.client
proxy = xmlrpc.client.ServerProxy(f"http://localhost:{os.environ.get("PORT", 8000)}")
-print("\n".join(proxy.search(sys.argv[1], sys.argv[2])))
+res = proxy.search(sys.argv[1], sys.argv[2])
+print("\n".join(res))
+
+if len(sys.argv) > 3:
+ for path in os.listdir():
+ if path.startswith("res"):
+ os.unlink(path)
+ for i, path in enumerate(res):
+ os.symlink(path, f"res{i}")