← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stevenk/launchpad/spns-picker into lp:launchpad

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/spns-picker into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~stevenk/launchpad/spns-picker/+merge/63817

The title of this branch is somewhat badly named, but this changes the BinaryAndSourcePackageNameVocab to no longer return descriptions -- since it currently returns just the package description, which is utterly unhelpful.
-- 
https://code.launchpad.net/~stevenk/launchpad/spns-picker/+merge/63817
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/spns-picker into lp:launchpad.
=== modified file 'lib/canonical/launchpad/doc/vocabularies.txt'
--- lib/canonical/launchpad/doc/vocabularies.txt	2011-05-27 19:53:20 +0000
+++ lib/canonical/launchpad/doc/vocabularies.txt	2011-06-08 06:48:32 +0000
@@ -300,8 +300,8 @@
     >>> package_name_terms.count()
     2
     >>> [(term.token, term.title) for term in package_name_terms]
-    [('mozilla-firefox', u'iceweasel huh ?'),
-     ('mozilla-firefox-data', u'Mozilla Firefox Data is .....')]
+    [('mozilla-firefox', u'mozilla-firefox'),
+     ('mozilla-firefox-data', u'mozilla-firefox-data')]
 
 Searching for "mozilla" should return the binary package name above, and
 the source package named "mozilla".
@@ -310,9 +310,9 @@
     >>> package_name_terms.count()
     3
     >>> [(term.token, term.title) for term in package_name_terms]
-    [('mozilla', 'Not uploaded'),
-     ('mozilla-firefox', u'iceweasel huh ?'),
-     ('mozilla-firefox-data', u'Mozilla Firefox Data is .....')]
+    [('mozilla', u'mozilla'),
+     ('mozilla-firefox', u'mozilla-firefox'),
+     ('mozilla-firefox-data', u'mozilla-firefox-data')]
 
 The search does a case-insensitive, substring match.
 
@@ -320,8 +320,8 @@
     >>> package_name_terms.count()
     2
     >>> [(term.token, term.title) for term in package_name_terms]
-    [('linux-2.6.12', u'this kernel is like the crystal method: a temple...'),
-     ('linux-source-2.6.15', u'Source of: linux-2.6.12')]
+    [('linux-2.6.12', u'linux-2.6.12'),
+     ('linux-source-2.6.15', u'linux-source-2.6.15')]
 
 
 BinaryPackageNameVocabulary

=== modified file 'lib/lp/soyuz/model/binaryandsourcepackagename.py'
--- lib/lp/soyuz/model/binaryandsourcepackagename.py	2010-12-22 02:48:42 +0000
+++ lib/lp/soyuz/model/binaryandsourcepackagename.py	2011-06-08 06:48:32 +0000
@@ -18,9 +18,7 @@
     BatchedCountableIterator,
     NamedSQLObjectHugeVocabulary,
     )
-from lp.registry.model.sourcepackagename import getSourcePackageDescriptions
 from lp.soyuz.interfaces.binarypackagename import IBinaryAndSourcePackageName
-from lp.soyuz.model.binarypackagename import getBinaryPackageDescriptions
 
 
 class BinaryAndSourcePackageName(SQLBase):
@@ -45,15 +43,7 @@
     """
 
     def getTermsWithDescriptions(self, results):
-        # Note that we grab first source package descriptions and then
-        # binary package descriptions, giving preference to the latter,
-        # via the update() call.
-        descriptions = getSourcePackageDescriptions(results, use_names=True)
-        binary_descriptions = getBinaryPackageDescriptions(results,
-                                                           use_names=True)
-        descriptions.update(binary_descriptions)
-        return [SimpleTerm(obj, obj.name,
-                    descriptions.get(obj.name, "Not uploaded"))
+        return [SimpleTerm(obj, obj.name, obj.name)
                 for obj in results]