Merge lp:~dholbach/harvest/656217 into lp:harvest

Proposed by Daniel Holbach
Status: Merged
Approved by: James Westby
Approved revision: 265
Merged at revision: 272
Proposed branch: lp:~dholbach/harvest/656217
Merge into: lp:harvest
Diff against target: 92 lines (+11/-7)
6 files modified
harvest/common/launchpad.py (+1/-3)
harvest/common/opportunity_lists.py (+3/-1)
harvest/opportunities/management/commands/import-translations.py (+1/-1)
harvest/opportunities/management/commands/update-template.py (+1/-1)
harvest/opportunities/management/commands/updatelists.py (+1/-1)
harvest/settings.py (+4/-0)
To merge this branch: bzr merge lp:~dholbach/harvest/656217
Reviewer Review Type Date Requested Status
James Westby Approve
Review via email: mp+37935@code.launchpad.net
To post a comment you must log in.
lp:~dholbach/harvest/656217 updated
265. By Daniel Holbach

define paths in settings.py

Revision history for this message
James Westby (james-w) :
review: Approve
Revision history for this message
Dylan McCall (dylanmccall) wrote :

Do we need to worry about local_settings.py changing PROJECT_PATH?
If we do you'll want to move those new variables in settings.py down, below “from local_settings import *” (line 147).

Revision history for this message
Daniel Holbach (dholbach) wrote :

> Do we need to worry about local_settings.py changing PROJECT_PATH?
> If we do you'll want to move those new variables in settings.py down, below
> “from local_settings import *” (line 147).

I think it's fine if they get overridden in local_settings.py - it should be the only place where variables are changed.

Revision history for this message
Daniel Holbach (dholbach) wrote :

Does this resolve all open questions?

Revision history for this message
Daniel Holbach (dholbach) wrote :

I suggest I merge this now and you file a bug report if you expect a different behaviour.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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:58 +0000
@@ -2,14 +2,12 @@
22
3from django.conf import settings3from django.conf import settings
44
5import os
6
7def lp_login(lp_instance=EDGE_SERVICE_ROOT):5def lp_login(lp_instance=EDGE_SERVICE_ROOT):
8 """6 """
9 Return a logged in Launchpad object. 7 Return a logged in Launchpad object.
10 """8 """
119
12 cachedir = os.path.join(settings.PROJECT_PATH, 'lp_data/cache')10 cachedir = settings.CACHE_PATH
13 client_ident = getattr(settings, 'LP_PROJECT_NAME', "Harvest")11 client_ident = getattr(settings, 'LP_PROJECT_NAME', "Harvest")
14 try:12 try:
15 launchpad = Launchpad.login_anonymously(client_ident, lp_instance, cachedir)13 launchpad = Launchpad.login_anonymously(client_ident, lp_instance, cachedir)
1614
=== 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:58 +0000
@@ -1,5 +1,7 @@
1LIST_BRANCH_URL = "lp:harvest-data"1LIST_BRANCH_URL = "lp:harvest-data"
22
3from django.conf import settings
4
3import csv5import csv
4import os6import os
57
@@ -56,7 +58,7 @@
5658
5759
58def pull_lists(data_dir):60def pull_lists(data_dir):
59 list_dir = os.path.join(data_dir, "lists")61 list_dir = settings.LIST_PATH
60 if not os.path.exists(list_dir):62 if not os.path.exists(list_dir):
61 os.system("cd %s; bzr checkout %s lists -q" % (data_dir, LIST_BRANCH_URL))63 os.system("cd %s; bzr checkout %s lists -q" % (data_dir, LIST_BRANCH_URL))
62 else:64 else:
6365
=== 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:58 +0000
@@ -21,7 +21,7 @@
21 locale = re.findall("^%s-(.*).po$" % APP_NAME, os.path.basename(pofile))21 locale = re.findall("^%s-(.*).po$" % APP_NAME, os.path.basename(pofile))
22 if not locale:22 if not locale:
23 return False23 return False
24 project_locale_path = os.path.join(settings.PROJECT_PATH, "locale", locale[0])24 project_locale_path = os.path.join(settings.LOCALE_PATH, locale[0])
25 if not os.path.exists(project_locale_path) or \25 if not os.path.exists(project_locale_path) or \
26 not os.path.isdir(project_locale_path):26 not os.path.isdir(project_locale_path):
27 pwd = os.getcwd()27 pwd = os.getcwd()
2828
=== 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:58 +0000
@@ -18,7 +18,7 @@
18 pwd = os.getcwd()18 pwd = os.getcwd()
19 os.chdir(settings.PROJECT_PATH)19 os.chdir(settings.PROJECT_PATH)
20 subprocess.call(["./manage.py", "makemessages", "-l", DUMMY_LOCALE])20 subprocess.call(["./manage.py", "makemessages", "-l", DUMMY_LOCALE])
21 project_locale_path = os.path.join(settings.PROJECT_PATH, "locale")21 project_locale_path = settings.LOCALE_PATH
22 os.rename(os.path.join(project_locale_path, 22 os.rename(os.path.join(project_locale_path,
23 "%s/LC_MESSAGES/django.po" % DUMMY_LOCALE),23 "%s/LC_MESSAGES/django.po" % DUMMY_LOCALE),
24 os.path.join(project_locale_path, "%s.pot" % APP_NAME))24 os.path.join(project_locale_path, "%s.pot" % APP_NAME))
2525
=== 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:58 +0000
@@ -14,7 +14,7 @@
14 help = "Pull opportunity lists and update them in the DB."14 help = "Pull opportunity lists and update them in the DB."
1515
16 def update_lists(self):16 def update_lists(self):
17 data_dir = os.path.join(settings.PROJECT_PATH, "data")17 data_dir = settings.DATA_PATH
18 if not os.path.exists(data_dir):18 if not os.path.exists(data_dir):
19 os.makedirs(data_dir)19 os.makedirs(data_dir)
20 list_dir = opportunity_lists.pull_lists(data_dir)20 list_dir = opportunity_lists.pull_lists(data_dir)
2121
=== modified file 'harvest/settings.py'
--- harvest/settings.py 2010-08-31 23:49:08 +0000
+++ harvest/settings.py 2010-10-08 08:07:58 +0000
@@ -1,5 +1,9 @@
1import os1import os
2PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))2PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
3LOCALE_PATH = os.path.join(PROJECT_PATH, "locale")
4DATA_PATH = os.path.join(PROJECT_PATH, "data")
5LIST_PATH = os.path.join(DATA_PATH, "lists")
6CACHE_PATH = os.path.join(PROJECT_PATH, "lp_data/cache")
37
4# Django settings for harvest project.8# Django settings for harvest project.
59

Subscribers

People subscribed via source and target branches

to all changes: