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):
|
||||
#leftType = value.type[0]
|
||||
|
@@ -28,11 +28,12 @@ import os
|
||||
import sys
|
||||
import cdbext
|
||||
import re
|
||||
import threading
|
||||
from utils import TypeCode
|
||||
|
||||
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):
|
||||
def __init__(self, name , dumper):
|
||||
|
@@ -23,8 +23,6 @@
|
||||
#
|
||||
############################################################################
|
||||
|
||||
from dumper import *
|
||||
|
||||
def typeTarget(type):
|
||||
target = type.target()
|
||||
if target:
|
||||
|
@@ -164,11 +164,11 @@ class DumperBase:
|
||||
|
||||
@staticmethod
|
||||
def showException(msg, exType, exValue, exTraceback):
|
||||
self.warn('**** CAUGHT EXCEPTION: %s ****' % msg)
|
||||
DumperBase.warn('**** CAUGHT EXCEPTION: %s ****' % msg)
|
||||
try:
|
||||
import traceback
|
||||
for line in traceback.format_exception(exType, exValue, exTraceback):
|
||||
self.warn('%s' % line)
|
||||
DumperBase.warn('%s' % line)
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -335,7 +335,7 @@ class DumperBase:
|
||||
# (self.currentIName, self.currentValue, self.currentType))
|
||||
if not exType is None:
|
||||
if self.passExceptions:
|
||||
showException('SUBITEM', exType, exValue, exTraceBack)
|
||||
self.showException('SUBITEM', exType, exValue, exTraceBack)
|
||||
self.putSpecialValue('notaccessible')
|
||||
self.putNumChild(0)
|
||||
if not self.isCli:
|
||||
|
@@ -37,7 +37,7 @@ import struct
|
||||
import tempfile
|
||||
import types
|
||||
|
||||
from dumper import *
|
||||
from dumper import DumperBase, Children, toInteger, TopLevelItem
|
||||
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:
|
||||
reload(sys.modules['dumper'])
|
||||
|
||||
from dumper import *
|
||||
from dumper import DumperBase, SubItem, Children, TopLevelItem
|
||||
|
||||
#######################################################################
|
||||
#
|
||||
@@ -1897,8 +1897,8 @@ class Tester(Dumper):
|
||||
break
|
||||
|
||||
else:
|
||||
d.warn('TIMEOUT')
|
||||
d.warn('Cannot determined stopped thread')
|
||||
self.warn('TIMEOUT')
|
||||
self.warn('Cannot determined stopped thread')
|
||||
|
||||
lldb.SBDebugger.Destroy(self.debugger)
|
||||
|
||||
@@ -1984,7 +1984,7 @@ class SummaryDumper(Dumper, LogMixin):
|
||||
return # Don't mess up lldb output
|
||||
|
||||
def lookupNativeTypeInAllModules(self, name):
|
||||
d.warn('Failed to resolve type %s' % name)
|
||||
self.warn('Failed to resolve type %s' % name)
|
||||
return None
|
||||
|
||||
def dump_summary(self, valobj, expanded = False):
|
||||
|
@@ -23,8 +23,8 @@
|
||||
#
|
||||
############################################################################
|
||||
|
||||
from dumper import *
|
||||
from utils import TypeCode
|
||||
from dumper import Children, SubItem
|
||||
from utils import TypeCode, DisplayFormat
|
||||
import re
|
||||
|
||||
#######################################################################
|
||||
@@ -323,7 +323,7 @@ def qdump__KDSoapValue1(d, value):
|
||||
d.putPlainChildren(inner)
|
||||
|
||||
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.putPlainChildren(value['d']['d'].dereference())
|
||||
|
||||
|
@@ -23,8 +23,8 @@
|
||||
#
|
||||
############################################################################
|
||||
|
||||
from dumper import *
|
||||
from utils import TypeCode
|
||||
from dumper import Children, SubItem
|
||||
from utils import TypeCode, DisplayFormat
|
||||
|
||||
def qdump__cv__Size_(d, value):
|
||||
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 complex examples.
|
||||
|
||||
from dumper import *
|
||||
import dumper
|
||||
|
||||
######################## Your code below #######################
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
import platform
|
||||
import re
|
||||
from dumper import *
|
||||
from dumper import Children, SubItem, UnnamedSubItem, toInteger
|
||||
from utils import DisplayFormat
|
||||
|
||||
def qdump__QAtomicInt(d, value):
|
||||
|
@@ -24,7 +24,7 @@
|
||||
############################################################################
|
||||
|
||||
from utils import DisplayFormat
|
||||
from dumper import *
|
||||
from dumper import Children, SubItem
|
||||
|
||||
def qform__std__array():
|
||||
return [DisplayFormat.ArrayPlotFormat]
|
||||
|
Reference in New Issue
Block a user