Debugger/BreakPointModel.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2791
a9577f248f04
parent 2988
f53c03574697
child 3058
0a02c433f52d
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
20 20
21 def __init__(self, parent=None): 21 def __init__(self, parent=None):
22 """ 22 """
23 Constructor 23 Constructor
24 24
25 @param reference to the parent widget (QObject) 25 @param parent reference to the parent widget (QObject)
26 """ 26 """
27 super(BreakPointModel, self).__init__(parent) 27 super(BreakPointModel, self).__init__(parent)
28 28
29 self.breakpoints = [] 29 self.breakpoints = []
30 self.header = [ 30 self.header = [
46 46
47 def columnCount(self, parent=QModelIndex()): 47 def columnCount(self, parent=QModelIndex()):
48 """ 48 """
49 Public method to get the current column count. 49 Public method to get the current column count.
50 50
51 @param parent reference to parent index (QModelIndex)
51 @return column count (integer) 52 @return column count (integer)
52 """ 53 """
53 return len(self.header) 54 return len(self.header)
54 55
55 def rowCount(self, parent=QModelIndex()): 56 def rowCount(self, parent=QModelIndex()):
56 """ 57 """
57 Public method to get the current row count. 58 Public method to get the current row count.
58 59
60 @param parent reference to parent index (QModelIndex)
59 @return row count (integer) 61 @return row count (integer)
60 """ 62 """
61 # we do not have a tree, parent should always be invalid 63 # we do not have a tree, parent should always be invalid
62 if not parent.isValid(): 64 if not parent.isValid():
63 return len(self.breakpoints) 65 return len(self.breakpoints)
176 if not parent.isValid(): 178 if not parent.isValid():
177 return len(self.breakpoints) > 0 179 return len(self.breakpoints) > 0
178 else: 180 else:
179 return False 181 return False
180 182
181 ############################################################################ 183 ###########################################################################
182 184
183 def addBreakPoint(self, fn, line, properties): 185 def addBreakPoint(self, fn, line, properties):
184 """ 186 """
185 Public method to add a new breakpoint to the list. 187 Public method to add a new breakpoint to the list.
186 188
281 else: 283 else:
282 return [] 284 return []
283 285
284 def getBreakPointIndex(self, fn, lineno): 286 def getBreakPointIndex(self, fn, lineno):
285 """ 287 """
286 Public method to get the index of a breakpoint given by filename and line number. 288 Public method to get the index of a breakpoint given by filename and
289 line number.
287 290
288 @param fn filename of the breakpoint (string) 291 @param fn filename of the breakpoint (string)
289 @param line line number of the breakpoint (integer) 292 @param lineno line number of the breakpoint (integer)
290 @return index (QModelIndex) 293 @return index (QModelIndex)
291 """ 294 """
292 for row in range(len(self.breakpoints)): 295 for row in range(len(self.breakpoints)):
293 bp = self.breakpoints[row] 296 bp = self.breakpoints[row]
294 if bp[0] == fn and bp[1] == lineno: 297 if bp[0] == fn and bp[1] == lineno:

eric ide

mercurial