From db0a53ea1d6ad9a3adb7826b70fe7e672fc93ca3 Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Wed, 8 Apr 2009 21:41:11 +0200 Subject: [PATCH] New macros needed for wikized EditPage --- macros/CgiVar.py | 7 +++++++ macros/HttpPost.py | 6 ++++++ 2 files changed, 13 insertions(+) create mode 100755 macros/CgiVar.py create mode 100755 macros/HttpPost.py diff --git a/macros/CgiVar.py b/macros/CgiVar.py new file mode 100755 index 0000000..9199514 --- /dev/null +++ b/macros/CgiVar.py @@ -0,0 +1,7 @@ +def _macro_CgiVar(argv): + return { + 'REMOTE_USER': remote_user(), + 'REMOTE_HOST': get_hostname(remote_host()), + 'REMOTE_ADDR': remote_host(), + 'QUERY_STRING': relative_url(query_string()), + }[argv[1]] diff --git a/macros/HttpPost.py b/macros/HttpPost.py new file mode 100755 index 0000000..ce61f79 --- /dev/null +++ b/macros/HttpPost.py @@ -0,0 +1,6 @@ +def _macro_HttpPost(argv): + if argv[1] in form: + return form[argv[1]].value + elif len(argv) > 2: + return argv[2] # default value + return '' -- 2.25.1