Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dagwieers committed Apr 3, 2006
1 parent 0a1f99f commit 69a38b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -3,6 +3,7 @@
- Print out terminal debug info (TERM env and terminal type)
- Added SwapCached value to Cached (Bert de Bruijn)
- Added external plugin dstat_clock, a human-readable alternative for dstat_time
- Fixed problem with Broken pipe when doing eg. dstat | head -1 (Eike Herzbach)

* 0.6.1 - Fishkill - released 05/09/2005
- Look for plugins in ~/.dstat/ too
Expand Down
17 changes: 13 additions & 4 deletions dstat
Expand Up @@ -1769,15 +1769,19 @@ def main():
### If intermediate results, update increases with 1 sec (=interval)
update = update + interval

if not op.update:
sys.stdout.write('\n')

### Do not pause when this is the final loop
if update <= op.delay * op.count or op.count == -1:
signal.pause()

### The last step in a loop is to show the definitive line on its own line
if step == op.delay:
sys.stdout.write('\n' + ansi['reset'] + ansi['clearline'] + ansi['save'])
else:
sys.stdout.write(ansi['clearline'] + ansi['restore'])
if op.update:
if step == op.delay:
sys.stdout.write('\n' + ansi['reset'] + ansi['clearline'] + ansi['save'])
else:
sys.stdout.write(ansi['clearline'] + ansi['restore'])

loop = (update + op.delay - 1) / op.delay
step = ((update - 1) % op.delay) + 1
Expand All @@ -1799,6 +1803,11 @@ if __name__ == '__main__':
main()
except KeyboardInterrupt, e:
print
except IOError, e:
if e.errno != 32: ## [Errno 32] Broken pipe
print
print 'IOError: %s' % e
exit(7)
except OSError, e:
print
print 'OSError: %s' % e
Expand Down

0 comments on commit 69a38b6

Please sign in to comment.