本文整理汇总了Python中lib.core.datatype.AttribDict方法的典型用法代码示例。如果您正苦于以下问题:Python datatype.AttribDict方法的具体用法?Python datatype.AttribDict怎么用?Python datatype.AttribDict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.core.datatype
的用法示例。
在下文中一共展示了datatype.AttribDict方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initialize_options
# 需要导入模块: from lib.core import datatype [as 别名]
# 或者: from lib.core.datatype import AttribDict [as 别名]
def initialize_options(self, taskid):
datatype = {"boolean": False, "string": None, "integer": None, "float": None}
self.options = AttribDict()
for _ in optDict:
for name, type_ in optDict[_].items():
type_ = unArrayizeValue(type_)
self.options[name] = _defaults.get(name, datatype[type_])
# Let sqlmap engine knows it is getting called by the API,
# the task ID and the file path of the IPC database
self.options.api = True
self.options.taskid = taskid
self.options.database = Database.filepath
# Enforce batch mode and disable coloring and ETA
self.options.batch = True
self.options.disableColoring = True
self.options.eta = False
self._original_options = AttribDict(self.options)
示例2: reset_options
# 需要导入模块: from lib.core import datatype [as 别名]
# 或者: from lib.core.datatype import AttribDict [as 别名]
def reset_options(self):
self.options = AttribDict(self._original_options)
示例3: parseXmlNode
# 需要导入模块: from lib.core import datatype [as 别名]
# 或者: from lib.core.datatype import AttribDict [as 别名]
def parseXmlNode(node):
for element in node.getiterator('boundary'):
boundary = AttribDict()
for child in element.getchildren():
if child.text:
values = cleanupVals(child.text, child.tag)
boundary[child.tag] = values
else:
boundary[child.tag] = None
conf.boundaries.append(boundary)
for element in node.getiterator('test'):
test = AttribDict()
for child in element.getchildren():
if child.text and child.text.strip():
values = cleanupVals(child.text, child.tag)
test[child.tag] = values
else:
if len(child.getchildren()) == 0:
test[child.tag] = None
continue
else:
test[child.tag] = AttribDict()
for gchild in child.getchildren():
if gchild.tag in test[child.tag]:
prevtext = test[child.tag][gchild.tag]
test[child.tag][gchild.tag] = [prevtext, gchild.text]
else:
test[child.tag][gchild.tag] = gchild.text
conf.tests.append(test)
示例4: _setPrefixSuffix
# 需要导入模块: from lib.core import datatype [as 别名]
# 或者: from lib.core.datatype import AttribDict [as 别名]
def _setPrefixSuffix():
if conf.prefix is not None and conf.suffix is not None:
# Create a custom boundary object for user's supplied prefix
# and suffix
boundary = AttribDict()
boundary.level = 1
boundary.clause = [0]
boundary.where = [1, 2, 3]
boundary.prefix = conf.prefix
boundary.suffix = conf.suffix
if " like" in boundary.suffix.lower():
if "'" in boundary.suffix.lower():
boundary.ptype = 3
elif '"' in boundary.suffix.lower():
boundary.ptype = 5
elif "'" in boundary.suffix:
boundary.ptype = 2
elif '"' in boundary.suffix:
boundary.ptype = 4
else:
boundary.ptype = 1
# user who provides --prefix/--suffix does not want other boundaries
# to be tested for
conf.boundaries = [boundary]
示例5: initOptions
# 需要导入模块: from lib.core import datatype [as 别名]
# 或者: from lib.core.datatype import AttribDict [as 别名]
def initOptions(inputOptions=AttribDict(), overrideOptions=False):
if IS_WIN:
coloramainit()
_setConfAttributes()
_setKnowledgeBaseAttributes()
_mergeOptions(inputOptions, overrideOptions)
示例6: parseXmlNode
# 需要导入模块: from lib.core import datatype [as 别名]
# 或者: from lib.core.datatype import AttribDict [as 别名]
def parseXmlNode(node):
for element in node.getiterator("boundary"):
boundary = AttribDict()
for child in element.getchildren():
if child.text:
values = cleanupVals(child.text, child.tag)
boundary[child.tag] = values
else:
boundary[child.tag] = None
conf.boundaries.append(boundary)
for element in node.getiterator("test"):
test = AttribDict()
for child in element.getchildren():
if child.text and child.text.strip():
values = cleanupVals(child.text, child.tag)
test[child.tag] = values
else:
if len(child.getchildren()) == 0:
test[child.tag] = None
continue
else:
test[child.tag] = AttribDict()
for gchild in child.getchildren():
if gchild.tag in test[child.tag]:
prevtext = test[child.tag][gchild.tag]
test[child.tag][gchild.tag] = [prevtext, gchild.text]
else:
test[child.tag][gchild.tag] = gchild.text
conf.tests.append(test)
示例7: initOptions
# 需要导入模块: from lib.core import datatype [as 别名]
# 或者: from lib.core.datatype import AttribDict [as 别名]
def initOptions(inputOptions=AttribDict(), overrideOptions=False):
_setConfAttributes()
_setKnowledgeBaseAttributes()
_mergeOptions(inputOptions, overrideOptions)