launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #28808
[Merge] ~cjwatson/launchpad:rename-dummy-distro-series-language into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:rename-dummy-distro-series-language into launchpad:master.
Commit message:
Rename DummyDistroSeriesLanguage to EmptyDistroSeriesLanguage
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/426836
This meets inclusive language guidelines, and I think it describes the purpose of the class slightly better.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:rename-dummy-distro-series-language into launchpad:master.
diff --git a/lib/lp/registry/browser/distroseries.py b/lib/lp/registry/browser/distroseries.py
index b9e6028..ee34d1f 100644
--- a/lib/lp/registry/browser/distroseries.py
+++ b/lib/lp/registry/browser/distroseries.py
@@ -182,7 +182,7 @@ class DistroSeriesNavigation(GetitemNavigation, BugTargetTraversalMixin,
# Unknown language code.
raise NotFoundError
- distroserieslang = self.context.getDistroSeriesLanguageOrDummy(lang)
+ distroserieslang = self.context.getDistroSeriesLanguageOrEmpty(lang)
# Check if user is able to view the translations for
# this distribution series language.
diff --git a/lib/lp/registry/interfaces/distroseries.py b/lib/lp/registry/interfaces/distroseries.py
index 66a5479..b6d99db 100644
--- a/lib/lp/registry/interfaces/distroseries.py
+++ b/lib/lp/registry/interfaces/distroseries.py
@@ -665,9 +665,9 @@ class IDistroSeriesPublic(
distribution and the given language.
"""
- def getDistroSeriesLanguageOrDummy(language):
+ def getDistroSeriesLanguageOrEmpty(language):
"""Return the DistroSeriesLanguage for this distroseries and the
- given language, or a DummyDistroSeriesLanguage.
+ given language, or an EmptyDistroSeriesLanguage.
"""
def createUploadedSourcePackageRelease(
diff --git a/lib/lp/registry/model/distroseries.py b/lib/lp/registry/model/distroseries.py
index aff2b47..19e60ec 100644
--- a/lib/lp/registry/model/distroseries.py
+++ b/lib/lp/registry/model/distroseries.py
@@ -161,7 +161,7 @@ from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
from lp.translations.enums import LanguagePackType
from lp.translations.model.distroserieslanguage import (
DistroSeriesLanguage,
- DummyDistroSeriesLanguage,
+ EmptyDistroSeriesLanguage,
)
from lp.translations.model.hastranslationimports import (
HasTranslationImportsMixin,
@@ -907,12 +907,12 @@ class DistroSeries(SQLBase, BugTargetBase, HasSpecificationsMixin,
return IStore(DistroSeriesLanguage).find(
DistroSeriesLanguage, distroseries=self, language=language).one()
- def getDistroSeriesLanguageOrDummy(self, language):
+ def getDistroSeriesLanguageOrEmpty(self, language):
"""See `IDistroSeries`."""
drl = self.getDistroSeriesLanguage(language)
if drl is not None:
return drl
- return DummyDistroSeriesLanguage(self, language)
+ return EmptyDistroSeriesLanguage(self, language)
def updateStatistics(self, ztm):
"""See `IDistroSeries`."""
diff --git a/lib/lp/translations/browser/distroseries.py b/lib/lp/translations/browser/distroseries.py
index 8191792..21bddf4 100644
--- a/lib/lp/translations/browser/distroseries.py
+++ b/lib/lp/translations/browser/distroseries.py
@@ -222,8 +222,8 @@ class DistroSeriesView(LaunchpadView, TranslationsMixin):
"""Produces a list containing a DistroSeriesLanguage object for
each language this distro has been translated into, and for each
of the user's preferred languages. Where the series has no
- DistroSeriesLanguage for that language, we use a
- DummyDistroSeriesLanguage.
+ DistroSeriesLanguage for that language, we use an
+ EmptyDistroSeriesLanguage.
"""
# find the existing DRLanguages
@@ -233,12 +233,12 @@ class DistroSeriesView(LaunchpadView, TranslationsMixin):
existing_languages = {drl.language for drl in distroserieslangs}
# find all the preferred languages which are not in the set of
- # existing languages, and add a dummydistroserieslanguage for each
+ # existing languages, and add an EmptyDistroSeriesLanguage for each
# of them
distroserieslangset = getUtility(IDistroSeriesLanguageSet)
for lang in self.translatable_languages:
if lang not in existing_languages:
- distroserieslang = distroserieslangset.getDummy(
+ distroserieslang = distroserieslangset.getEmpty(
self.context, lang)
distroserieslangs.append(distroserieslang)
diff --git a/lib/lp/translations/browser/tests/test_breadcrumbs.py b/lib/lp/translations/browser/tests/test_breadcrumbs.py
index 75be521..b368e22 100644
--- a/lib/lp/translations/browser/tests/test_breadcrumbs.py
+++ b/lib/lp/translations/browser/tests/test_breadcrumbs.py
@@ -114,7 +114,7 @@ class TestSeriesLanguageBreadcrumbs(BaseBreadcrumbTestCase):
name="test", version="1.0", distribution=distribution)
naked_series = remove_security_proxy_and_shout_at_engineer(series)
naked_series.hide_all_translations = False
- serieslanguage = getUtility(IDistroSeriesLanguageSet).getDummy(
+ serieslanguage = getUtility(IDistroSeriesLanguageSet).getEmpty(
series, self.language)
self.assertBreadcrumbs(
diff --git a/lib/lp/translations/browser/translations.py b/lib/lp/translations/browser/translations.py
index 61b99b1..8109cd7 100644
--- a/lib/lp/translations/browser/translations.py
+++ b/lib/lp/translations/browser/translations.py
@@ -70,7 +70,7 @@ class RosettaApplicationView(LaunchpadView, TranslationsMixin):
langs = []
series = self.ubuntu_translationseries
for language in self.languages:
- langs.append(series.getDistroSeriesLanguageOrDummy(language))
+ langs.append(series.getDistroSeriesLanguageOrEmpty(language))
return langs
def requestCountry(self):
diff --git a/lib/lp/translations/configure.zcml b/lib/lp/translations/configure.zcml
index 4999f12..421921d 100644
--- a/lib/lp/translations/configure.zcml
+++ b/lib/lp/translations/configure.zcml
@@ -230,7 +230,7 @@
for="lp.registry.interfaces.product.IProduct zope.lifecycleevent.interfaces.IObjectModifiedEvent"
handler="lp.translations.subscribers.product_modified"/>
- <!-- DistroSeriesLanguage and Dummy -->
+ <!-- DistroSeriesLanguage and EmptyDistroSeriesLanguage -->
<adapter
provides="lp.services.webapp.interfaces.IBreadcrumb"
@@ -244,7 +244,7 @@
interface="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage"/>
</class>
<class
- class="lp.translations.model.distroserieslanguage.DummyDistroSeriesLanguage">
+ class="lp.translations.model.distroserieslanguage.EmptyDistroSeriesLanguage">
<allow
interface="lp.translations.interfaces.distroserieslanguage.IDistroSeriesLanguage"/>
</class>
diff --git a/lib/lp/translations/doc/canonical_url_examples.rst b/lib/lp/translations/doc/canonical_url_examples.rst
index ced3e02..a17f48b 100644
--- a/lib/lp/translations/doc/canonical_url_examples.rst
+++ b/lib/lp/translations/doc/canonical_url_examples.rst
@@ -149,7 +149,7 @@ DistroSeriesLanguage objects have their URLs on translations vhost.
... IDistroSeriesLanguageSet)
>>> serbian = getUtility(ILanguageSet)['sr']
- >>> boo_bah_serbian = getUtility(IDistroSeriesLanguageSet).getDummy(
+ >>> boo_bah_serbian = getUtility(IDistroSeriesLanguageSet).getEmpty(
... distroseries, serbian)
>>> print(canonical_url(boo_bah_serbian))
http://translations.launchpad.test/boo/bah/+lang/sr
diff --git a/lib/lp/translations/doc/distroseries-language.rst b/lib/lp/translations/doc/distroseries-language.rst
index acb90f1..82b6e2f 100644
--- a/lib/lp/translations/doc/distroseries-language.rst
+++ b/lib/lp/translations/doc/distroseries-language.rst
@@ -100,23 +100,23 @@ hoary_spanish.pofiles is hiding as expected.
Spanish (es) translation of disabled-template in Ubuntu Hoary package
"evolution"
-We also have DummyDistroSeriesLanguages.
+We also have EmptyDistroSeriesLanguages.
>>> amharic = getUtility(ILanguageSet)['am']
- >>> hoary_amharic = hoary.getDistroSeriesLanguageOrDummy(amharic)
+ >>> hoary_amharic = hoary.getDistroSeriesLanguageOrEmpty(amharic)
>>> print(hoary_amharic.__class__)
- <class '...DummyDistroSeriesLanguage'>
+ <class '...EmptyDistroSeriesLanguage'>
English is not a translatable language because we store the source messages
-as English. Thus English cannot be a DummyDistroSeriesLanguage.
+as English. Thus English cannot be an EmptyDistroSeriesLanguage.
>>> english = getUtility(ILanguageSet)['en']
- >>> hoary_english = hoary.getDistroSeriesLanguageOrDummy(english)
+ >>> hoary_english = hoary.getDistroSeriesLanguageOrEmpty(english)
Traceback (most recent call last):
...
AssertionError: English is not a translatable language.
-A DummyDistroSeriesLanguage gives you the same set of templates to
+An EmptyDistroSeriesLanguage gives you the same set of templates to
translate as a regular DistroSeriesLanguage would.
>>> print_augmented_pofiles(hoary_amharic, hoary_templates)
@@ -126,11 +126,11 @@ translate as a regular DistroSeriesLanguage would.
pkgconf-mozilla (am) <class '...pofile.DummyPOFile'>
pmount (am) <class '...pofile.DummyPOFile'>
-Now, we should test that a DummyDistroSeriesLanguage implements the full
+Now, we should test that an EmptyDistroSeriesLanguage implements the full
interface of a normal DistroSeriesLanguage.
NB IF THIS FAILS then it means that the DistroSeriesLanguage object has
-been extended, and the DummyDistroSeriesLanguage has not been similarly
+been extended, and the EmptyDistroSeriesLanguage has not been similarly
extended.
>>> print(IDistroSeriesLanguage.providedBy(hoary_amharic))
diff --git a/lib/lp/translations/interfaces/distroserieslanguage.py b/lib/lp/translations/interfaces/distroserieslanguage.py
index a898a09..0dadcfe 100644
--- a/lib/lp/translations/interfaces/distroserieslanguage.py
+++ b/lib/lp/translations/interfaces/distroserieslanguage.py
@@ -53,7 +53,7 @@ class IDistroSeriesLanguage(IRosettaStats):
class IDistroSeriesLanguageSet(Interface):
"""The set of distroserieslanguages."""
- def getDummy(distroseries, language):
- """Return a new DummyDistroSeriesLanguage for the given
+ def getEmpty(distroseries, language):
+ """Return a new EmptyDistroSeriesLanguage for the given
distroseries and language.
"""
diff --git a/lib/lp/translations/model/distroserieslanguage.py b/lib/lp/translations/model/distroserieslanguage.py
index c25bce0..994c8a4 100644
--- a/lib/lp/translations/model/distroserieslanguage.py
+++ b/lib/lp/translations/model/distroserieslanguage.py
@@ -6,7 +6,7 @@
__all__ = [
'DistroSeriesLanguage',
'DistroSeriesLanguageSet',
- 'DummyDistroSeriesLanguage',
+ 'EmptyDistroSeriesLanguage',
]
from datetime import datetime
@@ -160,7 +160,7 @@ class DistroSeriesLanguage(StormBase, RosettaStats):
@implementer(IDistroSeriesLanguage)
-class DummyDistroSeriesLanguage(RosettaStats):
+class EmptyDistroSeriesLanguage(RosettaStats):
"""See `IDistroSeriesLanguage`
Represents a DistroSeriesLanguage where we do not yet actually HAVE one
@@ -240,9 +240,9 @@ class DummyDistroSeriesLanguage(RosettaStats):
class DistroSeriesLanguageSet:
"""See `IDistroSeriesLanguageSet`.
- Implements a means to get a DummyDistroSeriesLanguage.
+ Implements a means to get an EmptyDistroSeriesLanguage.
"""
- def getDummy(self, distroseries, language):
+ def getEmpty(self, distroseries, language):
"""See IDistroSeriesLanguageSet."""
- return DummyDistroSeriesLanguage(distroseries, language)
+ return EmptyDistroSeriesLanguage(distroseries, language)