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


Python Platform.python_architecture方法代码示例

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


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

示例1: _header_lines

# 需要导入模块: from utils.platform import Platform [as 别名]
# 或者: from utils.platform.Platform import python_architecture [as 别名]
    def _header_lines(self, indent, title=None):
        # Don't indent the header
        lines = self._title_lines(title)
        if self.created_seconds_ago() > 120:
            styles = ['red', 'bold']
        else:
            styles = []
        # We color it in red if the status is too old
        fields = [
            (
                style("Status date", *styles),
                style("%s (%ss ago)" % (
                    self.created_at.strftime('%Y-%m-%d %H:%M:%S'),
                    self.created_seconds_ago()), *styles
                )
            )
        ]

        fields += [
            ("Pid", self.created_by_pid),
            ("Platform", platform.platform()),
            ("Python Version", "%s, %s" % (
                platform.python_version(),
                Platform.python_architecture())),
            ("Logs", logger_info()),
        ]

        for key, value in fields:
            l = indent + "%s: %s" % (key, value)
            lines.append(l)
        return lines + [""]
开发者ID:tschellhorn,项目名称:dd-agent,代码行数:33,代码来源:check_status.py

示例2: latest_status

# 需要导入模块: from utils.platform import Platform [as 别名]
# 或者: from utils.platform.Platform import python_architecture [as 别名]
 def latest_status(self):
     try:
         loaded_template = template.Loader(".")
         dogstatsd_status = DogstatsdStatus.load_latest_status()
         forwarder_status = ForwarderStatus.load_latest_status()
         collector_status = CollectorStatus.load_latest_status()
         generated_template = loaded_template.load("status.html").generate(
             port=22,
             platform=platform.platform(),
             agent_version=get_version(),
             python_version=platform.python_version(),
             python_architecture=Platform.python_architecture(),
             logger_info=logger_info(),
             dogstatsd=dogstatsd_status.to_dict(),
             forwarder=forwarder_status.to_dict(),
             collector=collector_status.to_dict(),
         )
         return generated_template
     except Exception:
         return ("Unable to fetch latest status")
开发者ID:ross,项目名称:dd-agent,代码行数:22,代码来源:gui.py


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