~henninge/launchpad/devel-merge-db-stable-9972

« back to all changes in this revision

Viewing changes to lib/lp/registry/doc/distribution.txt

[r=lifeless][ui=none][bug=668047] Fix timeout finding suggested
        ubuntu packages to link to a project.

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
a certain string through the magic of fti. For instance:
173
173
 
174
174
    >>> packages = ubuntu.searchSourcePackageCaches("mozilla")
175
 
    >>> print packages.count()
176
 
    1
 
175
    >>> for distro_source_package_cache, source_name, rank in packages:
 
176
    ...     print "%-17s rank:%s" % (
 
177
    ...         distro_source_package_cache.name,
 
178
    ...         type(rank))
 
179
    mozilla-firefox   rank:<type 'float'>
177
180
 
178
181
The search also matches on exact package names which fti doesn't like,
179
182
and even on substrings:
183
186
    1
184
187
    >>> packages = ubuntu.searchSourcePackageCaches('a')
185
188
    >>> for distro_source_package_cache, source_name, rank in packages:
186
 
    ...     print "%s: %s" % (
 
189
    ...     print "%s: %-17s rank:%s" % (
187
190
    ...         distro_source_package_cache.__class__.__name__,
188
 
    ...         distro_source_package_cache.name)
189
 
    DistributionSourcePackageCache: mozilla-firefox
190
 
    DistributionSourcePackageCache: netapplet
191
 
    DistributionSourcePackageCache: alsa-utils
192
 
    DistributionSourcePackageCache: foobar
193
 
    DistributionSourcePackageCache: commercialpackage
 
191
    ...         distro_source_package_cache.name,
 
192
    ...         type(rank))
 
193
    DistributionSourcePackageCache: alsa-utils        rank:<type 'NoneType'>
 
194
    DistributionSourcePackageCache: commercialpackage rank:<type 'NoneType'>
 
195
    DistributionSourcePackageCache: foobar            rank:<type 'NoneType'>
 
196
    DistributionSourcePackageCache: mozilla-firefox   rank:<type 'NoneType'>
 
197
    DistributionSourcePackageCache: netapplet         rank:<type 'NoneType'>
194
198
 
195
199
The searchSourcePackages() method just returns a decorated version
196
200
of the results from searchSourcePackageCaches():
198
202
    >>> packages = ubuntu.searchSourcePackages('a')
199
203
    >>> for dsp in packages:
200
204
    ...     print "%s: %s" % (dsp.__class__.__name__, dsp.name)
 
205
    DistributionSourcePackage: alsa-utils
 
206
    DistributionSourcePackage: commercialpackage
 
207
    DistributionSourcePackage: foobar
201
208
    DistributionSourcePackage: mozilla-firefox
202
209
    DistributionSourcePackage: netapplet
203
 
    DistributionSourcePackage: alsa-utils
204
 
    DistributionSourcePackage: foobar
205
 
    DistributionSourcePackage: commercialpackage
206
210
 
207
211
searchSourcePackages() also has a has_packaging parameter that
208
212
it just passes on to searchSourcePackageCaches(), and it restricts
212
216
    >>> packages = ubuntu.searchSourcePackages('a', has_packaging=True)
213
217
    >>> for dsp in packages:
214
218
    ...     print "%s: %s" % (dsp.__class__.__name__, dsp.name)
 
219
    DistributionSourcePackage: alsa-utils
215
220
    DistributionSourcePackage: mozilla-firefox
216
221
    DistributionSourcePackage: netapplet
217
 
    DistributionSourcePackage: alsa-utils
218
222
    >>> packages = ubuntu.searchSourcePackages('a', has_packaging=False)
219
223
    >>> for dsp in packages:
220
224
    ...     print "%s: %s" % (dsp.__class__.__name__, dsp.name)
 
225
    DistributionSourcePackage: commercialpackage
221
226
    DistributionSourcePackage: foobar
222
 
    DistributionSourcePackage: commercialpackage
223
227
 
224
228
searchSourcePackages() also has a publishing_distroseries parameter that
225
229
it just passes on to searchSourcePackageCaches(), and it restricts the
230
234
    ...     'a', publishing_distroseries=ubuntu.currentseries)
231
235
    >>> for dsp in packages:
232
236
    ...     print "%s: %s" % (dsp.__class__.__name__, dsp.name)
 
237
    DistributionSourcePackage: alsa-utils
233
238
    DistributionSourcePackage: netapplet
234
 
    DistributionSourcePackage: alsa-utils
235
239
 
236
240
 
237
241
Searching for binary packages