Merge lp:~daker/loco-team-portal/fix-python-path into lp:loco-team-portal

Proposed by Adnane Belmadiaf on 2012-08-19
Status: Merged
Approved by: Michael Hall on 2012-08-19
Approved revision: 546
Merged at revision: 546
Proposed branch: lp:~daker/loco-team-portal/fix-python-path
Merge into: lp:loco-team-portal
Diff against target: 46 lines (+4/-3)
3 files modified
loco_directory/common/management/commands/init.py (+1/-1)
loco_directory/teams/management/commands/import-translations.py (+1/-1)
loco_directory/teams/management/commands/update-template.py (+2/-1)
To merge this branch: bzr merge lp:~daker/loco-team-portal/fix-python-path
Reviewer Review Type Date Requested Status
Michael Hall (community) 2012-08-19 Approve on 2012-08-19
Review via email: mp+120276@code.launchpad.net

Commit Message

Fix python path to work with virtualenv

To post a comment you must log in.
Michael Hall (mhall119) wrote :

Looks good, pleia2 confirmed that it works

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loco_directory/common/management/commands/init.py'
2--- loco_directory/common/management/commands/init.py 2012-07-04 23:31:45 +0000
3+++ loco_directory/common/management/commands/init.py 2012-08-19 01:22:21 +0000
4@@ -19,7 +19,7 @@
5 def handle_noargs(self, **options):
6
7 log.info("Compiling messages.")
8- subprocess.call(["python", "manage.py", "compilemessages"])
9+ subprocess.call([sys.executable, "manage.py", "compilemessages"])
10
11 (lc, new_object) = Group.objects.get_or_create(name="ubuntu-lococouncil")
12 if new_object:
13
14=== modified file 'loco_directory/teams/management/commands/import-translations.py'
15--- loco_directory/teams/management/commands/import-translations.py 2009-12-23 10:35:20 +0000
16+++ loco_directory/teams/management/commands/import-translations.py 2012-08-19 01:22:21 +0000
17@@ -27,7 +27,7 @@
18 pwd = os.getcwd()
19 os.chdir(settings.PROJECT_PATH)
20 print settings.PROJECT_PATH
21- subprocess.call(["./manage.py", "makemessages", "-l", locale[0]])
22+ subprocess.call([sys.executable, "manage.py", "makemessages", "-l", locale[0]])
23 os.chdir(pwd)
24 subprocess.call(["cp", pofile,
25 os.path.join(project_locale_path,
26
27=== modified file 'loco_directory/teams/management/commands/update-template.py'
28--- loco_directory/teams/management/commands/update-template.py 2012-06-01 21:00:57 +0000
29+++ loco_directory/teams/management/commands/update-template.py 2012-08-19 01:22:21 +0000
30@@ -5,6 +5,7 @@
31
32 import subprocess
33 import os
34+import sys
35
36 from django.conf import settings
37
38@@ -20,7 +21,7 @@
39 def update_template():
40 pwd = os.getcwd()
41 os.chdir(settings.PROJECT_PATH)
42- subprocess.call(["./manage.py", "makemessages", "-l", DUMMY_LOCALE])
43+ subprocess.call([sys.executable, "manage.py", "makemessages", "-l", DUMMY_LOCALE])
44 project_locale_path = os.path.join(settings.PROJECT_PATH, "locale")
45 os.rename(os.path.join(project_locale_path,
46 "%s/LC_MESSAGES/django.po" % DUMMY_LOCALE),

Subscribers

People subscribed via source and target branches