Debugger/VariablesViewer.py

changeset 406
eacf81fad150
parent 96
9624a110667d
child 447
d5a0302040e9
equal deleted inserted replaced
405:374066392929 406:eacf81fad150
178 right justified and zero filled to 6 decimal places. Then 178 right justified and zero filled to 6 decimal places. Then
179 element 2 will have a key of '000002' and appear before 179 element 2 will have a key of '000002' and appear before
180 element 10 with a key of '000010' 180 element 10 with a key of '000010'
181 """ 181 """
182 keyStr = self.text(0) 182 keyStr = self.text(0)
183 self.arrayElementKey = "%.6d" % int(keyStr) 183 self.arrayElementKey = "{0:.6d}".format(int(keyStr))
184 184
185 def key(self, column): 185 def key(self, column):
186 """ 186 """
187 Public method generating the key for this item. 187 Public method generating the key for this item.
188 188
215 right justified and zero filled to 6 decimal places. Then 215 right justified and zero filled to 6 decimal places. Then
216 element 2 will have a key of '000002' and appear before 216 element 2 will have a key of '000002' and appear before
217 element 10 with a key of '000010' 217 element 10 with a key of '000010'
218 """ 218 """
219 keyStr = self.text(0)[:-2] # strip off [], () or {} 219 keyStr = self.text(0)[:-2] # strip off [], () or {}
220 self.arrayElementKey = "%.6d" % int(keyStr) 220 self.arrayElementKey = "{0:.6d}".format(int(keyStr))
221 221
222 def key(self, column): 222 def key(self, column):
223 """ 223 """
224 Public method generating the key for this item. 224 Public method generating the key for this item.
225 225
526 @return The item that was added to the listview (QTreeWidgetItem). 526 @return The item that was added to the listview (QTreeWidgetItem).
527 """ 527 """
528 if parent is None: 528 if parent is None:
529 parent = self 529 parent = self
530 try: 530 try:
531 dvar = '%s%s' % (var, self.indicators[vtype]) 531 dvar = '{0}{1}'.format(var, self.indicators[vtype])
532 except KeyError: 532 except KeyError:
533 dvar = var 533 dvar = var
534 dvtype = self.__getDispType(vtype) 534 dvtype = self.__getDispType(vtype)
535 535
536 if vtype in ['list', 'Array', 'tuple', 'dict', 'Hash']: 536 if vtype in ['list', 'Array', 'tuple', 'dict', 'Hash']:
615 # build up the fully qualified name 615 # build up the fully qualified name
616 while par is not None: 616 while par is not None:
617 pname = par.text(0) 617 pname = par.text(0)
618 if pname[-2:] in ['[]', '{}', '()']: 618 if pname[-2:] in ['[]', '{}', '()']:
619 if nlist[0].endswith("."): 619 if nlist[0].endswith("."):
620 nlist[0] = '[%s].' % nlist[0][:-1] 620 nlist[0] = '[{0}].'.format(nlist[0][:-1])
621 else: 621 else:
622 nlist[0] = '[%s]' % nlist[0] 622 nlist[0] = '[{0}]'.format(nlist[0])
623 nlist.insert(0, pname[:-2]) 623 nlist.insert(0, pname[:-2])
624 else: 624 else:
625 nlist.insert(0, '%s.' % pname) 625 nlist.insert(0, '{0}.'.format(pname))
626 par = par.parent() 626 par = par.parent()
627 627
628 name = ''.join(nlist) 628 name = ''.join(nlist)
629 # now show the dialog 629 # now show the dialog
630 dlg = VariableDetailDialog(name, vtype, val) 630 dlg = VariableDetailDialog(name, vtype, val)

eric ide

mercurial