From ebf4ddefb5f1eaf744c3919ad337b2ff43ff5e2c Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Sat, 29 Aug 2009 19:56:25 +0200 Subject: [PATCH] Allow retrieving the script path --- geekigeeki.conf.py | 4 ++-- geekigeeki.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/geekigeeki.conf.py b/geekigeeki.conf.py index ab0e430..26e9a30 100644 --- a/geekigeeki.conf.py +++ b/geekigeeki.conf.py @@ -32,7 +32,7 @@ link_urls = [ history_url = '../wikigit/wiki.git' -post_edit_hook = './post_edit_hook.sh' +post_edit_hook = os.path.join(script_path(), 'post_edit_hook.sh') datetime_fmt = '%a, %d %b %Y %H:%M:%S %Z' @@ -43,4 +43,4 @@ nonexist_pfx = '' image_maxwidth = 400 # Set to True for CGI var dump -#debug_cgi = True +debug_cgi = False diff --git a/geekigeeki.py b/geekigeeki.py index 94439ab..5b26b55 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -36,6 +36,9 @@ def config_get(key, default=None): def script_name(): return os.environ.get('SCRIPT_NAME', '') +def script_path(): + return os.path.split(os.environ.get('SCRIPT_FILENAME', ''))[0] + def query_string(): path_info = os.environ.get('PATH_INFO', '') if len(path_info) and path_info[0] == '/': -- 2.25.1