[svn] r3554 - trunk/tools/dstat

packagers at lists.rpmforge.net packagers at lists.rpmforge.net
Tue Sep 6 04:50:13 CEST 2005


Author: dag
Date: 2005-09-06 04:50:11 +0200 (Tue, 06 Sep 2005)
New Revision: 3554

Modified:
   trunk/tools/dstat/ChangeLog
   trunk/tools/dstat/dstat
   trunk/tools/dstat/dstat15
Log:
TERM environment variable fix from William Webber

Modified: trunk/tools/dstat/ChangeLog
===================================================================
--- trunk/tools/dstat/ChangeLog	2005-09-05 11:14:56 UTC (rev 3553)
+++ trunk/tools/dstat/ChangeLog	2005-09-06 02:50:11 UTC (rev 3554)
@@ -1,3 +1,6 @@
+* 0.6.2 - ? - released ??/??/2005
+- Fixed situation where no TERM environment variable was set (William Webber)
+
 * 0.6.1 - Fishkill - released 05/09/2005
 - Look for plugins in ~/.dstat/ too
 - Added '-M list' to show the list of available modules per path

Modified: trunk/tools/dstat/dstat
===================================================================
--- trunk/tools/dstat/dstat	2005-09-05 11:14:56 UTC (rev 3553)
+++ trunk/tools/dstat/dstat	2005-09-06 02:50:11 UTC (rev 3554)
@@ -1483,7 +1483,7 @@
 			return struct.unpack('HHHH', x)[:2]
 		except:
 			try:
-				return int(os.environ['LINES']), int(os.environ['COLUMNS'])
+				return int(os.getenv('LINES')), int(os.getenv('COLUMNS'))
 			except:
 				return 25, 80
 
@@ -1589,7 +1589,8 @@
 	hostname = os.uname()[1].split('.')[0]
 
 	### Write term-title
-	if re.compile('(screen*|xterm*)').match(os.getenv('TERM')):
+	term = os.getenv('TERM')
+	if term and re.compile('(screen*|xterm*)').match(term):
 		sys.stdout.write('\033]0;(%s@%s) %s %s\007' % (user, hostname, os.path.basename(sys.argv[0]), ' '.join(op.args)))
 
 	### Check terminal capabilities

Modified: trunk/tools/dstat/dstat15
===================================================================
--- trunk/tools/dstat/dstat15	2005-09-05 11:14:56 UTC (rev 3553)
+++ trunk/tools/dstat/dstat15	2005-09-06 02:50:11 UTC (rev 3554)
@@ -1589,7 +1589,8 @@
 	hostname = string.split(os.uname()[1], '.')[0]
 
 	### Write term-title
-	if re.compile('(screen*|xterm*)').match(os.environ['TERM']):
+	term = os.environ['TERM']
+	if term and re.compile('(screen*|xterm*)').match(term):
 		sys.stdout.write('\033]0;(%s@%s) %s %s\007' % (user, hostname, os.path.basename(sys.argv[0]), string.join(op.args, ' ')))
 
 	### Check terminal capabilities




More information about the commits mailing list