launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #05200
[Merge] lp:~danilo/launchpad/bug-869089 into lp:launchpad
Данило Шеган has proposed merging lp:~danilo/launchpad/bug-869089 into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #677532 in Launchpad itself: "Properties wrapping usage columns should be dropped"
https://bugs.launchpad.net/launchpad/+bug/677532
Bug #869089 in Launchpad itself: "Global translation suggestions are sometimes missing"
https://bugs.launchpad.net/launchpad/+bug/869089
For more details, see:
https://code.launchpad.net/~danilo/launchpad/bug-869089/+merge/78819
= Bug 869089 =
I was under the wrong impression that global suggestions have stopped working. However, the logic for updating the cached SuggestivePOTemplate table was using official_rosetta field instead.
So, I've decided to fix this (basically rosetta task of bug 627631, which has been marked 'fix released' for all of Launchpad, probably the migration to one single project losing the distinction), and the translations part of bug 677532 (because I had to :).
== Proposed fix ==
Use translations_usage directly everywhere instead of using official_rosetta. Good riddance to official_rosetta.
== Implementation details ==
One problem I hit was that the tests sampledata was not updated with the migration from official_rosetta to translations_usage, so I did that (that's why only current.sql is updated).
I'll be fixing the lint-reported issues as well.
== Tests ==
bin/test -vvm lp.translations (though, I ran full test suite already and fixed problems that caused failing tests)
== Demo and Q/A ==
Make sure TranslationAdmins (eg. all of Launchpad team) can access translations.l.n/(project|distro)/+settings pages and change the "uses translations" setting.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
database/sampledata/current.sql
lib/lp/registry/model/projectgroup.py
lib/lp/registry/doc/distribution.txt
lib/lp/translations/scripts/tests/test_cache_suggestive_templates.py
lib/lp/translations/tests/test_pofile.py
lib/lp/registry/configure.zcml
lib/lp/translations/browser/distribution.py
lib/lp/app/interfaces/launchpad.py
lib/lp/translations/browser/tests/test_productserieslanguage_views.py
lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt
lib/lp/translations/browser/tests/test_baseexportview.py
lib/lp/translations/browser/tests/test_distroserieslanguage_views.py
lib/lp/translations/tests/test_shared_potemplate.py
lib/lp/translations/browser/tests/test_translationimportqueueentry.py
lib/lp/translations/browser/tests/test_translationlinksaggregator.py
lib/lp/registry/interfaces/projectgroup.py
lib/lp/translations/scripts/translations_to_branch.py
lib/lp/registry/model/product.py
lib/lp/registry/tests/test_service_usage.py
lib/lp/registry/browser/tests/distribution-views.txt
lib/canonical/launchpad/database/launchpadstatistic.py
lib/lp/translations/model/translationsperson.py
lib/lp/translations/interfaces/hastranslationtemplates.py
lib/lp/translations/doc/potmsgset.txt
lib/lp/registry/browser/distribution.py
lib/lp/translations/model/potemplate.py
lib/lp/registry/model/distribution.py
lib/lp/translations/browser/tests/test_product_view.py
lib/lp/translations/browser/potemplate.py
./lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt
58: source exceeds 78 characters.
./lib/lp/translations/browser/tests/test_baseexportview.py
59: local variable 'template' is assigned to but never used
./lib/lp/translations/tests/test_shared_potemplate.py
114: local variable 'plural_potmsgset' is assigned to but never used
./lib/lp/translations/scripts/translations_to_branch.py
39: 'lp' imported but unused
./lib/lp/translations/doc/potmsgset.txt
554: source exceeds 78 characters.
./lib/lp/translations/model/potemplate.py
1408: E203 whitespace before ':'
./lib/lp/translations/browser/tests/test_product_view.py
41: local variable 'pot' is assigned to but never used
49: local variable 'series_trunk' is assigned to but never used
21: E302 expected 2 blank lines, found 1
--
https://code.launchpad.net/~danilo/launchpad/bug-869089/+merge/78819
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~danilo/launchpad/bug-869089 into lp:launchpad.
=== modified file 'database/sampledata/current.sql'
--- database/sampledata/current.sql 2011-10-03 07:37:37 +0000
+++ database/sampledata/current.sql 2011-10-10 11:42:28 +0000
@@ -1812,7 +1812,7 @@
ALTER TABLE distribution DISABLE TRIGGER ALL;
-INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant, package_derivatives_email) VALUES (1, 'ubuntu', 'Ubuntu Linux', 'Ubuntu is a new approach to Linux Distribution that includes regular releases, and a simplified single-CD installation system.', 'ubuntulinux.org', 17, 'Ubuntu', 'Ubuntu is a new approach to Linux Distribution that includes regular releases, and a simplified single-CD installation system.', 17, NULL, 1, NULL, true, true, NULL, NULL, 3, 59, NULL, NULL, '2006-10-16 18:31:43.415195', NULL, NULL, NULL, NULL, NULL, true, NULL, true, true, NULL, NULL, NULL, NULL, 10, 10, 10, 60, '{package_name}_derivatives@xxxxxxxxxxxxxxxxxxxxxx');
+INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant, package_derivatives_email) VALUES (1, 'ubuntu', 'Ubuntu Linux', 'Ubuntu is a new approach to Linux Distribution that includes regular releases, and a simplified single-CD installation system.', 'ubuntulinux.org', 17, 'Ubuntu', 'Ubuntu is a new approach to Linux Distribution that includes regular releases, and a simplified single-CD installation system.', 17, NULL, 1, NULL, true, true, NULL, NULL, 3, 59, NULL, NULL, '2006-10-16 18:31:43.415195', NULL, NULL, NULL, NULL, NULL, true, NULL, true, true, NULL, NULL, NULL, NULL, 10, 10, 20, 60, '{package_name}_derivatives@xxxxxxxxxxxxxxxxxxxxxx');
INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant, package_derivatives_email) VALUES (2, 'redhat', 'Redhat Advanced Server', 'Red Hat is a commercial distribution of the GNU/Linux Operating System.', 'redhat.com', 1, 'Red Hat', 'Red Hat is a commercial distribution of the GNU/Linux Operating System.', 1, NULL, 1, NULL, false, false, NULL, 8, NULL, 1, NULL, NULL, '2006-10-16 18:31:43.417928', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10, 60, NULL);
INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant, package_derivatives_email) VALUES (3, 'debian', 'Debian GNU/Linux', 'Debian GNU/Linux is
a non commercial distribution of a GNU/Linux Operating System for many
@@ -1865,7 +1865,7 @@
INSERT INTO product (id, project, owner, name, displayname, title, summary, description, datecreated, homepageurl, screenshotsurl, wikiurl, listurl, programminglang, downloadurl, lastdoap, sourceforgeproject, freshmeatproject, reviewed, active, fti, autoupdate, translationgroup, translationpermission, official_rosetta, official_malone, bug_supervisor, security_contact, driver, bugtracker, development_focus, homepage_content, icon, mugshot, logo, official_answers, private_bugs, private_specs, license_info, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, license_approved, registrant, remote_product, translation_focus, max_bug_heat, date_next_suggest_packaging, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, enable_bugfiling_duplicate_search) VALUES (4, 4, 12, 'firefox', 'Mozilla Firefox', 'Mozilla Firefox', 'The Mozilla Firefox web browser', 'The Mozilla Firefox web browser', '2004-09-24 20:58:02.185708', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, true, NULL, false, 1, 100, false, true, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, true, false, false, NULL, false, false, NULL, NULL, false, 12, NULL, NULL, NULL, NULL, NULL, 10, 10, 10, true);
INSERT INTO product (id, project, owner, name, displayname, title, summary, description, datecreated, homepageurl, screenshotsurl, wikiurl, listurl, programminglang, downloadurl, lastdoap, sourceforgeproject, freshmeatproject, reviewed, active, fti, autoupdate, translationgroup, translationpermission, official_rosetta, official_malone, bug_supervisor, security_contact, driver, bugtracker, development_focus, homepage_content, icon, mugshot, logo, official_answers, private_bugs, private_specs, license_info, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, license_approved, registrant, remote_product, translation_focus, max_bug_heat, date_next_suggest_packaging, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, enable_bugfiling_duplicate_search) VALUES (5, 5, 12, 'evolution', 'Evolution', 'The Evolution Groupware Application', 'Evolution is an email client, addressbook and calendar application that is very well integrated with the Gnome desktop. Evolution is the standard mail client in the Ubuntu distribution, and supports all current mail system standards.', 'Recently, Evolution has seen significant work to make it interoperable with the proprietary Microsoft Exchange Server protocols and formats, allowing organisations to replace Outlook on Windows with Evolution and Linux.
-The current stable release series of Evolution is 2.0.', '2004-09-24 20:58:02.240163', 'http://www.gnome.org/evolution/', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, true, NULL, false, 1, 100, true, true, NULL, NULL, NULL, NULL, 3, NULL, NULL, NULL, NULL, false, false, false, NULL, false, false, NULL, NULL, false, 12, NULL, NULL, NULL, NULL, NULL, 10, 10, 10, true);
+The current stable release series of Evolution is 2.0.', '2004-09-24 20:58:02.240163', 'http://www.gnome.org/evolution/', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, true, NULL, false, 1, 100, true, true, NULL, NULL, NULL, NULL, 3, NULL, NULL, NULL, NULL, false, false, false, NULL, false, false, NULL, NULL, false, 12, NULL, NULL, NULL, NULL, NULL, 10, 10, 20, true);
INSERT INTO product (id, project, owner, name, displayname, title, summary, description, datecreated, homepageurl, screenshotsurl, wikiurl, listurl, programminglang, downloadurl, lastdoap, sourceforgeproject, freshmeatproject, reviewed, active, fti, autoupdate, translationgroup, translationpermission, official_rosetta, official_malone, bug_supervisor, security_contact, driver, bugtracker, development_focus, homepage_content, icon, mugshot, logo, official_answers, private_bugs, private_specs, license_info, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, license_approved, registrant, remote_product, translation_focus, max_bug_heat, date_next_suggest_packaging, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, enable_bugfiling_duplicate_search) VALUES (6, 5, 12, 'gnome-terminal', 'GNOME Terminal', 'The GNOME Terminal Emulator', 'Gnome Terminal is a simple terminal application for your Gnome desktop. It allows quick access to console applications, supports all console types, and has many useful features such as tabbed consoles (many consoles in a single window with quick switching between them).', 'The Gnome Terminal application fully supports Gnome 2 and is a standard part of the Gnome Desktop.', '2004-09-24 20:58:02.256678', 'http://www.gnome.org/', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, true, NULL, false, NULL, 1, false, false, NULL, NULL, NULL, 2, 14, NULL, NULL, NULL, NULL, false, false, false, NULL, false, false, NULL, NULL, false, 12, 'gnome-terminal', NULL, NULL, NULL, NULL, 10, 10, 10, true);
INSERT INTO product (id, project, owner, name, displayname, title, summary, description, datecreated, homepageurl, screenshotsurl, wikiurl, listurl, programminglang, downloadurl, lastdoap, sourceforgeproject, freshmeatproject, reviewed, active, fti, autoupdate, translationgroup, translationpermission, official_rosetta, official_malone, bug_supervisor, security_contact, driver, bugtracker, development_focus, homepage_content, icon, mugshot, logo, official_answers, private_bugs, private_specs, license_info, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, license_approved, registrant, remote_product, translation_focus, max_bug_heat, date_next_suggest_packaging, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, enable_bugfiling_duplicate_search) VALUES (7, 6, 12, 'iso-codes', 'iso-codes', 'The iso-codes', 'foo', 'bar', '2004-09-24 20:58:02.258743', 'http://www.novell.com/', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, true, NULL, false, NULL, 1, false, false, NULL, NULL, NULL, NULL, 13, NULL, NULL, NULL, NULL, false, false, false, NULL, false, false, NULL, NULL, false, 12, NULL, NULL, NULL, NULL, NULL, 10, 10, 10, true);
INSERT INTO product (id, project, owner, name, displayname, title, summary, description, datecreated, homepageurl, screenshotsurl, wikiurl, listurl, programminglang, downloadurl, lastdoap, sourceforgeproject, freshmeatproject, reviewed, active, fti, autoupdate, translationgroup, translationpermission, official_rosetta, official_malone, bug_supervisor, security_contact, driver, bugtracker, development_focus, homepage_content, icon, mugshot, logo, official_answers, private_bugs, private_specs, license_info, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, license_approved, registrant, remote_product, translation_focus, max_bug_heat, date_next_suggest_packaging, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, enable_bugfiling_duplicate_search) VALUES (8, 4, 12, 'thunderbird', 'Mozilla Thunderbird', 'Mozilla Thunderbird', 'The Mozilla Thunderbird email client', 'The Mozilla Thunderbird email client', '2004-09-24 20:58:04.478988', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, true, NULL, false, NULL, 1, false, false, NULL, NULL, NULL, NULL, 4, NULL, NULL, NULL, NULL, false, false, false, NULL, false, false, NULL, NULL, false, 12, NULL, NULL, NULL, NULL, NULL, 10, 10, 10, true);
@@ -1877,7 +1877,7 @@
INSERT INTO product (id, project, owner, name, displayname, title, summary, description, datecreated, homepageurl, screenshotsurl, wikiurl, listurl, programminglang, downloadurl, lastdoap, sourceforgeproject, freshmeatproject, reviewed, active, fti, autoupdate, translationgroup, translationpermission, official_rosetta, official_malone, bug_supervisor, security_contact, driver, bugtracker, development_focus, homepage_content, icon, mugshot, logo, official_answers, private_bugs, private_specs, license_info, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, license_approved, registrant, remote_product, translation_focus, max_bug_heat, date_next_suggest_packaging, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, enable_bugfiling_duplicate_search) VALUES (12, NULL, 16, 'a52dec', 'a52dec', 'Liba52 Test Decoder', 'a52dec is a test program for liba52.', 'This tool decodes ATSC A/52 streams, and also includes a demultiplexer for mpeg-1 and mpeg-2 program streams. The liba52 source code is always distributed in the a52dec package, to make sure it easier for people to test it.', '2005-04-14 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, true, NULL, false, NULL, 1, false, false, NULL, NULL, NULL, NULL, 6, NULL, NULL, NULL, NULL, false, false, false, NULL, false, false, NULL, NULL, false, 16, NULL, NULL, NULL, NULL, NULL, 10, 10, 10, true);
INSERT INTO product (id, project, owner, name, displayname, title, summary, description, datecreated, homepageurl, screenshotsurl, wikiurl, listurl, programminglang, downloadurl, lastdoap, sourceforgeproject, freshmeatproject, reviewed, active, fti, autoupdate, translationgroup, translationpermission, official_rosetta, official_malone, bug_supervisor, security_contact, driver, bugtracker, development_focus, homepage_content, icon, mugshot, logo, official_answers, private_bugs, private_specs, license_info, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, license_approved, registrant, remote_product, translation_focus, max_bug_heat, date_next_suggest_packaging, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, enable_bugfiling_duplicate_search) VALUES (13, 5, 16, 'gnomebaker', 'gnomebaker', 'Gnome Baker', 'Gnome Baker is a CD burning application', 'Gnome Baker burns CDs like there''s no tomorrow', '2005-08-26 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, true, NULL, false, NULL, 1, false, false, NULL, NULL, NULL, NULL, 11, NULL, NULL, NULL, NULL, false, false, false, NULL, false, false, NULL, NULL, false, 16, NULL, NULL, NULL, NULL, NULL, 10, 10, 10, true);
INSERT INTO product (id, project, owner, name, displayname, title, summary, description, datecreated, homepageurl, screenshotsurl, wikiurl, listurl, programminglang, downloadurl, lastdoap, sourceforgeproject, freshmeatproject, reviewed, active, fti, autoupdate, translationgroup, translationpermission, official_rosetta, official_malone, bug_supervisor, security_contact, driver, bugtracker, development_focus, homepage_content, icon, mugshot, logo, official_answers, private_bugs, private_specs, license_info, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, license_approved, registrant, remote_product, translation_focus, max_bug_heat, date_next_suggest_packaging, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, enable_bugfiling_duplicate_search) VALUES (14, NULL, 12, 'bazaar', 'Bazaar', 'Bazaar', 'Bazaar is a distributed revision control system', 'Bazaar is all about source control and double-dashes.', '2005-08-26 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, true, NULL, false, NULL, 1, false, false, NULL, NULL, NULL, NULL, 10, NULL, NULL, NULL, NULL, false, false, false, NULL, false, false, NULL, NULL, false, 12, NULL, NULL, NULL, NULL, NULL, 10, 10, 10, true);
-INSERT INTO product (id, project, owner, name, displayname, title, summary, description, datecreated, homepageurl, screenshotsurl, wikiurl, listurl, programminglang, downloadurl, lastdoap, sourceforgeproject, freshmeatproject, reviewed, active, fti, autoupdate, translationgroup, translationpermission, official_rosetta, official_malone, bug_supervisor, security_contact, driver, bugtracker, development_focus, homepage_content, icon, mugshot, logo, official_answers, private_bugs, private_specs, license_info, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, license_approved, registrant, remote_product, translation_focus, max_bug_heat, date_next_suggest_packaging, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, enable_bugfiling_duplicate_search) VALUES (15, NULL, 1, 'alsa-utils', 'alsa-utils', 'ALSA utilities', 'Utilities for configurating and using the Advanced Linux Sound Architecture', '', '2005-09-15 09:05:11.472752', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, true, true, NULL, false, NULL, 1, true, false, NULL, NULL, NULL, NULL, 8, NULL, NULL, NULL, NULL, false, false, false, NULL, false, false, NULL, NULL, false, 1, NULL, NULL, NULL, NULL, NULL, 10, 10, 10, true);
+INSERT INTO product (id, project, owner, name, displayname, title, summary, description, datecreated, homepageurl, screenshotsurl, wikiurl, listurl, programminglang, downloadurl, lastdoap, sourceforgeproject, freshmeatproject, reviewed, active, fti, autoupdate, translationgroup, translationpermission, official_rosetta, official_malone, bug_supervisor, security_contact, driver, bugtracker, development_focus, homepage_content, icon, mugshot, logo, official_answers, private_bugs, private_specs, license_info, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, license_approved, registrant, remote_product, translation_focus, max_bug_heat, date_next_suggest_packaging, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, enable_bugfiling_duplicate_search) VALUES (15, NULL, 1, 'alsa-utils', 'alsa-utils', 'ALSA utilities', 'Utilities for configurating and using the Advanced Linux Sound Architecture', '', '2005-09-15 09:05:11.472752', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, true, true, NULL, false, NULL, 1, true, false, NULL, NULL, NULL, NULL, 8, NULL, NULL, NULL, NULL, false, false, false, NULL, false, false, NULL, NULL, false, 1, NULL, NULL, NULL, NULL, NULL, 10, 10, 20, true);
INSERT INTO product (id, project, owner, name, displayname, title, summary, description, datecreated, homepageurl, screenshotsurl, wikiurl, listurl, programminglang, downloadurl, lastdoap, sourceforgeproject, freshmeatproject, reviewed, active, fti, autoupdate, translationgroup, translationpermission, official_rosetta, official_malone, bug_supervisor, security_contact, driver, bugtracker, development_focus, homepage_content, icon, mugshot, logo, official_answers, private_bugs, private_specs, license_info, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, license_approved, registrant, remote_product, translation_focus, max_bug_heat, date_next_suggest_packaging, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, enable_bugfiling_duplicate_search) VALUES (16, NULL, 12, 'landscape', 'The Landscape Project', 'The Landscape Project', 'Landscape is a system being developed by Canonical to allow remote management of systems using a web interface.', 'Landscape is a system being developed by Canonical to allow remote management of systems using a web interface. The scope of the project isn''t limited, and will grow up as new features are planned.
The Landscape system consists of two major parts: a client daemon which delivers information to the server and acts on server-provided requests; and a web server responsible for handling communication with clients and the user interface itself.', '2006-07-11 19:59:17.311451', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false, true, NULL, false, NULL, 1, false, true, 64, NULL, NULL, NULL, 9, NULL, NULL, NULL, NULL, false, true, false, NULL, false, false, NULL, NULL, false, 12, NULL, NULL, NULL, NULL, NULL, 10, 10, 10, true);
=== modified file 'lib/canonical/launchpad/database/launchpadstatistic.py'
--- lib/canonical/launchpad/database/launchpadstatistic.py 2011-05-12 18:25:06 +0000
+++ lib/canonical/launchpad/database/launchpadstatistic.py 2011-10-10 11:42:28 +0000
@@ -163,14 +163,10 @@
Product.selectBy(project_reviewed=True, active=True).count())
def _updateRosettaStatistics(self, ztm):
- # XXX j.c.sackett 2010-11-19 bug=677532 It's less than ideal that
- # this query is using _translations_usage, but there's no cleaner
- # way to deal with it. Once the bug above is resolved, this should
- # should be fixed to use translations_usage.
self.update(
'products_using_rosetta',
Product.selectBy(
- _translations_usage=ServiceUsage.LAUNCHPAD).count())
+ translations_usage=ServiceUsage.LAUNCHPAD).count())
self.update('potemplate_count', POTemplate.select().count())
ztm.commit()
self.update('pofile_count', POFile.select().count())
=== modified file 'lib/lp/app/interfaces/launchpad.py'
--- lib/lp/app/interfaces/launchpad.py 2011-07-21 22:42:14 +0000
+++ lib/lp/app/interfaces/launchpad.py 2011-10-10 11:42:28 +0000
@@ -117,9 +117,6 @@
official_malone = Bool(
title=_('Bugs in this project are tracked in Launchpad'),
required=True)
- official_rosetta = Bool(
- title=_('Translations for this project are done in Launchpad'),
- required=True)
official_anything = Bool(
title=_('Uses Launchpad for something'))
enable_bug_expiration = Bool(
=== modified file 'lib/lp/registry/browser/distribution.py'
--- lib/lp/registry/browser/distribution.py 2011-09-18 19:00:21 +0000
+++ lib/lp/registry/browser/distribution.py 2011-10-10 11:42:28 +0000
@@ -815,7 +815,7 @@
"members",
"official_malone",
"blueprints_usage",
- "official_rosetta",
+ "translations_usage",
"answers_usage",
]
custom_widget('require_virtualized', CheckBoxWidget)
@@ -900,7 +900,7 @@
'official_malone',
'enable_bug_expiration',
'blueprints_usage',
- 'official_rosetta',
+ 'translations_usage',
'answers_usage',
'translation_focus',
]
=== modified file 'lib/lp/registry/browser/tests/distribution-views.txt'
--- lib/lp/registry/browser/tests/distribution-views.txt 2011-09-07 22:09:45 +0000
+++ lib/lp/registry/browser/tests/distribution-views.txt 2011-10-10 11:42:28 +0000
@@ -67,7 +67,7 @@
>>> view.field_names
['name', 'displayname', 'title', 'summary', 'description', 'domainname',
- 'members', 'official_malone', 'blueprints_usage', 'official_rosetta',
+ 'members', 'official_malone', 'blueprints_usage', 'translations_usage',
'answers_usage']
>>> login("admin@xxxxxxxxxxxxx")
@@ -132,7 +132,7 @@
'bug_reporting_guidelines', 'bug_reported_acknowledgement',
'package_derivatives_email', 'icon',
'logo', 'mugshot', 'official_malone', 'enable_bug_expiration',
- 'blueprints_usage', 'official_rosetta', 'answers_usage',
+ 'blueprints_usage', 'translations_usage', 'answers_usage',
'translation_focus']
>>> del form['field.name']
=== modified file 'lib/lp/registry/configure.zcml'
--- lib/lp/registry/configure.zcml 2011-10-05 15:13:36 +0000
+++ lib/lp/registry/configure.zcml 2011-10-10 11:42:28 +0000
@@ -1260,7 +1260,6 @@
<require
permission="launchpad.TranslationsAdmin"
set_attributes="
- official_rosetta
translation_focus
translationgroup
translationpermission"/>
@@ -1550,7 +1549,6 @@
permission="launchpad.TranslationsAdmin"
set_attributes="
language_pack_admin
- official_rosetta
translationgroup
translationpermission
translation_focus"/>
=== modified file 'lib/lp/registry/doc/distribution.txt'
--- lib/lp/registry/doc/distribution.txt 2011-08-25 08:29:37 +0000
+++ lib/lp/registry/doc/distribution.txt 2011-10-10 11:42:28 +0000
@@ -387,8 +387,6 @@
While the other attributes track the other official_ attributes.
- >>> print ubuntu.official_rosetta
- True
>>> print ubuntu.translations_usage.name
LAUNCHPAD
>>> print ubuntu.official_answers
@@ -404,8 +402,8 @@
the usage enums don't know anything.
>>> login_person(ubuntu.owner.teamowner)
- >>> ubuntu.official_rosetta = False
- >>> print ubuntu.translations_usage.name
+ >>> ubuntu.official_answers = False
+ >>> print ubuntu.answers_usage.name
UNKNOWN
A distribution *cannot* specify that it uses codehosting. Currently there's
=== modified file 'lib/lp/registry/interfaces/projectgroup.py'
--- lib/lp/registry/interfaces/projectgroup.py 2011-08-23 04:38:33 +0000
+++ lib/lp/registry/interfaces/projectgroup.py 2011-10-10 11:42:28 +0000
@@ -323,9 +323,10 @@
"""Get all products that can be edited by user."""
def translatables():
- """Return an iterator over products that have resources translatables.
+ """Return an iterator over products that are translatable in LP.
- It also should have IProduct.official_rosetta flag set.
+ Only products with IProduct.translations_usage set to
+ ServiceUsage.LAUNCHPAD are considered translatable.
"""
def has_translatable():
=== modified file 'lib/lp/registry/model/distribution.py'
--- lib/lp/registry/model/distribution.py 2011-09-29 20:21:00 +0000
+++ lib/lp/registry/model/distribution.py 2011-10-10 11:42:28 +0000
@@ -307,8 +307,6 @@
default=False)
official_malone = BoolCol(dbName='official_malone', notNull=True,
default=False)
- official_rosetta = BoolCol(dbName='official_rosetta', notNull=True,
- default=False)
@property
def official_codehosting(self):
@@ -321,7 +319,8 @@
@property
def official_anything(self):
- return True in (self.official_malone, self.official_rosetta,
+ return True in (self.official_malone,
+ self.translations_usage == ServiceUsage.LAUNCHPAD,
self.official_blueprints, self.official_answers)
_answers_usage = EnumCol(
@@ -374,31 +373,11 @@
_set_blueprints_usage,
doc="Indicates if the product uses the blueprints service.")
- _translations_usage = EnumCol(
+ translations_usage = EnumCol(
dbName="translations_usage", notNull=True,
schema=ServiceUsage,
default=ServiceUsage.UNKNOWN)
- def _get_translations_usage(self):
- if self._translations_usage != ServiceUsage.UNKNOWN:
- # If someone has set something with the enum, use it.
- return self._translations_usage
- elif self.official_rosetta:
- return ServiceUsage.LAUNCHPAD
- return self._translations_usage
-
- def _set_translations_usage(self, val):
- self._translations_usage = val
- if val == ServiceUsage.LAUNCHPAD:
- self.official_rosetta = True
- else:
- self.official_rosetta = False
-
- translations_usage = property(
- _get_translations_usage,
- _set_translations_usage,
- doc="Indicates if the product uses the translations service.")
-
@property
def codehosting_usage(self):
return ServiceUsage.NOT_APPLICABLE
=== modified file 'lib/lp/registry/model/product.py'
--- lib/lp/registry/model/product.py 2011-09-28 03:28:50 +0000
+++ lib/lp/registry/model/product.py 2011-10-10 11:42:28 +0000
@@ -378,8 +378,6 @@
dbName='official_blueprints', notNull=True, default=False)
official_malone = BoolCol(
dbName='official_malone', notNull=True, default=False)
- official_rosetta = BoolCol(
- dbName='official_rosetta', notNull=True, default=False)
remote_product = Unicode(
name='remote_product', allow_none=True, default=None)
max_bug_heat = Int()
@@ -403,7 +401,8 @@
@property
def official_anything(self):
- return True in (self.official_malone, self.official_rosetta,
+ return True in (self.official_malone,
+ self.translations_usage == ServiceUsage.LAUNCHPAD,
self.official_blueprints, self.official_answers,
self.official_codehosting)
@@ -415,7 +414,7 @@
dbName="blueprints_usage", notNull=True,
schema=ServiceUsage,
default=ServiceUsage.UNKNOWN)
- _translations_usage = EnumCol(
+ translations_usage = EnumCol(
dbName="translations_usage", notNull=True,
schema=ServiceUsage,
default=ServiceUsage.UNKNOWN)
@@ -694,26 +693,6 @@
_set_blueprints_usage,
doc="Indicates if the product uses the blueprints service.")
- def _get_translations_usage(self):
- if self._translations_usage != ServiceUsage.UNKNOWN:
- # If someone has set something with the enum, use it.
- return self._translations_usage
- elif self.official_rosetta:
- return ServiceUsage.LAUNCHPAD
- return self._translations_usage
-
- def _set_translations_usage(self, val):
- self._translations_usage = val
- if val == ServiceUsage.LAUNCHPAD:
- self.official_rosetta = True
- else:
- self.official_rosetta = False
-
- translations_usage = property(
- _get_translations_usage,
- _set_translations_usage,
- doc="Indicates if the product uses the translations service.")
-
@cachedproperty
def _cached_licenses(self):
"""Get the licenses as a tuple."""
@@ -1670,16 +1649,12 @@
def getTranslatables(self):
"""See `IProductSet`"""
- # XXX j.c.sackett 2010-11-19 bug=677532 It's less than ideal that
- # this query is using _translations_usage, but there's no cleaner
- # way to deal with it. Once the bug above is resolved, this should
- # should be fixed to use translations_usage.
results = IStore(Product).find(
(Product, Person),
Product.active == True,
Product.id == ProductSeries.productID,
POTemplate.productseriesID == ProductSeries.id,
- Product._translations_usage == ServiceUsage.LAUNCHPAD,
+ Product.translations_usage == ServiceUsage.LAUNCHPAD,
Person.id == Product._ownerID).config(
distinct=True).order_by(Product.title)
=== modified file 'lib/lp/registry/model/projectgroup.py'
--- lib/lp/registry/model/projectgroup.py 2011-08-24 04:07:31 +0000
+++ lib/lp/registry/model/projectgroup.py 2011-10-10 11:42:28 +0000
@@ -201,14 +201,10 @@
Join(ProductSeries, Product.id == ProductSeries.productID),
Join(POTemplate, ProductSeries.id == POTemplate.productseriesID),
]
- # XXX j.c.sackett 2010-11-19 bug=677532 It's less than ideal that
- # this query is using _translations_usage, but there's no cleaner
- # way to deal with it. Once the bug above is resolved, this should
- # should be fixed to use translations_usage.
return store.using(*origin).find(
Product,
Product.project == self.id,
- Product._translations_usage == ServiceUsage.LAUNCHPAD,
+ Product.translations_usage == ServiceUsage.LAUNCHPAD,
).config(distinct=True)
def has_translatable(self):
=== modified file 'lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt'
--- lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt 2011-09-07 09:24:32 +0000
+++ lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.txt 2011-10-10 11:42:28 +0000
@@ -29,8 +29,8 @@
>>> print registrant.url
http://launchpad.dev/ubuntu/+edit
- >>> print registrant.getControl(name='field.official_rosetta').value
- True
+ >>> print registrant.getControl(name='field.translations_usage').value[0]
+ LAUNCHPAD
>>> print registrant.getControl(name='field.official_malone').value
True
>>> print registrant.getControl(name='field.enable_bug_expiration').value
@@ -45,7 +45,8 @@
... name='field.enabled_restricted_families').value
['arm']
- >>> registrant.getControl(name='field.official_rosetta').value = False
+ >>> registrant.getControl(name='field.translations_usage').value = [
+ ... 'UNKNOWN']
>>> registrant.getControl('Change', index=3).click()
Just like Launchpad administrators can.
@@ -54,8 +55,8 @@
>>> admin_browser.getLink('Change details').click()
>>> print admin_browser.title
Change Ubuntu details...
- >>> print admin_browser.getControl(name='field.official_rosetta').value
- False
+ >>> print admin_browser.getControl(name='field.translations_usage').value[0]
+ UNKNOWN
>>> print admin_browser.getControl(name='field.official_malone').value
True
>>> print admin_browser.getControl(
=== modified file 'lib/lp/registry/tests/test_service_usage.py'
--- lib/lp/registry/tests/test_service_usage.py 2011-08-12 11:37:08 +0000
+++ lib/lp/registry/tests/test_service_usage.py 2011-10-10 11:42:28 +0000
@@ -61,15 +61,6 @@
ServiceUsage.UNKNOWN,
self.target.translations_usage)
- def test_translations_usage_using_bool(self):
- # If the old bool says they use Launchpad, return LAUNCHPAD
- # if the ServiceUsage is unknown.
- login_person(self.target.owner)
- self.target.official_rosetta = True
- self.assertEqual(
- ServiceUsage.LAUNCHPAD,
- self.target.translations_usage)
-
def test_translations_usage_with_enum_data(self):
# If the enum has something other than UNKNOWN as its status,
# use that.
@@ -79,18 +70,6 @@
ServiceUsage.EXTERNAL,
self.target.translations_usage)
- def test_translations_setter(self):
- login_person(self.target.owner)
- self.target.official_rosetta = True
- self.target.translations_usage = ServiceUsage.EXTERNAL
- self.assertEqual(
- False,
- self.target.official_rosetta)
- self.target.translations_usage = ServiceUsage.LAUNCHPAD
- self.assertEqual(
- True,
- self.target.official_rosetta)
-
def test_bug_tracking_usage(self):
# Only test get for bug_tracking; this has no setter because the
# state is derived from other data.
=== modified file 'lib/lp/translations/browser/distribution.py'
--- lib/lp/translations/browser/distribution.py 2011-09-07 09:24:32 +0000
+++ lib/lp/translations/browser/distribution.py 2011-10-10 11:42:28 +0000
@@ -132,7 +132,7 @@
label = "Translations settings"
page_title = "Settings"
field_names = [
- "official_rosetta",
+ "translations_usage",
"translation_focus",
"translationgroup",
"translationpermission",
=== modified file 'lib/lp/translations/browser/potemplate.py'
--- lib/lp/translations/browser/potemplate.py 2011-09-15 11:35:28 +0000
+++ lib/lp/translations/browser/potemplate.py 2011-10-10 11:42:28 +0000
@@ -961,8 +961,8 @@
.joinOuter(Product, And(
Product.id == ProductSeries.productID,
Or(
- Product._translations_usage == ServiceUsage.LAUNCHPAD,
- Product._translations_usage == ServiceUsage.EXTERNAL)))
+ Product.translations_usage == ServiceUsage.LAUNCHPAD,
+ Product.translations_usage == ServiceUsage.EXTERNAL)))
.joinOuter(OtherTemplate, And(
OtherTemplate.productseriesID == ProductSeries.id,
OtherTemplate.name == POTemplate.name))
=== modified file 'lib/lp/translations/browser/tests/test_baseexportview.py'
--- lib/lp/translations/browser/tests/test_baseexportview.py 2011-08-12 14:57:27 +0000
+++ lib/lp/translations/browser/tests/test_baseexportview.py 2011-10-10 11:42:28 +0000
@@ -148,7 +148,6 @@
def setUp(self):
super(TestProductSeries, self).setUp()
self.container = self.factory.makeProductSeries()
- self.container.product.official_rosetta = True
self.view = ProductSeriesTranslationsExportView(
self.container, LaunchpadTestRequest())
@@ -166,7 +165,6 @@
def setUp(self):
super(TestSourcePackage, self).setUp()
self.container = self.factory.makeSourcePackage()
- self.container.distroseries.distribution.official_rosetta = True
self.view = SourcePackageTranslationsExportView(
self.container, LaunchpadTestRequest())
@@ -178,7 +176,6 @@
def setUp(self):
super(TestPOExportQueueStatusDescriptions, self).setUp()
self.container = self.factory.makeProductSeries()
- self.container.product.official_rosetta = True
self.view = ProductSeriesTranslationsExportView(
self.container, LaunchpadTestRequest())
=== modified file 'lib/lp/translations/browser/tests/test_distroserieslanguage_views.py'
--- lib/lp/translations/browser/tests/test_distroserieslanguage_views.py 2011-08-03 11:00:11 +0000
+++ lib/lp/translations/browser/tests/test_distroserieslanguage_views.py 2011-10-10 11:42:28 +0000
@@ -29,7 +29,6 @@
# Create a distroseries that uses translations.
TestCaseWithFactory.setUp(self)
self.distroseries = self.factory.makeDistroSeries()
- self.distroseries.distribution.official_rosetta = True
self.language = getUtility(ILanguageSet).getLanguageByCode('sr')
sourcepackagename = self.factory.makeSourcePackageName()
potemplate = self.factory.makePOTemplate(
=== modified file 'lib/lp/translations/browser/tests/test_product_view.py'
--- lib/lp/translations/browser/tests/test_product_view.py 2011-08-12 11:37:08 +0000
+++ lib/lp/translations/browser/tests/test_product_view.py 2011-10-10 11:42:28 +0000
@@ -8,6 +8,7 @@
DatabaseFunctionalLayer,
LaunchpadZopelessLayer,
)
+from lp.app.enums import ServiceUsage
from lp.registry.interfaces.series import SeriesStatus
from lp.testing import (
login_person,
@@ -26,7 +27,7 @@
# Create a product that uses translations.
product = self.factory.makeProduct()
series = product.development_focus
- product.official_rosetta = True
+ product.translations_usage = ServiceUsage.LAUNCHPAD
view = ProductView(product, LaunchpadTestRequest())
# If development focus series is linked to
@@ -35,7 +36,8 @@
# for the package.
sourcepackage = self.factory.makeSourcePackage()
sourcepackage.setPackaging(series, None)
- sourcepackage.distroseries.distribution.official_rosetta = True
+ sourcepackage.distroseries.distribution.translations_usage = (
+ ServiceUsage.LAUNCHPAD)
pot = self.factory.makePOTemplate(
distroseries=sourcepackage.distroseries,
sourcepackagename=sourcepackage.sourcepackagename)
@@ -45,7 +47,7 @@
# Create a product that uses translations.
product = self.factory.makeProduct()
series_trunk = product.development_focus
- product.official_rosetta = True
+ product.translations_usage = ServiceUsage.LAUNCHPAD
view = ProductView(product, LaunchpadTestRequest())
# New series are added, one for each type of status
=== modified file 'lib/lp/translations/browser/tests/test_productserieslanguage_views.py'
--- lib/lp/translations/browser/tests/test_productserieslanguage_views.py 2010-10-28 14:05:38 +0000
+++ lib/lp/translations/browser/tests/test_productserieslanguage_views.py 2011-10-10 11:42:28 +0000
@@ -31,7 +31,6 @@
# Create a productseries that uses translations.
super(TestProductSeriesView, self).setUp()
self.productseries = self.factory.makeProductSeries()
- self.productseries.product.official_rosetta = True
self.product = self.productseries.product
def _createView(self):
@@ -253,7 +252,6 @@
# Create a productseries that uses translations.
super(TestProductSeriesLanguageView, self).setUp()
self.productseries = self.factory.makeProductSeries()
- self.productseries.product.official_rosetta = True
self.language = self.factory.makeLanguage()
potemplate = self.factory.makePOTemplate(
productseries=self.productseries)
=== modified file 'lib/lp/translations/browser/tests/test_translationimportqueueentry.py'
--- lib/lp/translations/browser/tests/test_translationimportqueueentry.py 2010-10-04 19:50:45 +0000
+++ lib/lp/translations/browser/tests/test_translationimportqueueentry.py 2011-10-10 11:42:28 +0000
@@ -16,6 +16,7 @@
from canonical.launchpad.webapp import canonical_url
from canonical.launchpad.webapp.servers import LaunchpadTestRequest
from canonical.testing.layers import LaunchpadFunctionalLayer
+from lp.app.enums import ServiceUsage
from lp.testing import (
TestCase,
TestCaseWithFactory,
@@ -41,7 +42,7 @@
def _makeProductSeries(self):
"""Set up a product series for a translatable product."""
product = self.factory.makeProduct()
- product.official_rosetta = True
+ product.translations_usage = ServiceUsage.LAUNCHPAD
return product.getSeries('trunk')
def _makeView(self, entry):
=== modified file 'lib/lp/translations/browser/tests/test_translationlinksaggregator.py'
--- lib/lp/translations/browser/tests/test_translationlinksaggregator.py 2011-08-12 11:37:08 +0000
+++ lib/lp/translations/browser/tests/test_translationlinksaggregator.py 2011-10-10 11:42:28 +0000
@@ -7,6 +7,7 @@
from canonical.launchpad.webapp import canonical_url
from canonical.testing.layers import LaunchpadZopelessLayer
+from lp.app.enums import ServiceUsage
from lp.testing import TestCaseWithFactory
from lp.translations.browser.translationlinksaggregator import (
TranslationLinksAggregator,
@@ -129,7 +130,8 @@
# For package POFiles in the same template but different
# languages, we link to the template.
package = self.factory.makeSourcePackage()
- package.distroseries.distribution.official_rosetta = True
+ package.distroseries.distribution.translations_usage = (
+ ServiceUsage.LAUNCHPAD)
template = self.factory.makePOTemplate(
distroseries=package.distroseries,
sourcepackagename=package.sourcepackagename)
@@ -147,7 +149,8 @@
# package's template list. There is no "source package series
# language" page.
package = self.factory.makeSourcePackage()
- package.distroseries.distribution.official_rosetta = True
+ package.distroseries.distribution.translations_usage = (
+ ServiceUsage.LAUNCHPAD)
template1 = self.factory.makePOTemplate(
distroseries=package.distroseries,
sourcepackagename=package.sourcepackagename)
@@ -208,7 +211,8 @@
removeSecurityProxy(product_pofile).unreviewed_count = 1
package = self.factory.makeSourcePackage()
- package.distroseries.distribution.official_rosetta = True
+ package.distroseries.distribution.translations_usage = (
+ ServiceUsage.LAUNCHPAD)
package_template = self.factory.makePOTemplate(
distroseries=package.distroseries,
sourcepackagename=package.sourcepackagename)
@@ -245,7 +249,8 @@
# _aggregateTranslationTargets describes POFiles for the same
# ProductSeries together.
package = self.factory.makeSourcePackage()
- package.distroseries.distribution.official_rosetta = True
+ package.distroseries.distribution.translations_usage = (
+ ServiceUsage.LAUNCHPAD)
template1 = self.factory.makePOTemplate(
distroseries=package.distroseries,
sourcepackagename=package.sourcepackagename)
=== modified file 'lib/lp/translations/doc/potmsgset.txt'
--- lib/lp/translations/doc/potmsgset.txt 2011-03-07 05:52:19 +0000
+++ lib/lp/translations/doc/potmsgset.txt 2011-10-10 11:42:28 +0000
@@ -402,7 +402,7 @@
>>> ubuntu.translations_usage = ServiceUsage.NOT_APPLICABLE
# We set the template as current again so we are sure that we don't show
- # suggestions just due to the change to the official_rosetta flag.
+ # suggestions just due to the change to the translations_usage flag.
>>> evo_distro_template.iscurrent = True
>>> transaction.commit()
>>> suggestions = (
@@ -526,7 +526,7 @@
Launchpad for translations.
# We set the template as current again so we are sure that we don't show
- # suggestions just due to the change to the official_rosetta flag.
+ # suggestions just due to the change to the translations_usage flag.
>>> evo_man_template.iscurrent = True
>>> ubuntu.translations_usage = ServiceUsage.NOT_APPLICABLE
>>> refresh_suggestive_templates_cache()
=== modified file 'lib/lp/translations/interfaces/hastranslationtemplates.py'
--- lib/lp/translations/interfaces/hastranslationtemplates.py 2011-03-24 20:48:35 +0000
+++ lib/lp/translations/interfaces/hastranslationtemplates.py 2011-10-10 11:42:28 +0000
@@ -62,9 +62,8 @@
def getCurrentTemplatesCollection():
"""Return `TranslationTemplatesCollection` of current templates.
- A translation template is considered active when both
- `IPOTemplate`.iscurrent and the `official_rosetta` flag for its
- containing `Product` or `Distribution` are set to True.
+ A translation template is considered active when
+ `IPOTemplate`.iscurrent flag is set to True.
"""
def getCurrentTranslationTemplates(just_ids=False):
@@ -74,9 +73,8 @@
than the full `POTemplate`. Used to save time on retrieving
and deserializing the objects from the database.
- A translation template is considered active when both
- `IPOTemplate`.iscurrent and the `official_rosetta` flag for its
- containing `Product` or `Distribution` are set to True.
+ A translation template is considered active when
+ `IPOTemplate`.iscurrent is set to True.
"""
def getCurrentTranslationFiles(just_ids=False):
=== modified file 'lib/lp/translations/model/potemplate.py'
--- lib/lp/translations/model/potemplate.py 2011-09-25 02:26:18 +0000
+++ lib/lp/translations/model/potemplate.py 2011-10-10 11:42:28 +0000
@@ -69,6 +69,7 @@
IMasterStore,
IStore,
)
+from lp.app.enums import ServiceUsage
from lp.app.errors import NotFoundError
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
from lp.registry.interfaces.person import validate_public_person
@@ -1385,9 +1386,6 @@
def populateSuggestivePOTemplatesCache(self):
"""See `IPOTemplateSet`."""
- # XXX j.c.sackett 2010-08-30 bug=627631 Once data migration has
- # happened for the usage enums, this sql needs to be updated to
- # check for the translations_usage, not official_rosetta.
return IMasterStore(POTemplate).execute("""
INSERT INTO SuggestivePOTemplate (
SELECT POTemplate.id
@@ -1402,11 +1400,14 @@
Product.id = ProductSeries.product
WHERE
POTemplate.iscurrent AND (
- Distribution.official_rosetta OR
- Product.official_rosetta)
+ Distribution.translations_usage IN %(usage)s OR
+ Product.translations_usage IN %(usage)s)
ORDER BY POTemplate.id
)
- """).rowcount
+ """ % {
+ 'usage' : sqlvalues(
+ ServiceUsage.LAUNCHPAD, ServiceUsage.EXTERNAL) }
+ ).rowcount
class POTemplateSharingSubset(object):
=== modified file 'lib/lp/translations/model/translationsperson.py'
--- lib/lp/translations/model/translationsperson.py 2011-08-20 15:57:24 +0000
+++ lib/lp/translations/model/translationsperson.py 2011-10-10 11:42:28 +0000
@@ -278,7 +278,7 @@
# translation focus.
distrojoin_conditions = And(
Distribution.id == DistroSeries.distributionID,
- Distribution._translations_usage == ServiceUsage.LAUNCHPAD,
+ Distribution.translations_usage == ServiceUsage.LAUNCHPAD,
Distribution.translation_focusID == DistroSeries.id)
DistroJoin = LeftJoin(Distribution, distrojoin_conditions)
@@ -291,7 +291,7 @@
# should be fixed to use translations_usage.
ProductJoin = LeftJoin(Product, And(
Product.id == ProductSeries.productID,
- Product._translations_usage == ServiceUsage.LAUNCHPAD,
+ Product.translations_usage == ServiceUsage.LAUNCHPAD,
Product.active == True))
ProjectJoin = LeftJoin(
=== modified file 'lib/lp/translations/scripts/tests/test_cache_suggestive_templates.py'
--- lib/lp/translations/scripts/tests/test_cache_suggestive_templates.py 2011-07-26 11:28:41 +0000
+++ lib/lp/translations/scripts/tests/test_cache_suggestive_templates.py 2011-10-10 11:42:28 +0000
@@ -13,6 +13,7 @@
MAIN_STORE,
)
from canonical.testing.layers import ZopelessDatabaseLayer
+from lp.app.enums import ServiceUsage
from lp.testing import TestCaseWithFactory
from lp.translations.interfaces.potemplate import IPOTemplateSet
@@ -95,17 +96,17 @@
self.assertContentEqual(cache_before + [pot.id], self._readCache())
- def test_product_official_rosetta_affects_caching(self):
+ def test_product_translations_usage_affects_caching(self):
# Templates from projects are included in the cache only where
# the project uses Launchpad Translations.
productseries = self.factory.makeProductSeries()
- productseries.product.official_rosetta = True
+ productseries.product.translations_usage = ServiceUsage.LAUNCHPAD
pot = self.factory.makePOTemplate(productseries=productseries)
self._refreshCache()
cache_with_template = self._readCache()
- productseries.product.official_rosetta = False
+ productseries.product.translations_usage = ServiceUsage.UNKNOWN
self._refreshCache()
cache_without_template = self._readCache()
@@ -113,11 +114,12 @@
self.assertContentEqual(
cache_with_template, cache_without_template + [pot.id])
- def test_distro_official_rosetta_affects_caching(self):
+ def test_distro_translations_usage_affects_caching(self):
# Templates from distributions are included in the cache only
# where the distribution uses Launchpad Translations.
package = self.factory.makeSourcePackage()
- package.distroseries.distribution.official_rosetta = True
+ package.distroseries.distribution.translations_usage = (
+ ServiceUsage.LAUNCHPAD)
pot = self.factory.makePOTemplate(
distroseries=package.distroseries,
sourcepackagename=package.sourcepackagename)
@@ -125,7 +127,8 @@
cache_with_template = self._readCache()
- package.distroseries.distribution.official_rosetta = False
+ package.distroseries.distribution.translations_usage = (
+ ServiceUsage.UNKNOWN)
self._refreshCache()
cache_without_template = self._readCache()
=== modified file 'lib/lp/translations/scripts/translations_to_branch.py'
--- lib/lp/translations/scripts/translations_to_branch.py 2011-06-23 16:58:19 +0000
+++ lib/lp/translations/scripts/translations_to_branch.py 2011-10-10 11:42:28 +0000
@@ -337,7 +337,7 @@
productseries = self.store.using(product_join).find(
ProductSeries,
And(
- Product._translations_usage == ServiceUsage.LAUNCHPAD,
+ Product.translations_usage == ServiceUsage.LAUNCHPAD,
ProductSeries.translations_branch != None))
# Anything deterministic will do, and even that is only for
=== modified file 'lib/lp/translations/tests/test_pofile.py'
--- lib/lp/translations/tests/test_pofile.py 2011-10-05 12:00:05 +0000
+++ lib/lp/translations/tests/test_pofile.py 2011-10-10 11:42:28 +0000
@@ -65,7 +65,6 @@
name='devel', distribution=self.foo)
self.foo_stable = self.factory.makeDistroSeries(
name='stable', distribution=self.foo)
- self.foo.official_rosetta = True
self.sourcepackagename = self.factory.makeSourcePackageName()
# Two POTemplates share translations if they have the same name,
=== modified file 'lib/lp/translations/tests/test_shared_potemplate.py'
--- lib/lp/translations/tests/test_shared_potemplate.py 2011-08-12 11:37:08 +0000
+++ lib/lp/translations/tests/test_shared_potemplate.py 2011-10-10 11:42:28 +0000
@@ -232,7 +232,6 @@
def _makeAndFind(self, names, name_pattern=None):
product = self.factory.makeProduct()
- product.official_rosetta = True
trunk = product.getSeries('trunk')
for name in names:
self.factory.makePOTemplate(productseries=trunk, name=name)
Follow ups