本文整理汇总了Python中socorro.lib.util.DotDict.dump_checksums方法的典型用法代码示例。如果您正苦于以下问题:Python DotDict.dump_checksums方法的具体用法?Python DotDict.dump_checksums怎么用?Python DotDict.dump_checksums使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类socorro.lib.util.DotDict
的用法示例。
在下文中一共展示了DotDict.dump_checksums方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _make_raw_crash_and_dumps
# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import dump_checksums [as 别名]
def _make_raw_crash_and_dumps(self, form):
dumps = DotDict()
raw_crash = DotDict()
raw_crash.dump_checksums = DotDict()
for name, value in form.iteritems():
if isinstance(value, basestring):
raw_crash[name] = value
elif hasattr(value, 'file') and hasattr(value, 'value'):
dumps[name] = value.value
raw_crash.dump_checksums[name] = \
self.config.collector.checksum_method(
value.value
).hexdigest()
elif isinstance(value, int):
raw_crash[name] = value
else:
raw_crash[name] = value.value
return raw_crash, dumps
示例2: _get_raw_crash_from_form
# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import dump_checksums [as 别名]
def _get_raw_crash_from_form(self):
"""this method creates the raw_crash and the dumps mapping using the
POST form"""
dumps = MemoryDumpsMapping()
raw_crash = DotDict()
raw_crash.dump_checksums = DotDict()
for name, value in self._form_as_mapping().iteritems():
name = self._no_x00_character(name)
if isinstance(value, basestring):
if name != "dump_checksums":
raw_crash[name] = self._no_x00_character(value)
elif hasattr(value, 'file') and hasattr(value, 'value'):
dumps[name] = value.value
raw_crash.dump_checksums[name] = \
self.checksum_method(value.value).hexdigest()
elif isinstance(value, int):
raw_crash[name] = value
else:
raw_crash[name] = value.value
return raw_crash, dumps