当前位置: 首页>>代码示例>>Python>>正文


Python DotDict.process_type方法代码示例

本文整理汇总了Python中socorro.lib.util.DotDict.process_type方法的典型用法代码示例。如果您正苦于以下问题:Python DotDict.process_type方法的具体用法?Python DotDict.process_type怎么用?Python DotDict.process_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在socorro.lib.util.DotDict的用法示例。


在下文中一共展示了DotDict.process_type方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _add_process_type_to_processed_crash

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import process_type [as 别名]
    def _add_process_type_to_processed_crash(self, raw_crash):
        """ Electrolysis Support - Optional - raw_crash may contain a
        ProcessType of plugin. In the future this value would be default,
        content, maybe even Jetpack... This indicates which process was the
        crashing process.
        """
        process_type_additions_dict = DotDict()
        process_type = self._get_truncate_or_none(raw_crash,
                                                  'ProcessType',
                                                  10)
        if not process_type:
            return process_type_additions_dict
        process_type_additions_dict.process_type = process_type

        #logger.debug('processType %s', processType)
        if process_type == 'plugin':
            # Bug#543776 We actually will are relaxing the non-null policy...
            # a null filename, name, and version is OK. We'll use empty strings
            process_type_additions_dict.PluginFilename = (
                raw_crash.get('PluginFilename', '')
            )
            process_type_additions_dict.PluginName = (
                raw_crash.get('PluginName', '')
            )
            process_type_additions_dict.PluginVersion = (
                raw_crash.get('PluginVersion', '')
            )

        return process_type_additions_dict
开发者ID:ariaBennett,项目名称:socorro,代码行数:31,代码来源:legacy_processor.py

示例2: test_action_case_2

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import process_type [as 别名]
    def test_action_case_2(self):
        """sentinel exsits in stack, plus one secondary"""
        pc = DotDict()
        pc.process_type = 'plugin'
        pijd = copy.deepcopy(cannonical_json_dump)
        pc.json_dump = pijd
        pc.json_dump['crashing_thread']['frames'][2]['function'] = \
            'NtUserSetWindowPos'
        pc.json_dump['crashing_thread']['frames'][4]['function'] = \
            'F_1378698112'
        f2jd = copy.deepcopy(cannonical_json_dump)
        pc.upload_file_minidump_flash2 = DotDict()
        pc.upload_file_minidump_flash2.json_dump = f2jd

        fake_processor = create_basic_fake_processor()

        rc = DotDict()

        rule = SetWindowPos()
        action_result = rule.action(rc, pc, fake_processor)

        ok_(action_result)
        ok_('classifications' in pc)
        ok_('skunk_works' in pc.classifications)
        eq_(
            pc.classifications.skunk_works.classification,
            'NtUserSetWindowPos | F_1378698112'
        )
开发者ID:JisJis,项目名称:socorro,代码行数:30,代码来源:test_skunk_classifiers.py

示例3: test_action_case_1

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import process_type [as 别名]
    def test_action_case_1(self):
        """sentinel exsits in stack, but no secondaries"""
        pc = DotDict()
        pc.process_type = 'plugin'
        pijd = copy.deepcopy(cannonical_json_dump)
        pc.json_dump = pijd
        pc.json_dump['crashing_thread']['frames'][2]['function'] = \
            'NtUserSetWindowPos'
        f2jd = copy.deepcopy(cannonical_json_dump)
        pc.upload_file_minidump_flash2 = DotDict()
        pc.upload_file_minidump_flash2.json_dump = f2jd

        fake_processor = create_basic_fake_processor()

        rc = DotDict()

        rule = SetWindowPos()
        action_result = rule.action(rc, pc, fake_processor)

        self.assertTrue(action_result)
        self.assertTrue('classifications' in pc)
        self.assertTrue('skunk_works' in pc.classifications)
        self.assertEqual(
            pc.classifications.skunk_works.classification,
            'NtUserSetWindowPos | other'
        )
开发者ID:FishingCactus,项目名称:socorro,代码行数:28,代码来源:test_skunk_classifiers.py

示例4: test_action_success

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import process_type [as 别名]
    def test_action_success(self):
        jd = copy.deepcopy(cannonical_json_dump)
        jd['crashing_thread']['frames'][1]['function'] = (
            "F_1152915508___________________________________"
        )
        jd['crashing_thread']['frames'][3]['function'] = (
            "mozilla::plugins::PluginInstanceChild::UpdateWindowAttributes"
            "(bool)"
        )

        jd['crashing_thread']['frames'][5]['function'] = (
            "mozilla::ipc::RPCChannel::Call(IPC::Message*, IPC::Message*)"
        )

        pc = DotDict()
        pc.process_type = 'plugin'
        pc.json_dump = jd

        fake_processor = create_basic_fake_processor()

        rc = DotDict()
        rd = {}
        rule = UpdateWindowAttributes()
        action_result = rule.action(rc, rd, pc, fake_processor)

        ok_(action_result)
        ok_('classifications' in pc)
        ok_('skunk_works' in pc['classifications'])
开发者ID:adngdb,项目名称:socorro,代码行数:30,代码来源:test_skunk_classifiers.py

示例5: test_get_stack

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import process_type [as 别名]
    def test_get_stack(self):
        pc = DotDict()
        pc.process_type = "plugin"
        skunk_rule = SkunkClassificationRule()

        ok_(not skunk_rule._get_stack(pc, "upload_file_minidump_plugin"))

        pc.json_dump = DotDict()
        pc.json_dump.threads = []
        ok_(not skunk_rule._get_stack(pc, "upload_file_minidump_plugin"))

        pc.json_dump.crash_info = DotDict()
        pc.json_dump.crash_info.crashing_thread = 1
        ok_(not skunk_rule._get_stack(pc, "upload_file_minidump_plugin"))

        pc.json_dump = cannonical_json_dump
        eq_(skunk_rule._get_stack(pc, "upload_file_minidump_plugin"), cannonical_json_dump["crashing_thread"]["frames"])
开发者ID:JamJar,项目名称:socorro,代码行数:19,代码来源:test_skunk_classifiers.py

示例6: test_get_stack

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import process_type [as 别名]
    def test_get_stack(self):
        pc = DotDict()
        pc.process_type = 'plugin'
        skunk_rule = SkunkClassificationRule()
        processor = DotDict()

        self.assertFalse(skunk_rule._get_stack(pc, 'upload_file_minidump_plugin'))

        pc.json_dump = DotDict()
        pc.json_dump.threads = []
        self.assertFalse(skunk_rule._get_stack(pc, 'upload_file_minidump_plugin'))

        pc.json_dump.crash_info = DotDict()
        pc.json_dump.crash_info.crashing_thread = 1
        self.assertFalse(skunk_rule._get_stack(pc, 'upload_file_minidump_plugin'))

        pc.json_dump = cannonical_json_dump
        self.assertEqual(
            skunk_rule._get_stack(pc, 'upload_file_minidump_plugin'),
            cannonical_json_dump['crashing_thread']['frames']
        )
开发者ID:FishingCactus,项目名称:socorro,代码行数:23,代码来源:test_skunk_classifiers.py

示例7: test_action_case_1

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import process_type [as 别名]
    def test_action_case_1(self):
        """sentinel exsits in stack, but no secondaries"""
        pc = DotDict()
        pc.process_type = "plugin"
        pijd = copy.deepcopy(cannonical_json_dump)
        pc.json_dump = pijd
        pc.json_dump["crashing_thread"]["frames"][2]["function"] = "NtUserSetWindowPos"
        f2jd = copy.deepcopy(cannonical_json_dump)
        pc.upload_file_minidump_flash2 = DotDict()
        pc.upload_file_minidump_flash2.json_dump = f2jd

        fake_processor = create_basic_fake_processor()

        rc = DotDict()

        rule = SetWindowPos()
        action_result = rule.action(rc, pc, fake_processor)

        ok_(action_result)
        ok_("classifications" in pc)
        ok_("skunk_works" in pc.classifications)
        eq_(pc.classifications.skunk_works.classification, "NtUserSetWindowPos | other")
开发者ID:JamJar,项目名称:socorro,代码行数:24,代码来源:test_skunk_classifiers.py

示例8: _create_basic_processed_crash

# 需要导入模块: from socorro.lib.util import DotDict [as 别名]
# 或者: from socorro.lib.util.DotDict import process_type [as 别名]
    def _create_basic_processed_crash(self,
                                      uuid,
                                      raw_crash,
                                      submitted_timestamp,
                                      started_timestamp,
                                      processor_notes):
        """
        This function is run only by a worker thread.
          Create the record for the current job in the 'reports' table
          input parameters:
            uuid: the unique id identifying the job - corresponds with the
                  uuid column in the 'jobs' and the 'reports' tables
            jsonDocument: an object with a dictionary interface for fetching
                          the components of the json document
            submitted_timestamp: when job came in (a key used in partitioning)
            processor_notes: list of strings of error messages
        """
        #logger.debug("starting insertReportIntoDatabase")
        processed_crash = DotDict()
        processed_crash.success = False
        processed_crash.uuid = uuid
        processed_crash.startedDateTime = started_timestamp
        processed_crash.product = self._get_truncate_or_warn(
            raw_crash,
            'ProductName',
            processor_notes,
            None,
            30
        )
        processed_crash.version = self._get_truncate_or_warn(
            raw_crash,
            'Version',
            processor_notes,
            None,
            16
        )
        processed_crash.build = self._get_truncate_or_warn(
            raw_crash,
            'BuildID',
            processor_notes,
            None,
            16
        )
        processed_crash.url = self._get_truncate_or_none(
            raw_crash,
            'URL',
            255
        )
        processed_crash.user_comments = self._get_truncate_or_none(
            raw_crash,
            'Comments',
            500
        )
        processed_crash.app_notes = self._get_truncate_or_none(
            raw_crash,
            'Notes',
            1000
        )
        processed_crash.distributor = self._get_truncate_or_none(
            raw_crash,
            'Distributor',
            20
        )
        processed_crash.distributor_version = self._get_truncate_or_none(
            raw_crash,
            'Distributor_version',
            20
        )
        processed_crash.email = self._get_truncate_or_none(
            raw_crash,
            'Email',
            100
        )
        processed_crash.process_type = self._get_truncate_or_none(
            raw_crash,
            'ProcessType',
            10
        )
        processed_crash.release_channel = raw_crash.get(
            'ReleaseChannel',
            'unknown'
        )
        # userId is now deprecated and replace with empty string
        processed_crash.user_id = ""

        # ++++++++++++++++++++
        # date transformations
        processed_crash.date_processed = submitted_timestamp

        # defaultCrashTime: must have crashed before date processed
        submitted_timestamp_as_epoch = int(
            time.mktime(submitted_timestamp.timetuple())
        )
        timestampTime = int(
            raw_crash.get('timestamp', submitted_timestamp_as_epoch)
            )  # the old name for crash time
        crash_time = int(
            self._get_truncate_or_warn(
                raw_crash,
                'CrashTime',
#.........这里部分代码省略.........
开发者ID:ariaBennett,项目名称:socorro,代码行数:103,代码来源:legacy_processor.py


注:本文中的socorro.lib.util.DotDict.process_type方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。