Pisi paket derlerken çalıştığı console'un titleını da set etsin :P

This commit is contained in:
S.Çağlar Onur
2005-08-13 00:28:03 +00:00
parent 00d2426fdb
commit fbece546c0
2 changed files with 19 additions and 0 deletions
+2
View File
@@ -105,6 +105,7 @@ class PisiBuild:
"""Build the package in one shot."""
ui.info("Building PISI source package: %s\n" % self.spec.source.name)
util.xtermTitle("Building PISI source package: %s\n" % self.spec.source.name)
self.compileActionScript()
@@ -337,3 +338,4 @@ class PisiBuild:
pkg.close()
os.chdir(c)
self.setState("buildpackages")
util.xtermTitleReset()
+17
View File
@@ -19,6 +19,7 @@
# standard python modules
import os
import sys
import sha
import shutil
import statvfs
@@ -101,6 +102,22 @@ def run_batch(cmd):
return (successful,lines)
def xtermTitle(message):
"""sets message as a console window's title"""
if os.environ.has_key("TERM") and sys.stderr.isatty():
terminalType = os.environ["TERM"]
for term in ["xterm", "Eterm", "aterm", "rxvt", "screen", "kterm", "rxvt-unicode"]:
if terminalType.startswith(term):
sys.stderr.write("\x1b]2;"+str(message)+"\x07")
sys.stderr.flush()
break
def xtermTitleReset():
"""resets console window's title"""
if os.environ.has_key("TERM"):
terminalType = os.environ["TERM"]
xtermTitle(os.environ["TERM"])
#############################
# Path Processing Functions #
#############################