~landscape/landscape-client/trunk

« back to all changes in this revision

Viewing changes to landscape/package/facade.py

Merged apt-get-packages-by-name [r=therve,ack] [f=865273].

Add AptFacade.get_packages_by_names() and update all places that got
packages by name to use this method.

Show diffs side-by-side

added added

removed removed

Lines of Context:
203
203
        """Is the package an upgrade for another installed package?"""
204
204
        return package.is_upgradable
205
205
 
 
206
    def get_packages_by_name(self, name):
 
207
        """Get all available packages matching the provided name.
 
208
 
 
209
        @param name: The name the returned packages should have.
 
210
        """
 
211
        return [pkg for pkg in self.get_packages() if pkg.name == name]
 
212
 
206
213
 
207
214
class SmartFacade(object):
208
215
    """Wrapper for tasks using Smart.