Lines Matching refs:self
12 def __init__(self, uid, pid, ppid, name): argument
13 self.uid = uid
14 self.pid = pid
15 self.ppid = ppid
16 self.name = name
18 def DisplayName(self): argument
19 if self.name:
20 return self.name
21 if self.uid:
22 return self.uid.name
23 return self.pid
25 def __str__(self): argument
26 return "Process(uid=%s, pid=%s, name=%s)" % (self.uid, self.pid, self.name)
29 def __init__(self, uid, name): argument
30 self.uid = uid
31 self.name = name
33 def __str__(self): argument
34 return "Uid(id=%s, name=%s)" % (self.uid, self.name)
37 def __init__(self): argument
38 self._processes = dict()
39 self._uids = dict()
40 self._pidUpdateCount = 0
41 self._uidUpdateCount = 0
42 self.doUpdates = False
44 def Update(self, force=False): argument
45 self.UpdateUids(force)
46 self.UpdateProcesses(force)
48 def UpdateProcesses(self, force=False): argument
49 if not (self.doUpdates or force):
51 self._pidUpdateCount += 1
58 if not self._processes.has_key(line[1]):
59 uid = self.FindUid(ParseUid(line[0]))
60 self._processes[line[1]] = Process(uid, line[1], line[2], line[3])
62 def UpdateUids(self, force=False): argument
63 if not (self.doUpdates or force):
65 self._uidUpdateCount += 1
72 if not self._uids.has_key(line[0]):
73 self._uids[line[1]] = Uid(*line)
75 def FindPid(self, pid, uid=None): argument
82 result = self._processes.get(pid)
84 self.UpdateProcesses()
85 result = self._processes.get(pid)
88 uid = self._uids.get(uid)
90 self._processes[pid] = result
93 def FindUid(self, uid): argument
94 result = self._uids.get(uid)
96 self.UpdateUids()
97 result = self._uids.get(uid)
100 self._uids[uid] = result
103 def UpdateCount(self): argument
104 return (self._pidUpdateCount, self._uidUpdateCount)
106 def Print(self): argument
107 for process in self._processes:
109 for uid in self._uids: