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


Python ProcessContext.get_type方法代码示例

本文整理汇总了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
开发者ID:strategist922,项目名称:scheduler,代码行数:47,代码来源:views.py


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