redirect output to less when pisi-cli used for history

This commit is contained in:
Faik Uygur
2008-03-03 08:53:18 +00:00
parent 6b0ff9064d
commit 9042b9830f
+8
View File
@@ -10,6 +10,8 @@
# Please read the COPYING file.
#
import os
import sys
import optparse
import gettext
@@ -70,9 +72,15 @@ Lists previous operations."""
print " *", pkg
print
def redirect_output(self):
if os.isatty(sys.stdout.fileno()):
output = os.popen("less","w")
sys.stdout = sys.stderr = output
def run(self):
self.init(database = False, write = False)
ctx.set_option('ignore_build_no', True)
self.redirect_output()
if ctx.get_option('snapshot'):
self.take_snapshot()
return