Skip to content
Browse files

Updates

  • Loading branch information...
1 parent 8b304f7 commit 08e5b615e8af574dc52d687267eabb7b2bf38d5d @dagwieers committed Aug 7, 2005
Showing with 13 additions and 9 deletions.
  1. +1 −0 ChangeLog
  2. +12 −9 dstat
View
1 ChangeLog
@@ -6,6 +6,7 @@
- Don't trim the cpulist to 2 items when -f (S�bastien Prud'homme)
- Exclude md-devices from total (Peter Cordes)
- Now accept 'total' keyword with -C (like -D and -N)
+- Rewrote the path-inserting code
* 0.6.0 - Bettiesbaai - released 29/05/2005
- Removed keyboard input prevention patch. (Dbt 304673, Marc Lehmann)
View
21 dstat
@@ -16,16 +16,19 @@
from __future__ import generators
+def inspath(path):
+ if os.path.isdir(path) and path not in sys.path:
+ sys.path.insert(1, path)
+
try:
import sys, signal, os, re, time
import types, signal, resource, getpass
- cwd = os.path.abspath(os.path.dirname(sys.argv[0]))
- sys.path.insert(0, os.getenv('HOME') + '/.dstat/')
- if cwd in sys.path: sys.path.remove(cwd)
- sys.path.insert(1, cwd)
- sys.path.insert(2, cwd + '/plugins/')
- sys.path.insert(3, '/usr/share/dstat/')
- sys.path.insert(4, '/usr/local/share/dstat/')
+ inspath('/usr/local/share/dstat/')
+ inspath('/usr/share/dstat/')
+ inspath(os.path.abspath(os.path.dirname(sys.argv[0])) + '/plugins/') # binary path + /plugins/
+ inspath(os.getcwd() + '/plugins/') # current path + /plugins/
+ inspath(os.getcwd()) # current path
+ inspath(os.getenv('HOME') + '/.dstat/') # home + /.dstat/
except KeyboardInterrupt, e:
pass
@@ -1583,7 +1586,7 @@ def main():
hostname = os.uname()[1].split('.')[0]
### Write term-title
- if re.compile('(screen|xterm*)').match(os.getenv('TERM')):
+ if re.compile('(screen*|xterm*)').match(os.getenv('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
@@ -1711,7 +1714,7 @@ def main():
if showheader:
if loop == 0 and totlist != vislist:
- info(1, 'Screen width too small, trimming output.')
+ info(1, 'Terminal width too small, trimming output.')
showheader = False
showtitle(1, totlist, vislist, ansi['darkblue'] + char['space'], ansi['darkblue'] + char['gt'])
showtitle(2, totlist, vislist, ansi['silver'] + char['pipe'], ansi['darkblue'] + char['gt'])

0 comments on commit 08e5b61

Please sign in to comment.
Something went wrong with that request. Please try again.