Merge lp:~zyga/checkbox/plainbox-sru-for-trunk into lp:checkbox

Proposed by Zygmunt Krynicki
Status: Merged
Approved by: Zygmunt Krynicki
Approved revision: 2923
Merged at revision: 2927
Proposed branch: lp:~zyga/checkbox/plainbox-sru-for-trunk
Merge into: lp:checkbox
Diff against target: 470 lines (+115/-81)
3 files modified
plainbox/docs/changelog.rst (+9/-0)
plainbox/plainbox/impl/commands/run.py (+45/-19)
plainbox/po/pl.po (+61/-62)
To merge this branch: bzr merge lp:~zyga/checkbox/plainbox-sru-for-trunk
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Review via email: mp+215704@code.launchpad.net

Description of the change

e1f83a1 plainbox:commands:run: use translated job description
073ddbd plainbox:commands:run: make user actions translatable
4aaba54 plainbox:commands:run: handle EOFError in _interaction_callback()
e1f49bc plainbox:commands:run: handle EOFError in ask_for_resume()
4e9b8d7 plainbox:commands:run: handle EOFError in ask_for_resume_action()
12ec958 plainbox:po: update Polish translations
3027ad1 plainbox:docs: update changelog
8638e3e plainbox: bump version to 0.5.4
e52ddb5 Merge branch 'plainbox-sru' into launchpad/plainbox-sru-for-trunk

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

Looks good, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plainbox/docs/changelog.rst'
2--- plainbox/docs/changelog.rst 2014-04-07 07:54:35 +0000
3+++ plainbox/docs/changelog.rst 2014-04-14 17:06:00 +0000
4@@ -8,6 +8,15 @@
5
6 .. _version_0_5:
7
8+PlainBox 0.5.4
9+^^^^^^^^^^^^^^
10+
11+This is a maintenance release of the 0.5 series.
12+
13+Bugs fixed in this release are assigned to the following milestone:
14+
15+* Bugfixes: https://launchpad.net/plainbox/+milestone/0.5.4
16+
17 PlainBox 0.5.3
18 ^^^^^^^^^^^^^^
19
20
21=== modified file 'plainbox/plainbox/impl/commands/run.py'
22--- plainbox/plainbox/impl/commands/run.py 2014-04-03 19:07:12 +0000
23+++ plainbox/plainbox/impl/commands/run.py 2014-04-14 17:06:00 +0000
24@@ -122,14 +122,20 @@
25
26 def ask_for_resume(self):
27 # TODO: use proper APIs for yes-no questions
28- return self.ask_user(
29- _("Do you want to resume the previous session?"), ('y', 'n')
30- ).lower() == "y"
31+ try:
32+ return self.ask_user(
33+ _("Do you want to resume the previous session?"), ('y', 'n')
34+ ).lower() == "y"
35+ except EOFError:
36+ return False
37
38 def ask_for_resume_action(self):
39- return self.ask_user(
40- _("What do you want to do with that job?"),
41- (_('skip'), _('fail'), _('run')))
42+ try:
43+ return self.ask_user(
44+ _("What do you want to do with that job?"),
45+ (_('skip'), _('fail'), _('run')))
46+ except EOFError:
47+ return _('skip')
48
49 def ask_user(self, prompt, allowed):
50 answer = None
51@@ -257,21 +263,40 @@
52 allowed_outcome = [IJobResult.OUTCOME_PASS,
53 IJobResult.OUTCOME_FAIL,
54 IJobResult.OUTCOME_SKIP]
55- allowed_actions = [_('comments')]
56+ allowed_actions = {
57+ _('comments'): 'set-comments',
58+ }
59+ if IJobResult.OUTCOME_PASS in allowed_outcome:
60+ allowed_actions[_("pass")] = "set-pass"
61+ if IJobResult.OUTCOME_FAIL in allowed_outcome:
62+ allowed_actions[_("fail")] = "set-fail"
63+ if IJobResult.OUTCOME_SKIP in allowed_outcome:
64+ allowed_actions[_("skip")] = "set-skip"
65 if job.command:
66- allowed_actions.append(_('test'))
67+ allowed_actions[_("test")] = "run-test"
68 result['outcome'] = IJobResult.OUTCOME_UNDECIDED
69 while result['outcome'] not in allowed_outcome:
70 print(_("Allowed answers are: {}").format(
71- ", ".join(allowed_outcome + allowed_actions)))
72- choice = input(prompt)
73- if choice in allowed_outcome:
74- result['outcome'] = choice
75+ ", ".join(allowed_actions.keys())))
76+ try:
77+ choice = input(prompt)
78+ except EOFError:
79+ result['outcome'] = IJobResult.OUTCOME_SKIP
80 break
81- elif choice == _('test'):
82- (result['return_code'],
83- result['io_log_filename']) = runner._run_command(job, config)
84- elif choice == _('comments'):
85+ else:
86+ action = allowed_actions.get(choice)
87+ if action is None:
88+ continue
89+ elif action == 'set-pass':
90+ result['outcome'] = IJobResult.OUTCOME_PASS
91+ elif action == 'set-fail':
92+ result['outcome'] = IJobResult.OUTCOME_FAIL
93+ elif action == 'set-skip':
94+ result['outcome'] = IJobResult.OUTCOME_SKIP
95+ elif action == 'run-test':
96+ (result['return_code'], result['io_log_filename']) = (
97+ runner._run_command(job, config))
98+ elif action == 'set-comments':
99 result['comments'] = input(_('Please enter your comments:\n'))
100 return DiskJobResult(result)
101
102@@ -328,9 +353,10 @@
103
104 def _run_single_job_with_session(self, ns, session, runner, job):
105 print("[ {} ]".format(job.id).center(80, '-'))
106- if job.description is not None:
107- print(job.description)
108- print("^" * len(job.description.splitlines()[-1]))
109+ description = job.tr_description()
110+ if description is not None:
111+ print(description)
112+ print("^" * len(description.splitlines()[-1]))
113 print()
114 job_state = session.job_state_map[job.id]
115 logger.debug(_("Job id: %s"), job.id)
116
117=== modified file 'plainbox/po/pl.po'
118--- plainbox/po/pl.po 2014-04-06 05:46:23 +0000
119+++ plainbox/po/pl.po 2014-04-14 17:06:00 +0000
120@@ -7,10 +7,11 @@
121 msgstr ""
122 "Project-Id-Version: plainbox 0.5\n"
123 "Report-Msgid-Bugs-To: \n"
124-"POT-Creation-Date: 2014-04-04 18:17+0200\n"
125+"POT-Creation-Date: 2014-04-10 23:03+0200\n"
126 "PO-Revision-Date: 2014-04-05 13:51+0000\n"
127 "Last-Translator: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>\n"
128 "Language-Team: polski <>\n"
129+"Language: Polish\n"
130 "MIME-Version: 1.0\n"
131 "Content-Type: text/plain; charset=UTF-8\n"
132 "Content-Transfer-Encoding: 8bit\n"
133@@ -18,7 +19,6 @@
134 "|| n%100>=20) ? 1 : 2;\n"
135 "X-Launchpad-Export-Date: 2014-04-06 05:46+0000\n"
136 "X-Generator: Launchpad (build 16976)\n"
137-"Language: Polish\n"
138
139 #: .././plainbox/impl/_argparse.py:139
140 #: .././plainbox/vendor/argparse/py32-argparse.py:298
141@@ -482,8 +482,8 @@
142
143 #: .././plainbox/impl/commands/run.py:73 .././plainbox/impl/commands/run.py:76
144 #: .././plainbox/impl/commands/run.py:79
145-#: .././plainbox/impl/commands/run.py:393
146-#: .././plainbox/impl/commands/run.py:409
147+#: .././plainbox/impl/commands/run.py:408
148+#: .././plainbox/impl/commands/run.py:424
149 msgid "?"
150 msgstr "?"
151
152@@ -509,12 +509,14 @@
153
154 #: .././plainbox/impl/commands/run.py:132
155 #: .././plainbox/impl/commands/run.py:146
156+#: .././plainbox/impl/commands/run.py:268
157 #: .././plainbox/impl/exporter/xlsx.py:465
158 msgid "skip"
159 msgstr "pomiń"
160
161 #: .././plainbox/impl/commands/run.py:132
162 #: .././plainbox/impl/commands/run.py:151
163+#: .././plainbox/impl/commands/run.py:266
164 msgid "fail"
165 msgstr "niepowodzenie"
166
167@@ -575,51 +577,53 @@
168
169 #: .././plainbox/impl/commands/run.py:255
170 msgid "Select an outcome or an action: "
171-msgstr "Proszę wybrać "
172+msgstr "Proszę wybrać rezultat lub akcję: "
173
174-#: .././plainbox/impl/commands/run.py:260
175-#: .././plainbox/impl/commands/run.py:274
176+#: .././plainbox/impl/commands/run.py:261
177 msgid "comments"
178 msgstr "komentarz"
179
180-#: .././plainbox/impl/commands/run.py:262
181-#: .././plainbox/impl/commands/run.py:271
182+#: .././plainbox/impl/commands/run.py:264
183+msgid "pass"
184+msgstr "powodzenie"
185+
186+#: .././plainbox/impl/commands/run.py:270
187 msgid "test"
188 msgstr "testuj"
189
190-#: .././plainbox/impl/commands/run.py:265
191+#: .././plainbox/impl/commands/run.py:273
192 msgid "Allowed answers are: {}"
193 msgstr "Dozwolone odpowiedzi to: {}"
194
195-#: .././plainbox/impl/commands/run.py:275
196+#: .././plainbox/impl/commands/run.py:289
197 msgid "Please enter your comments:\n"
198 msgstr "Proszę podać komentarz:\n"
199
200-#: .././plainbox/impl/commands/run.py:281
201+#: .././plainbox/impl/commands/run.py:295
202 msgid "[ Warning ]"
203 msgstr "[ Ostrzeżenie ]"
204
205-#: .././plainbox/impl/commands/run.py:282
206+#: .././plainbox/impl/commands/run.py:296
207 msgid "There were some problems with the selected jobs"
208 msgstr "Wystąpiły problemy z wybranymi zadaniami"
209
210-#: .././plainbox/impl/commands/run.py:285
211+#: .././plainbox/impl/commands/run.py:299
212 msgid "Problematic jobs will not be considered"
213 msgstr "Problematyczne zadania nie zostaną wzięte pod uwagę"
214
215-#: .././plainbox/impl/commands/run.py:289
216+#: .././plainbox/impl/commands/run.py:303
217 msgid "Estimated duration is {:.2f} for automated jobs."
218 msgstr "Oszacowany czas trwania zadań zautomatyzowanych to {:.2f}."
219
220-#: .././plainbox/impl/commands/run.py:293
221+#: .././plainbox/impl/commands/run.py:307
222 msgid "Estimated duration cannot be determined for automated jobs."
223 msgstr "Nie można oszacować czasu trwania zadań zautomatyzowanych."
224
225-#: .././plainbox/impl/commands/run.py:295
226+#: .././plainbox/impl/commands/run.py:309
227 msgid "Estimated duration is {:.2f} for manual jobs."
228 msgstr "Oszacowany czas trwania zadań ręcznych to {:.2f}."
229
230-#: .././plainbox/impl/commands/run.py:299
231+#: .././plainbox/impl/commands/run.py:313
232 msgid "Estimated duration cannot be determined for manual jobs."
233 msgstr "Nie można oszacować czasu trwania zadań ręcznych."
234
235@@ -628,97 +632,97 @@
236 #. desired_jobs could be managed entirely internally by SesionState. In
237 #. such case the list of jobs to run would be changed during iteration
238 #. but would be otherwise okay).
239-#: .././plainbox/impl/commands/run.py:307
240+#: .././plainbox/impl/commands/run.py:321
241 msgid "[ Running All Jobs ]"
242 msgstr "[ Wykonywanie wszystkich zadań ]"
243
244-#: .././plainbox/impl/commands/run.py:336
245+#: .././plainbox/impl/commands/run.py:351
246 #, python-format
247 msgid "Job id: %s"
248 msgstr "Identyfikator zadania: %s"
249
250-#: .././plainbox/impl/commands/run.py:337
251+#: .././plainbox/impl/commands/run.py:352
252 #, python-format
253 msgid "Plugin: %s"
254 msgstr "Wtyczka: %s"
255
256-#: .././plainbox/impl/commands/run.py:338
257+#: .././plainbox/impl/commands/run.py:353
258 #, python-format
259 msgid "Direct dependencies: %s"
260 msgstr "Bezpośrednie zależności: %s"
261
262-#: .././plainbox/impl/commands/run.py:340
263+#: .././plainbox/impl/commands/run.py:355
264 #, python-format
265 msgid "Resource dependencies: %s"
266 msgstr "Zależności od zasobów: %s"
267
268-#: .././plainbox/impl/commands/run.py:342
269+#: .././plainbox/impl/commands/run.py:357
270 #, python-format
271 msgid "Resource program: %r"
272 msgstr "Program zasobu: %r"
273
274-#: .././plainbox/impl/commands/run.py:343
275+#: .././plainbox/impl/commands/run.py:358
276 #, python-format
277 msgid "Command: %r"
278 msgstr "Polecenie: %r"
279
280-#: .././plainbox/impl/commands/run.py:344
281+#: .././plainbox/impl/commands/run.py:359
282 #, python-format
283 msgid "Can start: %s"
284 msgstr "Może być uruchomiony: %s"
285
286-#: .././plainbox/impl/commands/run.py:345
287+#: .././plainbox/impl/commands/run.py:360
288 #, python-format
289 msgid "Readiness: %s"
290 msgstr "Gotowość: %s"
291
292-#: .././plainbox/impl/commands/run.py:347
293+#: .././plainbox/impl/commands/run.py:362
294 msgid "Running... (output in {}.*)"
295 msgstr "Wykonywanie... (wyjście w {}.*)"
296
297-#: .././plainbox/impl/commands/run.py:359
298+#: .././plainbox/impl/commands/run.py:374
299 msgid "Outcome: {}"
300 msgstr "Wynik: {}"
301
302-#: .././plainbox/impl/commands/run.py:360
303+#: .././plainbox/impl/commands/run.py:375
304 msgid "Comments: {}"
305 msgstr "Komentarze: {}"
306
307-#: .././plainbox/impl/commands/run.py:380
308+#: .././plainbox/impl/commands/run.py:395
309 msgid "run a test job"
310 msgstr "uruchom zadania testowe"
311
312-#: .././plainbox/impl/commands/run.py:382
313+#: .././plainbox/impl/commands/run.py:397
314 msgid "user interface options"
315 msgstr "opcje interfejsu użytkownika"
316
317-#: .././plainbox/impl/commands/run.py:385
318+#: .././plainbox/impl/commands/run.py:400
319 msgid "skip tests that require interactivity"
320 msgstr "pomiń testy wymagające interaktywności"
321
322-#: .././plainbox/impl/commands/run.py:388
323+#: .././plainbox/impl/commands/run.py:403
324 msgid "don't really run most jobs"
325 msgstr "tak na prawdę nie uruchamiaj większości zadań"
326
327-#: .././plainbox/impl/commands/run.py:389
328+#: .././plainbox/impl/commands/run.py:404
329 msgid "output options"
330 msgstr "opcje wyjściowe"
331
332-#: .././plainbox/impl/commands/run.py:393
333+#: .././plainbox/impl/commands/run.py:408
334 msgid "FORMAT"
335 msgstr "FORMAT"
336
337-#: .././plainbox/impl/commands/run.py:395
338+#: .././plainbox/impl/commands/run.py:410
339 msgid ""
340 "save test results in the specified FORMAT (pass ? for a list of choices)"
341 msgstr "zapisz wyniki w wybranym FORMACIE (? wyświetla listę możliwości)"
342
343-#: .././plainbox/impl/commands/run.py:399
344-#: .././plainbox/impl/commands/run.py:419
345+#: .././plainbox/impl/commands/run.py:414
346+#: .././plainbox/impl/commands/run.py:434
347 msgid "OPTIONS"
348 msgstr "OPCJE"
349
350-#: .././plainbox/impl/commands/run.py:400
351+#: .././plainbox/impl/commands/run.py:415
352 msgid ""
353 "comma-separated list of options for the export mechanism (pass ? for a list "
354 "of choices)"
355@@ -726,36 +730,35 @@
356 "lista opcji, po przecinku, do mechanizmu eksportowania wyników (? wyświetla "
357 "listę możliwości)"
358
359-#: .././plainbox/impl/commands/run.py:404
360+#: .././plainbox/impl/commands/run.py:419
361 msgid "FILE"
362 msgstr "PLIK"
363
364-#: .././plainbox/impl/commands/run.py:405
365+#: .././plainbox/impl/commands/run.py:420
366 msgid "save test results to the specified FILE (or to stdout if FILE is -)"
367 msgstr ""
368 "zapisz wyniki testów do wybranego PLIKU (lub na standardowe wyjście, jeśli "
369 "PLIK to -)"
370
371-#: .././plainbox/impl/commands/run.py:409
372+#: .././plainbox/impl/commands/run.py:424
373 msgid "TRANSPORT"
374 msgstr "TRANSPORT"
375
376-#: .././plainbox/impl/commands/run.py:411
377-msgid ""
378-"use TRANSPORT to send results somewhere (pass ? for a list of choices)"
379+#: .././plainbox/impl/commands/run.py:426
380+msgid "use TRANSPORT to send results somewhere (pass ? for a list of choices)"
381 msgstr ""
382 "użyj TRANSPORTU do wysłania wyników w jakieś miejsce (? wyświetla "
383 "listę możliwości)"
384
385-#: .././plainbox/impl/commands/run.py:415
386+#: .././plainbox/impl/commands/run.py:430
387 msgid "WHERE"
388 msgstr "GDZIE"
389
390-#: .././plainbox/impl/commands/run.py:416
391+#: .././plainbox/impl/commands/run.py:431
392 msgid "where to send data using the selected transport"
393 msgstr "gdzie wysłać wyniki za pomocą wybranego mechanizmu transportowego"
394
395-#: .././plainbox/impl/commands/run.py:420
396+#: .././plainbox/impl/commands/run.py:435
397 msgid ""
398 "comma-separated list of key-value options (k=v) to be passed to the transport"
399 msgstr ""
400@@ -804,8 +807,7 @@
401
402 #: .././plainbox/impl/commands/selftest.py:78
403 msgid "run integration test suite (this verifies checkbox jobs)"
404-msgstr ""
405-"uruchom testy integracji (to weryfikuje definicje zadań z checkbox'a)"
406+msgstr "uruchom testy integracji (to weryfikuje definicje zadań z checkbox'a)"
407
408 #: .././plainbox/impl/commands/selftest.py:84
409 msgid "run unit tests (this only verifies plainbox core)"
410@@ -874,8 +876,8 @@
411 "\n"
412 " @EPILOG@\n"
413 "\n"
414-" The name of the provider must follow the pattern "
415-"``YYYY.example.org:name``\n"
416+" The name of the provider must follow the pattern ``YYYY.example.org:"
417+"name``\n"
418 " where ``YYYY`` is a four-digit year when the author of the provider "
419 "owned\n"
420 " the domain (here, ``example.org``) and ``name`` is arbitrary identifier\n"
421@@ -1843,8 +1845,7 @@
422 #: .././plainbox/impl/session/storage.py:271
423 #, python-format
424 msgid "%r is not a symlink, repository %r must be corrupted"
425-msgstr ""
426-"%r nie jest dowiązaniem symbolicznym, repozytorium %r musi być popsute"
427+msgstr "%r nie jest dowiązaniem symbolicznym, repozytorium %r musi być popsute"
428
429 #: .././plainbox/impl/session/storage.py:275
430 #, python-format
431@@ -1986,7 +1987,7 @@
432
433 #. TRANSLATORS: please don't translate fsync()
434 #. Flush kernel buffers on the directory.
435-#.
436+#.
437 #. This should ensure the rename operation is really on disk by now.
438 #. As noted above, this is essential for being able to survive
439 #. system crash immediately after exiting this method.
440@@ -2163,8 +2164,7 @@
441
442 #: .././plainbox/provider_manager.py:239
443 msgid "install everything relative to this alternate root directory"
444-msgstr ""
445-"instaluje wszystko względnie podanego alternatywnego katalogu głównego"
446+msgstr "instaluje wszystko względnie podanego alternatywnego katalogu głównego"
447
448 #: .././plainbox/provider_manager.py:295
449 #, python-format
450@@ -2339,8 +2339,8 @@
451 " hopefully, in most cases, you don't need to do anything. If your src/\n"
452 " directory has a Makefile or .go source files you should be good to go.\n"
453 "\n"
454-" If the automatic defaults are somehow unsuitable you need to edit "
455-"manage.py\n"
456+" If the automatic defaults are somehow unsuitable you need to edit manage."
457+"py\n"
458 " so that it specifies the build command.\n"
459 "\n"
460 " IMPORTANT: It is expected that the build command will create binary "
461@@ -2590,8 +2590,7 @@
462
463 #: .././plainbox/provider_manager.py:893
464 msgid "NOTE: subsequent jobs from problematic files are ignored"
465-msgstr ""
466-"UWAGA: późniejsze zadania z problematycznych plików zostały pominięte"
467+msgstr "UWAGA: późniejsze zadania z problematycznych plików zostały pominięte"
468
469 #: .././plainbox/provider_manager.py:911
470 msgid "missing definition of required field"

Subscribers

People subscribed via source and target branches