• Home
  • Raw
  • Download

Lines Matching full:self

65 	def __init__(self, db, row, parent_item):  argument
66 self.db = db
67 self.row = row
68 self.parent_item = parent_item
69 self.query_done = False;
70 self.child_count = 0
71 self.child_items = []
72 self.data = ["", "", "", "", "", "", ""]
73 self.comm_id = 0
74 self.thread_id = 0
75 self.call_path_id = 1
76 self.branch_count = 0
77 self.time = 0
79 self.setUpRoot()
81 def setUpRoot(self): argument
82 self.query_done = True
83 query = QSqlQuery(self.db)
90 child_item = TreeItem(self.db, self.child_count, self)
91 self.child_items.append(child_item)
92 self.child_count += 1
95 def setUpLevel1(self, comm_id, comm): argument
96 self.query_done = True;
97 self.comm_id = comm_id
98 self.data[0] = comm
99 self.child_items = []
100 self.child_count = 0
101 query = QSqlQuery(self.db)
106 child_item = TreeItem(self.db, self.child_count, self)
107 self.child_items.append(child_item)
108 self.child_count += 1
111 def setUpLevel2(self, comm_id, thread_id, pid, tid): argument
112 self.comm_id = comm_id
113 self.thread_id = thread_id
114 self.data[0] = str(pid) + ":" + str(tid)
116 def getChildItem(self, row): argument
117 return self.child_items[row]
119 def getParentItem(self): argument
120 return self.parent_item
122 def getRow(self): argument
123 return self.row
125 def timePercent(self, b): argument
126 if not self.time:
128 x = (b * Decimal(100)) / self.time
131 def branchPercent(self, b): argument
132 if not self.branch_count:
134 x = (b * Decimal(100)) / self.branch_count
137 def addChild(self, call_path_id, name, dso, count, time, branch_count): argument
138 child_item = TreeItem(self.db, self.child_count, self)
139 child_item.comm_id = self.comm_id
140 child_item.thread_id = self.thread_id
150 child_item.data[4] = self.timePercent(time)
152 child_item.data[6] = self.branchPercent(branch_count)
153 self.child_items.append(child_item)
154 self.child_count += 1
156 def selectCalls(self): argument
157 self.query_done = True;
158 query = QSqlQuery(self.db)
163 … parent_call_path_id = ' + str(self.call_path_id) + ' AND comm_id = ' + str(self.comm_id) + ' AND …
182 self.addChild(last_call_path_id, name, dso, count, time, branch_count)
192 self.addChild(last_call_path_id, name, dso, count, time, branch_count)
196 if total_branch_count > self.branch_count:
197 self.branch_count = total_branch_count
198 if self.branch_count:
199 for child_item in self.child_items:
200 child_item.data[6] = self.branchPercent(child_item.branch_count)
201 if total_time > self.time:
202 self.time = total_time
203 if self.time:
204 for child_item in self.child_items:
205 child_item.data[4] = self.timePercent(child_item.time)
207 def childCount(self): argument
208 if not self.query_done:
209 self.selectCalls()
210 return self.child_count
212 def columnCount(self): argument
215 def columnHeader(self, column): argument
219 def getData(self, column): argument
220 return self.data[column]
224 def __init__(self, db, parent=None): argument
225 super(TreeModel, self).__init__(parent)
226 self.db = db
227 self.root = TreeItem(db, 0, None)
229 def columnCount(self, parent): argument
230 return self.root.columnCount()
232 def rowCount(self, parent): argument
236 parent_item = self.root
239 def headerData(self, section, orientation, role): argument
247 return self.root.columnHeader(section)
249 def parent(self, child): argument
251 if child_item is self.root:
254 return self.createIndex(parent_item.getRow(), 0, parent_item)
256 def index(self, row, column, parent): argument
260 parent_item = self.root
262 return self.createIndex(row, column, child_item)
264 def data(self, index, role): argument
275 def __init__(self, db, dbname, parent=None): argument
276 super(MainWindow, self).__init__(parent)
278 self.setObjectName("MainWindow")
279 self.setWindowTitle("Call Graph: " + dbname)
280 self.move(100, 100)
281 self.resize(800, 600)
282 style = self.style()
284 self.setWindowIcon(icon);
286 self.model = TreeModel(db)
288 self.view = QTreeView()
289 self.view.setModel(self.model)
291 self.setCentralWidget(self.view)