summaryrefslogtreecommitdiff
path: root/cron
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2011-01-20 18:27:39 -0600
committerluxagraf <sng@luxagraf.net>2011-01-20 18:27:39 -0600
commitadde8a81c178810eecf8a1836224328fdee9cdd0 (patch)
tree8f032985746d966994c30ffff81d7ed53c53cc27 /cron
parent294820d74fbfa6f54d689084d4fd689a2ad8a1e9 (diff)
added relative paths to cron scripts
Diffstat (limited to 'cron')
-rw-r--r--cron/sync_links.py13
-rw-r--r--cron/sync_photo_sets.py14
-rw-r--r--cron/sync_photos.py14
3 files changed, 24 insertions, 17 deletions
diff --git a/cron/sync_links.py b/cron/sync_links.py
index ba1ee8f..d622bbb 100644
--- a/cron/sync_links.py
+++ b/cron/sync_links.py
@@ -1,10 +1,13 @@
import sys, os
+from os.path import dirname, abspath
-sys.path.append('/home/luxagraf/webapps/django124/luxagraf')
-sys.path.append('/home/luxagraf/webapps/django124/luxagraf/luxagraf')
-sys.path.append('/home/luxagraf/webapps/django124/luxagraf/luxagraf/apps')
-sys.path.append('/home/luxagraf/webapps/django124/luxagraf/luxagraf/lib')
-sys.path.append('/home/luxagraf/webapps/django124/luxagraf/luxagraf/lib/utils')
+PROJECT_ROOT = abspath(dirname(dirname(__file__)))
+
+
+sys.path.append(PROJECT_ROOT)
+sys.path.append(PROJECT_ROOT+'/apps')
+sys.path.append(PROJECT_ROOT+'/lib')
+sys.path.append(PROJECT_ROOT+'/lib/utils')
sys.path.append('/home/luxagraf/webapps/django/lib/python2.6/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
diff --git a/cron/sync_photo_sets.py b/cron/sync_photo_sets.py
index 0b5dcc8..9d3f754 100644
--- a/cron/sync_photo_sets.py
+++ b/cron/sync_photo_sets.py
@@ -1,10 +1,12 @@
-import sys, os
+from os.path import dirname, abspath
-sys.path.append('/home/luxagraf/webapps/django124/luxagraf')
-sys.path.append('/home/luxagraf/webapps/django124/luxagraf/luxagraf')
-sys.path.append('/home/luxagraf/webapps/django124/luxagraf/luxagraf/apps')
-sys.path.append('/home/luxagraf/webapps/django124/luxagraf/luxagraf/lib')
-sys.path.append('/home/luxagraf/webapps/django124/luxagraf/luxagraf/lib/utils')
+PROJECT_ROOT = abspath(dirname(dirname(__file__)))
+
+
+sys.path.append(PROJECT_ROOT)
+sys.path.append(PROJECT_ROOT+'/apps')
+sys.path.append(PROJECT_ROOT+'/lib')
+sys.path.append(PROJECT_ROOT+'/lib/utils')
sys.path.append('/home/luxagraf/webapps/django/lib/python2.6/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
diff --git a/cron/sync_photos.py b/cron/sync_photos.py
index 5d9cfc2..492a986 100644
--- a/cron/sync_photos.py
+++ b/cron/sync_photos.py
@@ -1,10 +1,12 @@
-import sys, os
+from os.path import dirname, abspath
-sys.path.append('/home/luxagraf/webapps/django124/luxagraf')
-sys.path.append('/home/luxagraf/webapps/django124/luxagraf/luxagraf')
-sys.path.append('/home/luxagraf/webapps/django124/luxagraf/luxagraf/apps')
-sys.path.append('/home/luxagraf/webapps/django124/luxagraf/luxagraf/lib')
-sys.path.append('/home/luxagraf/webapps/django124/luxagraf/luxagraf/lib/utils')
+PROJECT_ROOT = abspath(dirname(dirname(__file__)))
+
+
+sys.path.append(PROJECT_ROOT)
+sys.path.append(PROJECT_ROOT+'/apps')
+sys.path.append(PROJECT_ROOT+'/lib')
+sys.path.append(PROJECT_ROOT+'/lib/utils')
sys.path.append('/home/luxagraf/webapps/django/lib/python2.6/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'