From: Bernie Innocenti Date: Sat, 29 Aug 2009 17:56:25 +0000 (+0200) Subject: Allow retrieving the script path X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=ebf4ddefb5f1eaf744c3919ad337b2ff43ff5e2c;p=geekigeeki.git Allow retrieving the script path --- 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] == '/':