Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Release 0.5.10.

  • Loading branch information...
commit 2b023cb4f0796c2f406fc0fa68f87b7dd549591f 1 parent 1ebdbaa
@dagwieers authored
Showing with 45 additions and 36 deletions.
  1. +4 −0 ChangeLog
  2. +5 −2 Makefile
  3. +1 −0  TODO
  4. +17 −17 dstat
  5. +3 −0  dstat.spec
  6. +15 −17 dstat15
View
4 ChangeLog
@@ -1,3 +1,7 @@
+* 0.5.10
+- Restore terminal for all exit situations (Modesto Alexandre)
+- Get ridding of duplicate 'too width' error message in dstat15
+
* 0.5.9
- Make default list total lists (cpu, disk, net)
- Fix clearline ANSI to work on older (Debian?) rxvt (Joshua Rodman)
View
7 Makefile
@@ -9,5 +9,8 @@ all:
install:
# -[ ! -f $(DESTDIR)$(sysconfdir)/dstat.conf ] && install -D -m0644 dstat.conf $(DESTDIR)$(sysconfdir)/dstat.conf
- install -D -m0755 dstat $(DESTDIR)$(bindir)/dstat
- install -D -m0644 dstat.1 $(DESTDIR)$(mandir)/man1/dstat.1
+ install -Dp -m0755 dstat $(DESTDIR)$(bindir)/dstat
+ install -Dp -m0644 dstat.1 $(DESTDIR)$(mandir)/man1/dstat.1
+
+clean:
+ @echo "No clean phase."
View
1  TODO
@@ -30,6 +30,7 @@
### General bugs
+ Timer is not accurate on 2.6 kernel, every second there's a 1ms deviation (every 17mins -> 1sec)
+ Python 1.5 prints 'L' for long, crashes when int()
++ If number of lines on terminal <= 1, division by zero
### Stat bugs
+ tcp stat is very slow and generates lots of softirqs (on some systems)
View
34 dstat
@@ -25,7 +25,7 @@ import os, re, getopt, time, types
import ConfigParser, urlparse, signal, resource
import curses, termios
-VERSION = '0.5.9'
+VERSION = '0.5.10'
enable = ('yes', 'on', 'true', '1')
disable = ('no', 'off', 'false', '0')
@@ -54,7 +54,7 @@ class Options:
'full', 'integer', 'mods', 'modules', 'nocolor', 'noheaders', 'noupdate', 'output='])
except getopt.error, exc:
print 'dstat: %s, try dstat -h for a list of all the options' % str(exc)
- sys.exit(1)
+ exit(1)
self.modlist = []
@@ -120,10 +120,10 @@ class Options:
elif opt in ['-h', '--help']:
self.usage()
self.help()
- sys.exit(0)
+ exit(0)
elif opt in ['-V', '--version']:
self.version()
- sys.exit(0)
+ exit(0)
if not self.modlist:
self.modlist = [ 'cpu', 'disk', 'net', 'page', 'sys' ]
@@ -133,11 +133,11 @@ class Options:
if len(args) > 1: self.count = int(args[1])
except:
print 'dstat: incorrect argument, try dstat -h for the correct syntax'
- sys.exit(1)
+ exit(1)
if self.delay == 0:
print 'dstat: delay must be an integer, greater than zero'
- sys.exit(1)
+ exit(1)
def version(self):
print 'Dstat %s' % VERSION
@@ -1257,7 +1257,7 @@ def info(level, str):
def die(ret, str):
"Print error and exit with errorcode"
info(0, str)
- sys.exit(ret)
+ exit(ret)
def getwinsize():
if op.nolimit:
@@ -1312,6 +1312,12 @@ def dev(maj, min):
def signaler(signum, frame):
signal.alarm(interval)
+def exit(ret):
+ sys.stdout.write(ansi['reset'])
+ signal.signal(signal.SIGALRM, signal.SIG_DFL)
+ termios.tcsetattr(fd, termios.TCSADRAIN, old)
+ sys.exit(ret)
+
def main():
global update, loop, step, pagesize, cpunr, ansi, interval, outputfile
@@ -1505,23 +1511,17 @@ if __name__ == '__main__':
try:
main()
except KeyboardInterrupt, e:
- signal.signal(signal.SIGALRM, signal.SIG_DFL)
- termios.tcsetattr(fd, termios.TCSADRAIN, old)
- print ansi['reset']
+ print
except OSError, e:
- signal.signal(signal.SIGALRM, signal.SIG_DFL)
- termios.tcsetattr(fd, termios.TCSADRAIN, old)
# print e.errno
print
- print ansi['reset'] + 'OSError: %s' % e
- sys.exit(7)
+ print 'OSError: %s' % e
+ exit(7)
# except Exception, e:
# signal.signal(signal.SIGALRM, signal.SIG_DFL)
# termios.tcsetattr(fd, termios.TCSADRAIN, old)
# raise e
-signal.signal(signal.SIGALRM, signal.SIG_DFL)
-termios.tcsetattr(fd, termios.TCSADRAIN, old)
-sys.exit(0)
+exit(0)
# vim:ts=4:sw=4
View
3  dstat.spec
@@ -72,6 +72,9 @@ interprete real-time data as easy as possible.
%{_bindir}/dstat
%changelog
+* Fri Apr 08 2005 Dag Wieers <dag@wieers.com> - 0.5.10-1
+- Updated to release 0.5.10.
+
* Mon Mar 28 2005 Dag Wieers <dag@wieers.com> - 0.5.9-1
- Updated to release 0.5.9.
View
32 dstat15
@@ -24,7 +24,7 @@ import os, re, getopt, time, types, string
import ConfigParser, urlparse, signal, resource
import curses, termios
-VERSION = '0.5.9'
+VERSION = '0.5.10'
enable = ('yes', 'on', 'true', '1')
disable = ('no', 'off', 'false', '0')
@@ -53,7 +53,7 @@ class Options:
'full', 'integer', 'mods', 'modules', 'nocolor', 'noheaders', 'noupdate', 'output='])
except getopt.error, exc:
print 'dstat: %s, try dstat -h for a list of all the options' % str(exc)
- sys.exit(1)
+ exit(1)
self.modlist = []
@@ -119,10 +119,10 @@ class Options:
elif opt in ['-h', '--help']:
self.usage()
self.help()
- sys.exit(0)
+ exit(0)
elif opt in ['-V', '--version']:
self.version()
- sys.exit(0)
+ exit(0)
if not self.modlist:
self.modlist = [ 'cpu', 'disk', 'net', 'page', 'sys' ]
@@ -132,11 +132,11 @@ class Options:
if len(args) > 1: self.count = int(args[1])
except:
print 'dstat: incorrect argument, try dstat -h for the correct syntax'
- sys.exit(1)
+ exit(1)
if self.delay == 0:
print 'dstat: delay must be an integer, greater than zero'
- sys.exit(1)
+ exit(1)
def version(self):
print 'Dstat %s' % VERSION
@@ -1311,6 +1311,11 @@ def dev(maj, min):
def signaler(signum, frame):
signal.alarm(interval)
+def exit(ret):
+ sys.stdout.write(ansi['reset'])
+ signal.signal(signal.SIGALRM, signal.SIG_DFL)
+ sys.exit(ret)
+
def main():
global update, loop, step, pagesize, cpunr, ansi, interval, outputfile
@@ -1385,10 +1390,6 @@ def main():
if not totlist:
die(8, 'None of the stats you selected are available.')
- if not op.nolimit:
- if linewidth > cols:
- print 'Screen width too small, trimming output.'
-
### FIXME: Get rid of socket()
if op.output:
import socket
@@ -1512,16 +1513,13 @@ if __name__ == '__main__':
try:
main()
except KeyboardInterrupt, e:
- signal.signal(signal.SIGALRM, signal.SIG_DFL)
- print ansi['reset']
+ print
except OSError, e:
- signal.signal(signal.SIGALRM, signal.SIG_DFL)
# print e.errno
print
- print ansi['reset'] + 'OSError: %s' % e
- sys.exit(7)
+ print 'OSError: %s' % e
+ exit(7)
-signal.signal(signal.SIGALRM, signal.SIG_DFL)
-sys.exit(0)
+exit(0)
# vim:ts=4:sw=4
Please sign in to comment.
Something went wrong with that request. Please try again.