forked from qt-creator/qt-creator
Dumper: replace import * with explicit imports
Using imports like from foo import * is considered as bad habit and it reduces static code analysis usability. Change-Id: I56a175f4c7b231e2b8e486bd9d1c65543720f56a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
from dumper import *
|
from dumper import Children
|
||||||
|
|
||||||
def qdump__boost__bimaps__bimap(d, value):
|
def qdump__boost__bimaps__bimap(d, value):
|
||||||
#leftType = value.type[0]
|
#leftType = value.type[0]
|
||||||
|
@@ -28,11 +28,12 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import cdbext
|
import cdbext
|
||||||
import re
|
import re
|
||||||
|
import threading
|
||||||
from utils import TypeCode
|
from utils import TypeCode
|
||||||
|
|
||||||
sys.path.insert(1, os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))))
|
sys.path.insert(1, os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))))
|
||||||
|
|
||||||
from dumper import *
|
from dumper import DumperBase, SubItem
|
||||||
|
|
||||||
class FakeVoidType(cdbext.Type):
|
class FakeVoidType(cdbext.Type):
|
||||||
def __init__(self, name , dumper):
|
def __init__(self, name , dumper):
|
||||||
|
@@ -23,8 +23,6 @@
|
|||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
from dumper import *
|
|
||||||
|
|
||||||
def typeTarget(type):
|
def typeTarget(type):
|
||||||
target = type.target()
|
target = type.target()
|
||||||
if target:
|
if target:
|
||||||
|
@@ -164,11 +164,11 @@ class DumperBase:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def showException(msg, exType, exValue, exTraceback):
|
def showException(msg, exType, exValue, exTraceback):
|
||||||
self.warn('**** CAUGHT EXCEPTION: %s ****' % msg)
|
DumperBase.warn('**** CAUGHT EXCEPTION: %s ****' % msg)
|
||||||
try:
|
try:
|
||||||
import traceback
|
import traceback
|
||||||
for line in traceback.format_exception(exType, exValue, exTraceback):
|
for line in traceback.format_exception(exType, exValue, exTraceback):
|
||||||
self.warn('%s' % line)
|
DumperBase.warn('%s' % line)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -335,7 +335,7 @@ class DumperBase:
|
|||||||
# (self.currentIName, self.currentValue, self.currentType))
|
# (self.currentIName, self.currentValue, self.currentType))
|
||||||
if not exType is None:
|
if not exType is None:
|
||||||
if self.passExceptions:
|
if self.passExceptions:
|
||||||
showException('SUBITEM', exType, exValue, exTraceBack)
|
self.showException('SUBITEM', exType, exValue, exTraceBack)
|
||||||
self.putSpecialValue('notaccessible')
|
self.putSpecialValue('notaccessible')
|
||||||
self.putNumChild(0)
|
self.putNumChild(0)
|
||||||
if not self.isCli:
|
if not self.isCli:
|
||||||
|
@@ -37,7 +37,7 @@ import struct
|
|||||||
import tempfile
|
import tempfile
|
||||||
import types
|
import types
|
||||||
|
|
||||||
from dumper import *
|
from dumper import DumperBase, Children, toInteger, TopLevelItem
|
||||||
from utils import TypeCode
|
from utils import TypeCode
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
@@ -42,7 +42,7 @@ sys.path.insert(1, os.path.dirname(os.path.abspath(inspect.getfile(inspect.curre
|
|||||||
if 'dumper' in sys.modules:
|
if 'dumper' in sys.modules:
|
||||||
reload(sys.modules['dumper'])
|
reload(sys.modules['dumper'])
|
||||||
|
|
||||||
from dumper import *
|
from dumper import DumperBase, SubItem, Children, TopLevelItem
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
#
|
#
|
||||||
@@ -1897,8 +1897,8 @@ class Tester(Dumper):
|
|||||||
break
|
break
|
||||||
|
|
||||||
else:
|
else:
|
||||||
d.warn('TIMEOUT')
|
self.warn('TIMEOUT')
|
||||||
d.warn('Cannot determined stopped thread')
|
self.warn('Cannot determined stopped thread')
|
||||||
|
|
||||||
lldb.SBDebugger.Destroy(self.debugger)
|
lldb.SBDebugger.Destroy(self.debugger)
|
||||||
|
|
||||||
@@ -1984,7 +1984,7 @@ class SummaryDumper(Dumper, LogMixin):
|
|||||||
return # Don't mess up lldb output
|
return # Don't mess up lldb output
|
||||||
|
|
||||||
def lookupNativeTypeInAllModules(self, name):
|
def lookupNativeTypeInAllModules(self, name):
|
||||||
d.warn('Failed to resolve type %s' % name)
|
self.warn('Failed to resolve type %s' % name)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def dump_summary(self, valobj, expanded = False):
|
def dump_summary(self, valobj, expanded = False):
|
||||||
|
@@ -23,8 +23,8 @@
|
|||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
from dumper import *
|
from dumper import Children, SubItem
|
||||||
from utils import TypeCode
|
from utils import TypeCode, DisplayFormat
|
||||||
import re
|
import re
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
@@ -323,7 +323,7 @@ def qdump__KDSoapValue1(d, value):
|
|||||||
d.putPlainChildren(inner)
|
d.putPlainChildren(inner)
|
||||||
|
|
||||||
def qdump__KDSoapValue(d, value):
|
def qdump__KDSoapValue(d, value):
|
||||||
p = (value.cast(lookupType('char*')) + 4).dereference().cast(lookupType('QString'))
|
p = (value.cast(d.lookupType('char*')) + 4).dereference().cast(d.lookupType('QString'))
|
||||||
d.putStringValue(p)
|
d.putStringValue(p)
|
||||||
d.putPlainChildren(value['d']['d'].dereference())
|
d.putPlainChildren(value['d']['d'].dereference())
|
||||||
|
|
||||||
|
@@ -23,8 +23,8 @@
|
|||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
from dumper import *
|
from dumper import Children, SubItem
|
||||||
from utils import TypeCode
|
from utils import TypeCode, DisplayFormat
|
||||||
|
|
||||||
def qdump__cv__Size_(d, value):
|
def qdump__cv__Size_(d, value):
|
||||||
d.putValue('(%s, %s)' % (value[0].display(), value[1].display()))
|
d.putValue('(%s, %s)' % (value[0].display(), value[1].display()))
|
||||||
|
@@ -56,6 +56,6 @@
|
|||||||
# for more details or look at qttypes.py, stdtypes.py, boosttypes.py
|
# for more details or look at qttypes.py, stdtypes.py, boosttypes.py
|
||||||
# for more complex examples.
|
# for more complex examples.
|
||||||
|
|
||||||
from dumper import *
|
import dumper
|
||||||
|
|
||||||
######################## Your code below #######################
|
######################## Your code below #######################
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
import platform
|
import platform
|
||||||
import re
|
import re
|
||||||
from dumper import *
|
from dumper import Children, SubItem, UnnamedSubItem, toInteger
|
||||||
from utils import DisplayFormat
|
from utils import DisplayFormat
|
||||||
|
|
||||||
def qdump__QAtomicInt(d, value):
|
def qdump__QAtomicInt(d, value):
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
from utils import DisplayFormat
|
from utils import DisplayFormat
|
||||||
from dumper import *
|
from dumper import Children, SubItem
|
||||||
|
|
||||||
def qform__std__array():
|
def qform__std__array():
|
||||||
return [DisplayFormat.ArrayPlotFormat]
|
return [DisplayFormat.ArrayPlotFormat]
|
||||||
|
Reference in New Issue
Block a user