harvest-dev team mailing list archive
-
harvest-dev team
-
Mailing list archive
-
Message #00410
[Merge] lp:~dholbach/harvest/656217 into lp:harvest
Daniel Holbach has proposed merging lp:~dholbach/harvest/656217 into lp:harvest.
Requested reviews:
harvest-dev (harvest-dev)
Related bugs:
#656217 define all paths in settings.py (or local_settings.py)
https://bugs.launchpad.net/bugs/656217
--
https://code.launchpad.net/~dholbach/harvest/656217/+merge/37935
Your team harvest-dev is requested to review the proposed merge of lp:~dholbach/harvest/656217 into lp:harvest.
=== modified file 'harvest/common/launchpad.py'
--- harvest/common/launchpad.py 2010-09-01 11:24:39 +0000
+++ harvest/common/launchpad.py 2010-10-08 08:07:45 +0000
@@ -2,14 +2,12 @@
from django.conf import settings
-import os
-
def lp_login(lp_instance=EDGE_SERVICE_ROOT):
"""
Return a logged in Launchpad object.
"""
- cachedir = os.path.join(settings.PROJECT_PATH, 'lp_data/cache')
+ cachedir = settings.CACHE_PATH
client_ident = getattr(settings, 'LP_PROJECT_NAME', "Harvest")
try:
launchpad = Launchpad.login_anonymously(client_ident, lp_instance, cachedir)
=== modified file 'harvest/common/opportunity_lists.py'
--- harvest/common/opportunity_lists.py 2010-08-03 16:29:47 +0000
+++ harvest/common/opportunity_lists.py 2010-10-08 08:07:45 +0000
@@ -1,5 +1,7 @@
LIST_BRANCH_URL = "lp:harvest-data"
+from django.conf import settings
+
import csv
import os
@@ -56,7 +58,7 @@
def pull_lists(data_dir):
- list_dir = os.path.join(data_dir, "lists")
+ list_dir = settings.LIST_PATH
if not os.path.exists(list_dir):
os.system("cd %s; bzr checkout %s lists -q" % (data_dir, LIST_BRANCH_URL))
else:
=== modified file 'harvest/opportunities/management/commands/import-translations.py'
--- harvest/opportunities/management/commands/import-translations.py 2010-03-02 10:38:05 +0000
+++ harvest/opportunities/management/commands/import-translations.py 2010-10-08 08:07:45 +0000
@@ -21,7 +21,7 @@
locale = re.findall("^%s-(.*).po$" % APP_NAME, os.path.basename(pofile))
if not locale:
return False
- project_locale_path = os.path.join(settings.PROJECT_PATH, "locale", locale[0])
+ project_locale_path = os.path.join(settings.LOCALE_PATH, locale[0])
if not os.path.exists(project_locale_path) or \
not os.path.isdir(project_locale_path):
pwd = os.getcwd()
=== modified file 'harvest/opportunities/management/commands/update-template.py'
--- harvest/opportunities/management/commands/update-template.py 2010-06-01 06:40:02 +0000
+++ harvest/opportunities/management/commands/update-template.py 2010-10-08 08:07:45 +0000
@@ -18,7 +18,7 @@
pwd = os.getcwd()
os.chdir(settings.PROJECT_PATH)
subprocess.call(["./manage.py", "makemessages", "-l", DUMMY_LOCALE])
- project_locale_path = os.path.join(settings.PROJECT_PATH, "locale")
+ project_locale_path = settings.LOCALE_PATH
os.rename(os.path.join(project_locale_path,
"%s/LC_MESSAGES/django.po" % DUMMY_LOCALE),
os.path.join(project_locale_path, "%s.pot" % APP_NAME))
=== modified file 'harvest/opportunities/management/commands/updatelists.py'
--- harvest/opportunities/management/commands/updatelists.py 2010-08-03 16:29:47 +0000
+++ harvest/opportunities/management/commands/updatelists.py 2010-10-08 08:07:45 +0000
@@ -14,7 +14,7 @@
help = "Pull opportunity lists and update them in the DB."
def update_lists(self):
- data_dir = os.path.join(settings.PROJECT_PATH, "data")
+ data_dir = settings.DATA_PATH
if not os.path.exists(data_dir):
os.makedirs(data_dir)
list_dir = opportunity_lists.pull_lists(data_dir)
=== modified file 'harvest/settings.py'
--- harvest/settings.py 2010-08-31 23:49:08 +0000
+++ harvest/settings.py 2010-10-08 08:07:45 +0000
@@ -1,5 +1,9 @@
import os
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
+LOCALE_PATH = os.path.join(PROJECT_PATH, "locale")
+DATA_PATH = os.path.join(PROJECT_PATH, "data")
+LIST_PATH = os.path.join(DATA_PATH, "lists")
+CACHE_PATH = os.path.join(PROJECT_PATH, "lp_data/cache")
# Django settings for harvest project.