[nanny] Remove wmi depends



commit 7921e3126c23bbcdb9e62d69613a853cc32bc51f
Author: Roberto Majadas <roberto majadas openshine com>
Date:   Thu Sep 23 20:13:30 2010 +0200

    Remove wmi depends

 daemon/src/Win32Top.py |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/daemon/src/Win32Top.py b/daemon/src/Win32Top.py
index db98242..72e183b 100644
--- a/daemon/src/Win32Top.py
+++ b/daemon/src/Win32Top.py
@@ -23,7 +23,6 @@
 import os
 import time
 import win32com.client
-import wmi
 import gobject
 from twisted.internet import reactor
 import copy
@@ -105,9 +104,7 @@ class Win32Top(gobject.GObject) :
                 
                 if pid not in self.process_list :
                     try:               
-                        w = wmi.WMI()
-                        p = w.Win32_Process(ProcessID=pid)
-                        uid_name = p[0].GetOwner()[2]
+                        uid_name = result.execMethod_('GetOwner').User
                         uid_number = None
                         for uid, uname, ufname in users_list:
                             if uname == uid_name :
@@ -125,7 +122,7 @@ class Win32Top(gobject.GObject) :
                     u, n, c = self.process_list[pid]
                     if c != cdate:
                         try:
-                            uid_name = wmi.WMI().Win32_Process(ProcessID=pid).GetOwner()[0]
+                            uid_name = result.execMethod_('GetOwner').User
                             uid_number = None
                             for uid, uname, ufname in users_list:
                                 if uname == uid_name :



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]