Pisi paket derlerken çalıştığı console'un titleını da set etsin :P
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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 #
|
||||
#############################
|
||||
|
||||
Reference in New Issue
Block a user