* list-installed'in buglarini duzelt
* fixes #342 * --detailed -> --install-info * fix: 'i' ya da 'ip' olabilir installed package'larin state'i
This commit is contained in:
@@ -426,7 +426,7 @@ Usage: list-installed
|
|||||||
def options(self):
|
def options(self):
|
||||||
self.parser.add_option("-l", "--long", action="store_true",
|
self.parser.add_option("-l", "--long", action="store_true",
|
||||||
default=False, help="show in long format")
|
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")
|
default=False, help="show detailed install info")
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|||||||
+10
-7
@@ -41,13 +41,14 @@ class InstallInfo:
|
|||||||
self.release = release
|
self.release = release
|
||||||
self.build = build
|
self.build = build
|
||||||
self.distribution = distribution
|
self.distribution = distribution
|
||||||
from time import localtime, strftime
|
import time
|
||||||
self.time = localtime()
|
self.time = time.localtime()
|
||||||
|
|
||||||
def one_liner(self):
|
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,
|
s = '%s,%s,%s,%s,%s,%s' % (self.state, self.version, self.release,
|
||||||
self.self.build, self.distribution,
|
self.build, self.distribution,
|
||||||
time_str)
|
time_str)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
@@ -56,8 +57,10 @@ class InstallInfo:
|
|||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
s = "State: %s\nVersion: %s, Release: %s, Build: %s\n" % \
|
s = "State: %s\nVersion: %s, Release: %s, Build: %s\n" % \
|
||||||
(state_map[self.state], self.version, self.release, self.build)
|
(InstallInfo.state_map[self.state], self.version,
|
||||||
time_str = strftime("%d %b %Y %H:%M", self.time)
|
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,
|
s += 'Distribution: %s, Install Time: %s\n' % (self.distribution,
|
||||||
time_str)
|
time_str)
|
||||||
return s
|
return s
|
||||||
@@ -100,7 +103,7 @@ class InstallDB:
|
|||||||
def list_installed(self):
|
def list_installed(self):
|
||||||
list = []
|
list = []
|
||||||
for (pkg, info) in self.d.iteritems():
|
for (pkg, info) in self.d.iteritems():
|
||||||
if info.state=='i':
|
if info.state=='i' or info.state=='ip':
|
||||||
list.append(pkg)
|
list.append(pkg)
|
||||||
return list
|
return list
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user