Skip to content

Commit

Permalink
Add support for getting all available updates,
Browse files Browse the repository at this point in the history
using 'update_all' filter.
  • Loading branch information
Tim Lauridsen committed Jun 9, 2015
1 parent f45231c commit fd45b13
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/dnfdaemon/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def on_RepoMetaDataProgress(self, name, frac):
import weakref
import logging

CLIENT_API_VERSION = 1
CLIENT_API_VERSION = 2

logger = logging.getLogger("dnfdaemon.client")

Expand Down
4 changes: 2 additions & 2 deletions python/dnfdaemon/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import operator
import sys

API_VERSION = 1 # API Version must be bumped at API changes
API_VERSION = 2 # API Version must be bumped at API changes
MAINLOOP = GLib.MainLoop()

# Fake attributes, there is simulating real package attribute
Expand Down Expand Up @@ -339,7 +339,7 @@ def get_packages(self, pkg_filter, attrs):
"""
value = []
if pkg_filter in ['installed', 'available', 'updates', 'obsoletes',
'recent', 'extras']:
'recent', 'extras', 'updates_all']:
pkgs = getattr(self.base.packages, pkg_filter)
value = [self._get_po_list(po, attrs) for po in pkgs]
return json.dumps(value)
Expand Down
4 changes: 4 additions & 0 deletions python/dnfdaemon/server/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ def updates(self):
pkgs.append(po)
return pkgs

@property
def updates_all(self):
return self.query.upgrades().latest().run()

@property
def all(self):
"""Get all packages installed and available.
Expand Down

0 comments on commit fd45b13

Please sign in to comment.