287 @param parent the parent (QWidget) |
287 @param parent the parent (QWidget) |
288 @param scope flag indicating global (1) or local (0) variables |
288 @param scope flag indicating global (1) or local (0) variables |
289 """ |
289 """ |
290 super(VariablesViewer, self).__init__(parent) |
290 super(VariablesViewer, self).__init__(parent) |
291 |
291 |
292 self.indicators = {'list': '[]', 'tuple': '()', 'dict': '{}', |
292 self.indicators = {'list': '[]', 'tuple': '()', 'dict': '{}', # __IGNORE_WARNING__ |
293 # Python types |
293 # Python types |
294 'Array': '[]', 'Hash': '{}' |
294 'Array': '[]', 'Hash': '{}' # __IGNORE_WARNING__ |
295 # Ruby types |
295 # Ruby types |
296 } |
296 } |
297 |
297 |
298 self.rx_class = QRegExp('<.*(instance|object) at 0x.*>') |
298 self.rx_class = QRegExp('<.*(instance|object) at 0x.*>') |
299 self.rx_class2 = QRegExp('class .*') |
299 self.rx_class2 = QRegExp('class .*') |
646 if not val: |
646 if not val: |
647 return # do not display anything, if the variable has no value |
647 return # do not display anything, if the variable has no value |
648 |
648 |
649 vtype = itm.text(2) |
649 vtype = itm.text(2) |
650 name = itm.text(0) |
650 name = itm.text(0) |
651 if name[-2:] in ['[]', '{}', '()']: |
651 if name[-2:] in ['[]', '{}', '()']: # __IGNORE_WARNING__ |
652 name = name[:-2] |
652 name = name[:-2] |
653 |
653 |
654 par = itm.parent() |
654 par = itm.parent() |
655 nlist = [name] |
655 nlist = [name] |
656 # build up the fully qualified name |
656 # build up the fully qualified name |
657 while par is not None: |
657 while par is not None: |
658 pname = par.text(0) |
658 pname = par.text(0) |
659 if pname[-2:] in ['[]', '{}', '()']: |
659 if pname[-2:] in ['[]', '{}', '()']: # __IGNORE_WARNING__ |
660 if nlist[0].endswith("."): |
660 if nlist[0].endswith("."): |
661 nlist[0] = '[{0}].'.format(nlist[0][:-1]) |
661 nlist[0] = '[{0}].'.format(nlist[0][:-1]) |
662 else: |
662 else: |
663 nlist[0] = '[{0}]'.format(nlist[0]) |
663 nlist[0] = '[{0}]'.format(nlist[0]) |
664 nlist.insert(0, pname[:-2]) |
664 nlist.insert(0, pname[:-2]) |