Merge lp:~dholbach/loco-team-portal/init into lp:loco-team-portal

Proposed by Daniel Holbach
Status: Superseded
Proposed branch: lp:~dholbach/loco-team-portal/init
Merge into: lp:loco-team-portal
Diff against target: 78 lines (+33/-8)
2 files modified
INSTALL (+2/-6)
loco_directory/teams/management/commands/init-ld.py (+31/-2)
To merge this branch: bzr merge lp:~dholbach/loco-team-portal/init
Reviewer Review Type Date Requested Status
LoCo Team Portal Developers Pending
Review via email: mp+17660@code.launchpad.net

This proposal has been superseded by a proposal from 2010-01-19.

To post a comment you must log in.
lp:~dholbach/loco-team-portal/init updated
47. By Daniel Holbach

update instructions again

48. By Daniel Holbach

check if settings.py and settings.py.sample do exist, simplify jquery* link creation and package check

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'INSTALL'
2--- INSTALL 2010-01-18 15:11:42 +0000
3+++ INSTALL 2010-01-19 16:57:13 +0000
4@@ -8,18 +8,14 @@
5 - sudo -u postgres createdb -O postgres loco_directory
6
7 Generally:
8- - sudo apt-get install python-django python-launchpadlib libjs-jquery-ui
9- - install python-django-openid-auth from karmic or from:
10- http://archive.ubuntu.com/ubuntu/pool/universe/p/python-django-openid-auth/
11+ - sudo apt-get install python-django python-launchpadlib libjs-jquery-ui python-django-openid-auth
12 - cd loco_directory
13 - cp settings.py.sample settings.py
14- - ln -s /usr/share/javascript/jquery media/jquery
15- - ln -s /usr/share/javascript/jquery-ui media/jquery-ui
16+# edit settings.py and set DATABASE_USER, DATABASE_PASSWORD, SECRET_KEY
17 ** Karmic users must also do the following:
18 - sudo ln -s /usr/share/javascript/jquery-ui/jquery-ui-1.7.1.custom.min.js /usr/share/javascript/jquery-ui/jquery-ui.js
19 - sudo ln -s /usr/share/javascript/jquery-ui/css/css/smoothness /usr/share/javascript/jquery-ui/css/smoothness
20 - sudo ln -s /usr/share/javascript/jquery-ui/css/smoothness/jquery-ui-1.7.1.custom.css /usr/share/javascript/jquery-ui/css/smoothness/jquery-ui.css
21-# edit settings.py and set DATABASE_USER, DATABASE_PASSWORD, SECRET_KEY
22 - ./manage.py syncdb
23 - ./manage.py init-ld
24 - ./manage.py lpupdate
25
26=== modified file 'loco_directory/teams/management/commands/init-ld.py'
27--- loco_directory/teams/management/commands/init-ld.py 2010-01-18 15:24:59 +0000
28+++ loco_directory/teams/management/commands/init-ld.py 2010-01-19 16:57:13 +0000
29@@ -7,18 +7,47 @@
30 import settings
31
32 import subprocess
33+import os
34
35 class Command(NoArgsCommand):
36 help = "Make sure the LoCo Directory is set up properly."
37
38 def handle_noargs(self, **options):
39- print "Compiling messages."
40+ print " * Compiling messages."
41 subprocess.call(["./manage.py", "compilemessages"])
42
43- print "Checking if LoCo Council is in Auth teams:",
44+ print " * Checking if LoCo Council is in Auth teams:",
45 (lc, new_object) = Group.objects.get_or_create(name="ubuntu-lococouncil")
46 if new_object:
47 lc.save()
48 print "added."
49 else:
50 print "yes."
51+
52+ print " * Creating jquery symlinks:",
53+ updated = False
54+ path = settings.PROJECT_PATH
55+ javascript_dir = "/usr/share/javascript"
56+ media_dir = os.path.join(path, "media")
57+ link_mapping = [("libjs-jquery", "jquery"),
58+ ("libjs-jquery-ui", "jquery-ui")]
59+ for (package, pathname) in link_mapping:
60+ src = os.path.join(javascript_dir, pathname)
61+ if not os.path.exists(src):
62+ print >> sys.stderr, "Please install the %s package." % package
63+ sys.exit(1)
64+ dest = os.path.join(media_dir, pathname)
65+ if not os.path.exists(dest):
66+ os.symlink(src, dest)
67+ updated = True
68+ if updated:
69+ print "updated."
70+ else:
71+ print "not necessary."
72+
73+ if os.path.exists(os.path.join(path, "settings.py.sample")) and \
74+ os.path.exists(os.path.join(path, "settings.py")):
75+ print " * Showing diff between settings.py.sample and settings.py."
76+ subprocess.call(["diff", "-u",
77+ os.path.join(path, "settings.py.sample"),
78+ os.path.join(path, "settings.py")])

Subscribers

People subscribed via source and target branches