From 036159de2770b5ca9698474dd15fb63e04a51190 Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Fri, 19 Jun 2020 22:46:41 +0800 Subject: Enhance comments --- git-gmi/gateway.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'git-gmi/gateway.py') diff --git a/git-gmi/gateway.py b/git-gmi/gateway.py index f8c4601..bb7f2e0 100644 --- a/git-gmi/gateway.py +++ b/git-gmi/gateway.py @@ -9,7 +9,8 @@ from os import environ, listdir def handle_cgi_request(path: str, query: str): # intended to work with Jetforce. - # url: gemini://git.gemini.site/cgi-bin/cgi.py/repo/src/static/css/[index.css] + # hypothetical example: + # url: gemini://git.gemini.site/git/cgi/repo/src/static/css/[index.css] # path: /repo/src/static/css/[index.css] # path_trace = ['repo', 'src', 'static', 'css', 'index.css'] path_trace = path[1:].split("/") @@ -29,6 +30,7 @@ def handle_cgi_request(path: str, query: str): if len(path_trace) > 1: view = path_trace[1] # e.g. summary, tree, log else: + # gemini://git.gemini.site/git/cgi// print("31 summary") return @@ -42,10 +44,12 @@ def handle_cgi_request(path: str, query: str): elif view == "tree": if len(path_trace) == 2: + # gemini://git.gemini.site/git/cgi//tree/ print(f"31 {MAIN_BRANCH}/") return if len(path_trace) > 2: + # gemini://git.gemini.site/git/cgi//tree// branch = path_trace[2] location = path_trace[3:] -- cgit v1.2.3