summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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'