[kupfer: 14/24] plugin.top: change strings, add SETTING_PREFER_CATALOG
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer: 14/24] plugin.top: change strings, add SETTING_PREFER_CATALOG
- Date: Fri, 27 Nov 2009 13:39:42 +0000 (UTC)
commit d697364072084a2a566a19859bc80e0668307df5
Author: Karol BÄ?dkowski <karol bedkowsk+gh gmail com>
Date: Tue Nov 24 09:21:14 2009 +0100
plugin.top: change strings, add SETTING_PREFER_CATALOG
kupfer/plugin/top.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/plugin/top.py b/kupfer/plugin/top.py
index 3722e47..b1c4f69 100644
--- a/kupfer/plugin/top.py
+++ b/kupfer/plugin/top.py
@@ -24,6 +24,7 @@ __kupfer_settings__ = plugin_support.PluginSettings(
"alternatives": [_("Commandline"), _("CPU usage (descending)"),
_("Memory usage (descending)") ]
},
+ plugin_support.SETTING_PREFER_CATALOG,
)
@@ -146,5 +147,11 @@ def get_processes():
if pid == 'PID':
continue # skip header
+ # read command line
+ proc_file = '/proc/%s/cmdline' % pid
+ if os.path.isfile(proc_file):
+ with open(proc_file, 'rt') as f:
+ cmd = str(f.readline().replace('\x00', ' ') or cmd)
+
yield (int(pid), float(cpu), float(mem), ptime, cmd)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]