本文整理汇总了Python中system.process_context.ProcessContext.get_type方法的典型用法代码示例。如果您正苦于以下问题:Python ProcessContext.get_type方法的具体用法?Python ProcessContext.get_type怎么用?Python ProcessContext.get_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类system.process_context.ProcessContext
的用法示例。
在下文中一共展示了ProcessContext.get_type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _get_nodes_details
# 需要导入模块: from system.process_context import ProcessContext [as 别名]
# 或者: from system.process_context.ProcessContext import get_type [as 别名]
def _get_nodes_details(self, tree):
timetable = self.mbean.timetable
description = dict()
description['reprocessing_queues'] = dict()
description['processes'] = dict()
description['next_timeperiods'] = dict()
try:
# workaround for importing "scheduler" package
if type(tree).__name__ == 'FourLevelTree':
description['number_of_levels'] = 4
description['reprocessing_queues']['yearly'] = self._get_reprocessing_details(tree.process_yearly)
description['reprocessing_queues']['monthly'] = self._get_reprocessing_details(tree.process_monthly)
description['reprocessing_queues']['daily'] = self._get_reprocessing_details(tree.process_daily)
description['reprocessing_queues']['hourly'] = self._get_reprocessing_details(tree.process_hourly)
description['processes']['yearly'] = tree.process_yearly
description['processes']['monthly'] = tree.process_monthly
description['processes']['daily'] = tree.process_daily
description['processes']['hourly'] = tree.process_hourly
description['next_timeperiods']['yearly'] = timetable.get_next_timetable_record(tree.process_yearly).get_timestamp()
description['next_timeperiods']['monthly'] = timetable.get_next_timetable_record(tree.process_monthly).get_timestamp()
description['next_timeperiods']['daily'] = timetable.get_next_timetable_record(tree.process_daily).get_timestamp()
description['next_timeperiods']['hourly'] = timetable.get_next_timetable_record(tree.process_hourly).get_timestamp()
description['type'] = ProcessContext.get_type(tree.process_yearly)
elif type(tree).__name__ == 'ThreeLevelTree':
description['number_of_levels'] = 3
description['reprocessing_queues']['yearly'] = self._get_reprocessing_details(tree.process_yearly)
description['reprocessing_queues']['monthly'] = self._get_reprocessing_details(tree.process_monthly)
description['reprocessing_queues']['daily'] = self._get_reprocessing_details(tree.process_daily)
description['processes']['yearly'] = tree.process_yearly
description['processes']['monthly'] = tree.process_monthly
description['processes']['daily'] = tree.process_daily
description['next_timeperiods']['yearly'] = timetable.get_next_timetable_record(tree.process_yearly).get_timestamp()
description['next_timeperiods']['monthly'] = timetable.get_next_timetable_record(tree.process_monthly).get_timestamp()
description['next_timeperiods']['daily'] = timetable.get_next_timetable_record(tree.process_daily).get_timestamp()
description['type'] = ProcessContext.get_type(tree.process_yearly)
elif type(tree).__name__ == 'TwoLevelTree':
description['number_of_levels'] = 1
description['reprocessing_queues']['linear'] = self._get_reprocessing_details(tree.process_name)
description['processes']['linear'] = tree.process_name
description['next_timeperiods']['daily'] = timetable.get_next_timetable_record(tree.process_name).get_timestamp()
description['type'] = ProcessContext.get_type(tree.process_name)
except Exception as e:
self.logger.error('MX Exception: ' + str(e), exc_info=True)
finally:
return description