Merge lp:~michael.nelson/launchpad/470181-ppa-inline-style into lp:launchpad/db-devel

Proposed by Michael Nelson
Status: Merged
Approved by: Michael Nelson
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~michael.nelson/launchpad/470181-ppa-inline-style
Merge into: lp:launchpad/db-devel
Diff against target: 607 lines (+268/-38)
11 files modified
Makefile (+3/-1)
lib/canonical/launchpad/webapp/publisher.py (+0/-16)
lib/devscripts/ec2test/instance.py (+19/-4)
lib/devscripts/ec2test/tests/test_ec2instance.py (+185/-0)
lib/lp/code/model/directbranchcommit.py (+17/-3)
lib/lp/code/tests/test_directbranchcommit.py (+1/-1)
lib/lp/soyuz/templates/archive-index.pt (+1/-1)
lib/lp/translations/doc/translations-export-to-branch.txt (+11/-3)
lib/lp/translations/scripts/translations_to_branch.py (+13/-6)
lib/lp/translations/utilities/gettext_po_exporter.py (+15/-2)
utilities/rocketfuel-setup (+3/-1)
To merge this branch: bzr merge lp:~michael.nelson/launchpad/470181-ppa-inline-style
Reviewer Review Type Date Requested Status
Abel Deuring (community) Approve
Review via email: mp+15325@code.launchpad.net

Commit message

Fixes bug 470181 by adding a missing class required for correct styling of the inline text area editor.

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

= Summary =

This is a fix for bug 470181.

I'm not 100%, but it seems as though since we integrated the multiline editor on the PPA index page, a subsequent requirement has been added (via lazr-js) of a lazr-multiline-edit class.

This branch simply adds that class to fix the bug.

== Demo and Q/A ==

View https://launchpad.dev/~cprov/+archive/ppa before merging this branch to see the issue (or view a ppa on edge).

Then reload the same page after merging to see it fixed.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/soyuz/templates/archive-index.pt

Revision history for this message
Abel Deuring (adeuring) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile'
--- Makefile 2009-11-17 20:43:28 +0000
+++ Makefile 2009-11-27 16:21:25 +0000
@@ -335,6 +335,8 @@
335launchpad.pot:335launchpad.pot:
336 bin/i18nextract.py336 bin/i18nextract.py
337337
338# Called by the rocketfuel-setup script. You probably don't want to run this
339# on its own.
338install: reload-apache340install: reload-apache
339341
340copy-certificates:342copy-certificates:
@@ -353,7 +355,7 @@
353 a2ensite local-launchpad355 a2ensite local-launchpad
354356
355reload-apache: enable-apache-launchpad357reload-apache: enable-apache-launchpad
356 /etc/init.d/apache2 reload358 /etc/init.d/apache2 restart
357359
358static:360static:
359 $(PY) scripts/make-static.py361 $(PY) scripts/make-static.py
360362
=== modified file 'lib/canonical/launchpad/webapp/publisher.py'
--- lib/canonical/launchpad/webapp/publisher.py 2009-11-14 22:44:07 +0000
+++ lib/canonical/launchpad/webapp/publisher.py 2009-11-27 16:21:25 +0000
@@ -38,8 +38,6 @@
38from zope.security.checker import ProxyFactory, NamesChecker38from zope.security.checker import ProxyFactory, NamesChecker
39from zope.traversing.browser.interfaces import IAbsoluteURL39from zope.traversing.browser.interfaces import IAbsoluteURL
4040
41from canonical.cachedproperty import cachedproperty
42from canonical.config import config
43from canonical.launchpad.layers import setFirstLayer, WebServiceLayer41from canonical.launchpad.layers import setFirstLayer, WebServiceLayer
44from canonical.launchpad.webapp.vhosts import allvhosts42from canonical.launchpad.webapp.vhosts import allvhosts
45from canonical.launchpad.webapp.interfaces import (43from canonical.launchpad.webapp.interfaces import (
@@ -232,7 +230,6 @@
232 many templates not set via zcml, or you want to do230 many templates not set via zcml, or you want to do
233 rendering from Python.231 rendering from Python.
234 - isBetaUser <-- whether the logged-in user is a beta tester232 - isBetaUser <-- whether the logged-in user is a beta tester
235 - striped_class<-- a tr class for an alternating row background
236 """233 """
237234
238 def __init__(self, context, request):235 def __init__(self, context, request):
@@ -285,19 +282,6 @@
285 else:282 else:
286 return self.render()283 return self.render()
287284
288 @cachedproperty
289 def striped_class(self):
290 """Return a generator which yields alternating CSS classes.
291
292 This is to be used for HTML tables in which the row colors should be
293 alternated.
294 """
295 def bg_stripe_generator():
296 while True:
297 yield 'white'
298 yield 'shaded'
299 return bg_stripe_generator()
300
301 def _getErrorMessage(self):285 def _getErrorMessage(self):
302 """Property getter for `error_message`."""286 """Property getter for `error_message`."""
303 return self._error_message287 return self._error_message
304288
=== modified file 'lib/devscripts/ec2test/instance.py'
--- lib/devscripts/ec2test/instance.py 2009-11-23 02:36:18 +0000
+++ lib/devscripts/ec2test/instance.py 2009-11-27 16:21:25 +0000
@@ -19,11 +19,9 @@
19import traceback19import traceback
2020
21from bzrlib.errors import BzrCommandError21from bzrlib.errors import BzrCommandError
22from bzrlib.plugins.launchpad.account import get_lp_login
2322
24import paramiko23import paramiko
2524
26from devscripts.ec2test.credentials import EC2Credentials
27from devscripts.ec2test.session import EC2SessionName25from devscripts.ec2test.session import EC2SessionName
2826
2927
@@ -194,6 +192,17 @@
194 to allow access to the instance.192 to allow access to the instance.
195 :param credentials: An `EC2Credentials` object.193 :param credentials: An `EC2Credentials` object.
196 """194 """
195 # This import breaks in the test environment. Do it here so
196 # that unit tests (which don't use this factory) can still
197 # import EC2Instance.
198 from bzrlib.plugins.launchpad.account import get_lp_login
199
200 # XXX JeroenVermeulen 2009-11-27 bug=489073: EC2Credentials
201 # imports boto, which isn't necessarily installed in our test
202 # environment. Doing the import here so that unit tests (which
203 # don't use this factory) can still import EC2Instance.
204 from devscripts.ec2test.credentials import EC2Credentials
205
197 assert isinstance(name, EC2SessionName)206 assert isinstance(name, EC2SessionName)
198 if instance_type not in AVAILABLE_INSTANCE_TYPES:207 if instance_type not in AVAILABLE_INSTANCE_TYPES:
199 raise ValueError('unknown instance_type %s' % (instance_type,))208 raise ValueError('unknown instance_type %s' % (instance_type,))
@@ -388,6 +397,10 @@
388 self._ensure_ec2test_user_has_keys()397 self._ensure_ec2test_user_has_keys()
389 return self._connect('ec2test')398 return self._connect('ec2test')
390399
400 def _report_traceback(self):
401 """Print traceback."""
402 traceback.print_exc()
403
391 def set_up_and_run(self, postmortem, shutdown, func, *args, **kw):404 def set_up_and_run(self, postmortem, shutdown, func, *args, **kw):
392 """Start, run `func` and then maybe shut down.405 """Start, run `func` and then maybe shut down.
393406
@@ -405,16 +418,17 @@
405 # We ignore the value of the 'shutdown' argument and always shut down418 # We ignore the value of the 'shutdown' argument and always shut down
406 # unless `func` returns normally.419 # unless `func` returns normally.
407 really_shutdown = True420 really_shutdown = True
421 retval = None
408 try:422 try:
409 self.start()423 self.start()
410 try:424 try:
411 return func(*args, **kw)425 retval = func(*args, **kw)
412 except Exception:426 except Exception:
413 # When running in postmortem mode, it is really helpful to see427 # When running in postmortem mode, it is really helpful to see
414 # if there are any exceptions before it waits in the console428 # if there are any exceptions before it waits in the console
415 # (in the finally block), and you can't figure out why it's429 # (in the finally block), and you can't figure out why it's
416 # broken.430 # broken.
417 traceback.print_exc()431 self._report_traceback()
418 else:432 else:
419 really_shutdown = shutdown433 really_shutdown = shutdown
420 finally:434 finally:
@@ -427,6 +441,7 @@
427 finally:441 finally:
428 if really_shutdown:442 if really_shutdown:
429 self.shutdown()443 self.shutdown()
444 return retval
430445
431 def _copy_single_file(self, sftp, local_path, remote_dir):446 def _copy_single_file(self, sftp, local_path, remote_dir):
432 """Copy `local_path` to `remote_dir` on this instance.447 """Copy `local_path` to `remote_dir` on this instance.
433448
=== added file 'lib/devscripts/ec2test/tests/test_ec2instance.py'
--- lib/devscripts/ec2test/tests/test_ec2instance.py 1970-01-01 00:00:00 +0000
+++ lib/devscripts/ec2test/tests/test_ec2instance.py 2009-11-27 16:21:25 +0000
@@ -0,0 +1,185 @@
1# Copyright 2009 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3# pylint: disable-msg=E0702
4
5"""Test handling of EC2 machine images."""
6
7__metaclass__ = type
8
9from unittest import TestCase, TestLoader
10
11from devscripts.ec2test.instance import EC2Instance
12
13
14class Stub:
15 """Generic recipient of invocations.
16
17 Use this to:
18 - Stub methods that should do nothing.
19 - Inject failures into methods.
20 - Record whether a method is being called.
21 """
22 # XXX JeroenVermeulen 2009-11-26: This probably exists somewhere
23 # already. Or if not, maybe it should. But with a name that won't
24 # turn Stuart Bishop's IRC client into a disco simulator.
25
26 call_count = 0
27
28 def __init__(self, return_value=None, simulated_failure=None):
29 """Define what to do when this stub gets invoked.
30
31 :param return_value: Something to return from the invocation.
32 :parma simulated_failure: Something to raise in the invocation.
33 """
34 assert return_value is None or simulated_failure is None, (
35 "Stub can raise an exception or return a value, but not both.")
36 self.return_value = return_value
37 self.simulated_failure = simulated_failure
38
39 def __call__(self, *args, **kwargs):
40 """Catch a call.
41
42 Records the fact that an invocation was made in
43 `call_count`.
44
45 If you passed a `simulated_failure` to the constructor, that
46 object is raised.
47
48 :return: The `return_value` you passed to the constructor.
49 """
50 self.call_count += 1
51
52 if self.simulated_failure is not None:
53 raise self.simulated_failure
54
55 return self.return_value
56
57
58class FakeAccount:
59 """Helper for setting up an `EC2Instance` without EC2."""
60 acquire_private_key = Stub()
61 acquire_security_group = Stub()
62
63
64class FakeOutput:
65 """Pretend stdout/stderr output from EC2 instance."""
66 output = "Fake output."
67
68
69class FakeBotoInstance:
70 """Helper for setting up an `EC2Instance` without EC2."""
71 id = 0
72 state = 'running'
73 public_dns_name = 'fake-instance'
74
75 update = Stub()
76 stop = Stub()
77 get_console_output = FakeOutput
78
79
80class FakeReservation:
81 """Helper for setting up an `EC2Instance` without EC2."""
82 def __init__(self):
83 self.instances = [FakeBotoInstance()]
84
85
86class FakeImage:
87 """Helper for setting up an `EC2Instance` without EC2."""
88 run = Stub(return_value=FakeReservation())
89
90
91class FakeFailure(Exception):
92 """A pretend failure from the test runner."""
93
94
95class TestEC2Instance(TestCase):
96 """Test running of an `EC2Instance` without EC2."""
97
98 def _makeInstance(self):
99 """Set up an `EC2Instance`, with stubbing where needed.
100
101 `EC2Instance.shutdown` is replaced with a `Stub`, so check its
102 call_count to see whether it's been invoked.
103 """
104 session_name = None
105 image = FakeImage()
106 instance_type = 'c1.xlarge'
107 demo_networks = None
108 account = FakeAccount()
109 from_scratch = None
110 user_key = None
111 login = None
112
113 instance = EC2Instance(
114 session_name, image, instance_type, demo_networks, account,
115 from_scratch, user_key, login)
116
117 instance.shutdown = Stub()
118 instance._report_traceback = Stub()
119 instance.log = Stub()
120
121 return instance
122
123 def _runInstance(self, instance, runnee=None, headless=False):
124 """Set up and run an `EC2Instance` (but without EC2)."""
125 if runnee is None:
126 runnee = Stub()
127
128 instance.set_up_and_run(False, not headless, runnee)
129
130 def test_EC2Instance_test_baseline(self):
131 # The EC2 instances we set up have neither started nor been shut
132 # down. After running, they have started.
133 # Not a very useful test, except it establishes the basic
134 # assumptions for the other tests.
135 instance = self._makeInstance()
136 runnee = Stub()
137
138 self.assertEqual(0, runnee.call_count)
139 self.assertEqual(0, instance.shutdown.call_count)
140
141 self._runInstance(instance, runnee=runnee)
142
143 self.assertEqual(1, runnee.call_count)
144
145 def test_set_up_and_run_headful(self):
146 # A non-headless run executes all tests in the instance, then
147 # shuts down.
148 instance = self._makeInstance()
149
150 self._runInstance(instance, headless=False)
151
152 self.assertEqual(1, instance.shutdown.call_count)
153
154 def test_set_up_and_run_headless(self):
155 # An asynchronous, headless run kicks off the tests on the
156 # instance but does not shut it down.
157 instance = self._makeInstance()
158
159 self._runInstance(instance, headless=True)
160
161 self.assertEqual(0, instance.shutdown.call_count)
162
163 def test_set_up_and_run_headful_failure(self):
164 # If the test runner barfs, the instance swallows the exception
165 # and shuts down.
166 instance = self._makeInstance()
167 runnee = Stub(simulated_failure=FakeFailure("Headful barfage."))
168
169 self._runInstance(instance, runnee=runnee, headless=False)
170
171 self.assertEqual(1, instance.shutdown.call_count)
172
173 def test_set_up_and_run_headless_failure(self):
174 # If the instance's test runner fails to set up for a headless
175 # run, the instance swallows the exception and shuts down.
176 instance = self._makeInstance()
177 runnee = Stub(simulated_failure=FakeFailure("Headless boom."))
178
179 self._runInstance(instance, runnee=runnee, headless=True)
180
181 self.assertEqual(1, instance.shutdown.call_count)
182
183
184def test_suite():
185 return TestLoader().loadTestsFromName(__name__)
0186
=== modified file 'lib/lp/code/model/directbranchcommit.py'
--- lib/lp/code/model/directbranchcommit.py 2009-09-09 20:03:19 +0000
+++ lib/lp/code/model/directbranchcommit.py 2009-11-27 16:21:25 +0000
@@ -74,6 +74,8 @@
74 self.db_branch = db_branch74 self.db_branch = db_branch
75 self.to_mirror = to_mirror75 self.to_mirror = to_mirror
7676
77 self.last_scanned_id = self.db_branch.last_scanned_id
78
77 if committer is None:79 if committer is None:
78 committer = db_branch.owner80 committer = db_branch.owner
79 self.committer = committer81 self.committer = committer
@@ -172,12 +174,18 @@
172 assert self.is_locked, "Getting revision on un-locked branch."174 assert self.is_locked, "Getting revision on un-locked branch."
173 last_revision = None175 last_revision = None
174 last_revision = self.bzrbranch.last_revision()176 last_revision = self.bzrbranch.last_revision()
175 if last_revision != self.db_branch.last_scanned_id:177 if last_revision != self.last_scanned_id:
176 raise ConcurrentUpdateError(178 raise ConcurrentUpdateError(
177 "Branch has been changed. Not committing.")179 "Branch has been changed. Not committing.")
178180
179 def commit(self, commit_message):181 def commit(self, commit_message, txn=None):
180 """Commit to branch."""182 """Commit to branch.
183
184 :param commit_message: Message for branch's commit log.
185 :param txn: Transaction to commit. Can be helpful in avoiding
186 long idle times in database transactions. May be committed
187 more than once.
188 """
181 assert self.is_open, "Committing closed DirectBranchCommit."189 assert self.is_open, "Committing closed DirectBranchCommit."
182 assert self.is_locked, "Not locked at commit time."190 assert self.is_locked, "Not locked at commit time."
183191
@@ -185,6 +193,9 @@
185 try:193 try:
186 self._checkForRace()194 self._checkForRace()
187195
196 if txn:
197 txn.commit()
198
188 rev_id = self.revision_tree.get_revision_id()199 rev_id = self.revision_tree.get_revision_id()
189 if rev_id == NULL_REVISION:200 if rev_id == NULL_REVISION:
190 if list(self.transform_preview.iter_changes()) == []:201 if list(self.transform_preview.iter_changes()) == []:
@@ -193,6 +204,9 @@
193 self.bzrbranch, commit_message)204 self.bzrbranch, commit_message)
194 IMasterObject(self.db_branch).requestMirror()205 IMasterObject(self.db_branch).requestMirror()
195206
207 if txn:
208 txn.commit()
209
196 finally:210 finally:
197 self.unlock()211 self.unlock()
198 self.is_open = False212 self.is_open = False
199213
=== modified file 'lib/lp/code/tests/test_directbranchcommit.py'
--- lib/lp/code/tests/test_directbranchcommit.py 2009-10-02 09:48:30 +0000
+++ lib/lp/code/tests/test_directbranchcommit.py 2009-11-27 16:21:25 +0000
@@ -37,7 +37,7 @@
3737
38 self.committer = DirectBranchCommit(self.db_branch)38 self.committer = DirectBranchCommit(self.db_branch)
39 if update_last_scanned_id:39 if update_last_scanned_id:
40 self.db_branch.last_scanned_id = (40 self.committer.last_scanned_id = (
41 self.committer.bzrbranch.last_revision())41 self.committer.bzrbranch.last_revision())
4242
43 def _tearDownCommitter(self):43 def _tearDownCommitter(self):
4444
=== modified file 'lib/lp/soyuz/templates/archive-index.pt'
--- lib/lp/soyuz/templates/archive-index.pt 2009-11-04 13:56:17 +0000
+++ lib/lp/soyuz/templates/archive-index.pt 2009-11-27 16:21:25 +0000
@@ -30,7 +30,7 @@
30 This archive has been disabled.30 This archive has been disabled.
31 </p>31 </p>
3232
33 <div id="edit-description"33 <div id="edit-description" class="lazr-multiline-edit"
34 tal:content="structure view/archive_description_html"34 tal:content="structure view/archive_description_html"
35 />35 />
36 </div>36 </div>
3737
=== modified file 'lib/lp/translations/doc/translations-export-to-branch.txt'
--- lib/lp/translations/doc/translations-export-to-branch.txt 2009-10-20 06:03:46 +0000
+++ lib/lp/translations/doc/translations-export-to-branch.txt 2009-11-27 16:21:25 +0000
@@ -45,7 +45,7 @@
45 ... if self.simulate_race:45 ... if self.simulate_race:
46 ... raise ConcurrentUpdateError("Simulated race condition.")46 ... raise ConcurrentUpdateError("Simulated race condition.")
47 ...47 ...
48 ... def commit(self, message=None):48 ... def commit(self, message=None, txn=None):
49 ... self._checkForRace()49 ... self._checkForRace()
50 ... self.logger.info("Committed %d file(s)." % self.written_files)50 ... self.logger.info("Committed %d file(s)." % self.written_files)
51 ...51 ...
@@ -129,11 +129,11 @@
129129
130 >>> transaction.commit()130 >>> transaction.commit()
131 >>> script = MockExportTranslationsToBranch(131 >>> script = MockExportTranslationsToBranch(
132 ... 'export-to-branch', test_args=['-vv'])132 ... 'export-to-branch', test_args=[])
133 >>> script.main()133 >>> script.main()
134 INFO Exporting to translations branches.134 INFO Exporting to translations branches.
135 INFO Exporting Gazblachko trunk series.135 INFO Exporting Gazblachko trunk series.
136 DEBUG No previous translations commit found.136 DEBUG ...
137 INFO Writing file 'po/main/nl.po':137 INFO Writing file 'po/main/nl.po':
138 INFO # ...138 INFO # ...
139 msgid ""139 msgid ""
@@ -143,6 +143,7 @@
143 msgid "maingazpot msgid"143 msgid "maingazpot msgid"
144 msgstr "maingazpot msgstr"144 msgstr "maingazpot msgstr"
145 <BLANKLINE>145 <BLANKLINE>
146 DEBUG ...
146 INFO Writing file 'po/module/nl.po':147 INFO Writing file 'po/module/nl.po':
147 INFO # ...148 INFO # ...
148 msgid ""149 msgid ""
@@ -152,6 +153,8 @@
152 <BLANKLINE>153 <BLANKLINE>
153 msgid "gazmod msgid"154 msgid "gazmod msgid"
154 msgstr "gazmod msgstr"155 msgstr "gazmod msgstr"
156 <BLANKLINE>
157 DEBUG ...
155 INFO Committed 2 file(s).158 INFO Committed 2 file(s).
156 INFO Unlock.159 INFO Unlock.
157 INFO Processed 1 item(s); 0 failure(s).160 INFO Processed 1 item(s); 0 failure(s).
@@ -186,6 +189,7 @@
186 >>> script.main()189 >>> script.main()
187 INFO Exporting to translations branches.190 INFO Exporting to translations branches.
188 INFO Exporting Gazblachko trunk series.191 INFO Exporting Gazblachko trunk series.
192 DEBUG ....
189 DEBUG Last commit was at ....193 DEBUG Last commit was at ....
190 INFO Unlock.194 INFO Unlock.
191 INFO Processed 1 item(s); 0 failure(s).195 INFO Processed 1 item(s); 0 failure(s).
@@ -197,6 +201,7 @@
197 >>> script.main()201 >>> script.main()
198 INFO Exporting to translations branches.202 INFO Exporting to translations branches.
199 INFO Exporting Gazblachko trunk series.203 INFO Exporting Gazblachko trunk series.
204 DEBUG ....
200 DEBUG Last commit was at ...205 DEBUG Last commit was at ...
201 INFO Writing file 'po/main/nl.po':206 INFO Writing file 'po/main/nl.po':
202 INFO ...207 INFO ...
@@ -228,11 +233,14 @@
228 >>> script.main()233 >>> script.main()
229 INFO Exporting to translations branches.234 INFO Exporting to translations branches.
230 INFO Exporting Gazblachko trunk series.235 INFO Exporting Gazblachko trunk series.
236 DEBUG ....
231 DEBUG No previous translations commit found.237 DEBUG No previous translations commit found.
238 DEBUG ....
232 INFO Writing file 'po/main/nl.po':239 INFO Writing file 'po/main/nl.po':
233 ...240 ...
234 msgstr "gazmod msgstr"241 msgstr "gazmod msgstr"
235 <BLANKLINE>242 <BLANKLINE>
243 DEBUG ...
236 INFO Unlock.244 INFO Unlock.
237 ERROR Failure: Simulated race condition.245 ERROR Failure: Simulated race condition.
238 INFO Processed 1 item(s); 1 failure(s).246 INFO Processed 1 item(s); 1 failure(s).
239247
=== modified file 'lib/lp/translations/scripts/translations_to_branch.py'
--- lib/lp/translations/scripts/translations_to_branch.py 2009-10-20 06:03:46 +0000
+++ lib/lp/translations/scripts/translations_to_branch.py 2009-11-27 16:21:25 +0000
@@ -119,7 +119,7 @@
119 def _commit(self, source, committer):119 def _commit(self, source, committer):
120 """Commit changes to branch. Check for race conditions."""120 """Commit changes to branch. Check for race conditions."""
121 self._checkForObjections(source)121 self._checkForObjections(source)
122 committer.commit(self.commit_message)122 committer.commit(self.commit_message, txn=self.txn)
123123
124 def _isTranslationsCommit(self, revision):124 def _isTranslationsCommit(self, revision):
125 """Is `revision` an automatic translations commit?"""125 """Is `revision` an automatic translations commit?"""
@@ -159,6 +159,9 @@
159 self._checkForObjections(source)159 self._checkForObjections(source)
160160
161 committer = self._prepareBranchCommit(source.translations_branch)161 committer = self._prepareBranchCommit(source.translations_branch)
162 self.logger.debug("Created DirectBranchCommit.")
163 if self.txn:
164 self.txn.commit()
162165
163 bzr_branch = committer.bzrbranch166 bzr_branch = committer.bzrbranch
164167
@@ -185,15 +188,17 @@
185 base_path = os.path.dirname(template.path)188 base_path = os.path.dirname(template.path)
186189
187 for pofile in template.pofiles:190 for pofile in template.pofiles:
188
189 has_changed = (191 has_changed = (
190 changed_since is None or192 changed_since is None or
191 pofile.date_changed > changed_since)193 pofile.date_changed > changed_since)
192 if not has_changed:194 if not has_changed:
193 continue195 continue
194196
197 language_code = pofile.getFullLanguageCode()
198 self.logger.debug("Exporting %s." % language_code)
199
195 pofile_path = os.path.join(200 pofile_path = os.path.join(
196 base_path, pofile.getFullLanguageCode() + '.po')201 base_path, language_code + '.po')
197 pofile_contents = pofile.export()202 pofile_contents = pofile.export()
198203
199 committer.writeFile(pofile_path, pofile_contents)204 committer.writeFile(pofile_path, pofile_contents)
@@ -210,6 +215,7 @@
210 template.clearPOFileCache()215 template.clearPOFileCache()
211216
212 if change_count > 0:217 if change_count > 0:
218 self.logger.debug("Writing to branch.")
213 self._commit(source, committer)219 self._commit(source, committer)
214 finally:220 finally:
215 committer.unlock()221 committer.unlock()
@@ -231,13 +237,14 @@
231 raise237 raise
232 except Exception, e:238 except Exception, e:
233 items_failed += 1239 items_failed += 1
234 self.logger.error("Failure: %s" % e)240 message = unicode(e)
241 if message == u'':
242 message = e.__class__.__name__
243 self.logger.error("Failure: %s" % message)
235 if self.txn:244 if self.txn:
236 self.txn.abort()245 self.txn.abort()
237246
238 items_done += 1247 items_done += 1
239 if self.txn:
240 self.txn.begin()
241248
242 self.logger.info("Processed %d item(s); %d failure(s)." % (249 self.logger.info("Processed %d item(s); %d failure(s)." % (
243 items_done, items_failed))250 items_done, items_failed))
244251
=== modified file 'lib/lp/translations/utilities/gettext_po_exporter.py'
--- lib/lp/translations/utilities/gettext_po_exporter.py 2009-11-02 00:10:05 +0000
+++ lib/lp/translations/utilities/gettext_po_exporter.py 2009-11-27 16:21:25 +0000
@@ -14,6 +14,7 @@
14 'GettextPOExporter',14 'GettextPOExporter',
15 ]15 ]
1616
17import logging
17import os18import os
1819
19from zope.interface import implements20from zope.interface import implements
@@ -344,8 +345,20 @@
344 raise UnicodeEncodeError(345 raise UnicodeEncodeError(
345 '%s:\n%s' % (file_path, str(error)))346 '%s:\n%s' % (file_path, str(error)))
346347
347 # This message cannot be represented in current encoding,348 # This message cannot be represented in the current
348 # change to UTF-8 and try again.349 # encoding.
350 if translation_file.path:
351 file_description = translation_file.path
352 elif translation_file.language_code:
353 file_description = (
354 "%s translation" % translation_file.language_code)
355 else:
356 file_description = "template"
357 logging.info(
358 "Can't represent %s as %s; using UTF-8 instead." % (
359 file_description,
360 translation_file.header.charset.upper()))
361
349 old_charset = translation_file.header.charset362 old_charset = translation_file.header.charset
350 translation_file.header.charset = 'UTF-8'363 translation_file.header.charset = 'UTF-8'
351 # We need to update the header too.364 # We need to update the header too.
352365
=== modified file 'utilities/rocketfuel-setup'
--- utilities/rocketfuel-setup 2009-11-12 06:57:28 +0000
+++ utilities/rocketfuel-setup 2009-11-27 16:21:25 +0000
@@ -7,7 +7,7 @@
7# workstation, from scratch. The script lives in the LP codebase itself,7# workstation, from scratch. The script lives in the LP codebase itself,
8# as utilities/rocketfuel-setup8# as utilities/rocketfuel-setup
99
10# We require Bazaar 1.16.1 or higher. 10# We require Bazaar 1.16.1 or higher.
11# So first, grab the output of 'bzr --version' and transform the11# So first, grab the output of 'bzr --version' and transform the
12# version line, like "Bazaar (bzr) 1.16.1", into "1 16 1":12# version line, like "Bazaar (bzr) 1.16.1", into "1 16 1":
13VER_RAW=`bzr --version | head -1 | sed -e 's/Bazaar (bzr) //g'`13VER_RAW=`bzr --version | head -1 | sed -e 's/Bazaar (bzr) //g'`
@@ -315,6 +315,8 @@
315 fi315 fi
316fi316fi
317317
318# Call the newly minted Launchpad branch's 'make install' target to do some
319# more apache setup.
318sudo make install > /dev/null320sudo make install > /dev/null
319if [ $? -ne 0 ]; then321if [ $? -ne 0 ]; then
320 echo "ERROR: Unable to install apache config appropriately"322 echo "ERROR: Unable to install apache config appropriately"

Subscribers

People subscribed via source and target branches

to status/vote changes: