Invert get_nice and nice

pull/118/head
Nicolas Hennion 2012-11-07 14:45:30 +01:00
parent c8fb2f4891
commit aa9797c6d9
1 changed files with 5 additions and 5 deletions

View File

@ -421,12 +421,12 @@ class glancesStats:
procstat['pid'] = proc.pid procstat['pid'] = proc.pid
procstat['username'] = proc.username procstat['username'] = proc.username
if hasattr(proc, 'nice'): if hasattr(proc, 'get_nice'):
# Deprecated in PsUtil 0.5.0 # Deprecated in PsUtil 0.5.0+
procstat['nice'] = proc.nice
elif hasattr(proc, 'get_nice'):
# Specific for PsUtil 0.5.0+
procstat['nice'] = proc.get_nice() procstat['nice'] = proc.get_nice()
elif hasattr(proc, 'nice'):
# Else
procstat['nice'] = proc.nice()
else: else:
# Never here... # Never here...
procstat['nice'] = 0 procstat['nice'] = 0