From 7d88b20d02c6e24216de2af6d71caafd310e23de Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Wed, 13 Oct 2010 11:16:54 +0100 Subject: [PATCH] Update script executions to use realpath instead of abspath This allows scripts to be executed via symlinks and still work --- extract-emails.py | 2 +- run-cron.py | 2 +- update-directors.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extract-emails.py b/extract-emails.py index f56c540..fe3b456 100755 --- a/extract-emails.py +++ b/extract-emails.py @@ -7,7 +7,7 @@ import os os.nice(20) # Activate the virtualenv -path = os.path.dirname(os.path.abspath( __file__ )) +path = os.path.dirname(os.path.realpath( __file__ )) activate_this = os.path.join(path, 'env/bin/activate_this.py') execfile(activate_this, dict(__file__=activate_this)) diff --git a/run-cron.py b/run-cron.py index 5a26e08..ba68678 100755 --- a/run-cron.py +++ b/run-cron.py @@ -4,7 +4,7 @@ import os # Activate the virtualenv -path = os.path.dirname(os.path.abspath( __file__ )) +path = os.path.dirname(os.path.realpath( __file__ )) os.chdir(path) activate_this = os.path.join(path, 'env/bin/activate_this.py') execfile(activate_this, dict(__file__=activate_this)) diff --git a/update-directors.py b/update-directors.py index b56e86d..76cce57 100755 --- a/update-directors.py +++ b/update-directors.py @@ -7,7 +7,7 @@ import os os.nice(20) # Activate the virtualenv -path = os.path.dirname(os.path.abspath( __file__ )) +path = os.path.dirname(os.path.realpath( __file__ )) activate_this = os.path.join(path, 'env/bin/activate_this.py') execfile(activate_this, dict(__file__=activate_this))