From 39bd7c93ce7174bd0bd37455f9571cf014d36444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Mon, 15 Aug 2005 16:52:01 +0000 Subject: [PATCH] * list-installed'in buglarini duzelt * fixes #342 * --detailed -> --install-info * fix: 'i' ya da 'ip' olabilir installed package'larin state'i --- pisi/cli/commands.py | 2 +- pisi/installdb.py | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/pisi/cli/commands.py b/pisi/cli/commands.py index e0dcf792..64a2216e 100644 --- a/pisi/cli/commands.py +++ b/pisi/cli/commands.py @@ -426,7 +426,7 @@ Usage: list-installed def options(self): self.parser.add_option("-l", "--long", action="store_true", default=False, help="show in long format") - self.parser.add_option("", "--detailed", action="store_true", + self.parser.add_option("-i", "--install-info", action="store_true", default=False, help="show detailed install info") def run(self): diff --git a/pisi/installdb.py b/pisi/installdb.py index 0a88f96b..598617d7 100644 --- a/pisi/installdb.py +++ b/pisi/installdb.py @@ -41,13 +41,14 @@ class InstallInfo: self.release = release self.build = build self.distribution = distribution - from time import localtime, strftime - self.time = localtime() + import time + self.time = time.localtime() def one_liner(self): - time_str = strftime("%d %b %Y %H:%M", self.time) + import time + time_str = time.strftime("%d %b %Y %H:%M", self.time) s = '%s,%s,%s,%s,%s,%s' % (self.state, self.version, self.release, - self.self.build, self.distribution, + self.build, self.distribution, time_str) return s @@ -56,8 +57,10 @@ class InstallInfo: def __str__(self): s = "State: %s\nVersion: %s, Release: %s, Build: %s\n" % \ - (state_map[self.state], self.version, self.release, self.build) - time_str = strftime("%d %b %Y %H:%M", self.time) + (InstallInfo.state_map[self.state], self.version, + self.release, self.build) + import time + time_str = time.strftime("%d %b %Y %H:%M", self.time) s += 'Distribution: %s, Install Time: %s\n' % (self.distribution, time_str) return s @@ -100,7 +103,7 @@ class InstallDB: def list_installed(self): list = [] for (pkg, info) in self.d.iteritems(): - if info.state=='i': + if info.state=='i' or info.state=='ip': list.append(pkg) return list