From d2f5164a4246b95798a35617dbd66cbc1f0c68b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Kadl=C4=8D=C3=ADk?= Date: Mon, 3 Oct 2016 00:35:06 +0200 Subject: [PATCH] Implement --now and --packages as Query methods --- tracer/query.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tracer/query.py b/tracer/query.py index aaabfa9..f0bbf80 100644 --- a/tracer/query.py +++ b/tracer/query.py @@ -43,6 +43,19 @@ class Query(object): def __init__(self, tracer=Tracer): self._tracer = tracer(System.package_manager(), Rules, Applications, dump_memory) + def from_packages(self, packages): + """List of ``Package`` that only should be traced""" + self._tracer.specified_packages = packages + return self + + def now(self): + """ + Pretend that specified packages have been updated just now. + Benefit of this is absolutely no need for openning the package history database + """ + self._tracer.now = True + return self + def affected_applications(self, user=None): """ Return list of applications which use some outdated files