• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python states.getProcessStateDescription函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中supervisor.states.getProcessStateDescription函数的典型用法代码示例。如果您正苦于以下问题:Python getProcessStateDescription函数的具体用法?Python getProcessStateDescription怎么用?Python getProcessStateDescription使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: _assertInState

 def _assertInState(self, *states):
     if self.state not in states:
         current_state = getProcessStateDescription(self.state)
         allowable_states = ' '.join(map(getProcessStateDescription, states))
         self.config.options.logger.error("Assertion ERROR: current_state(%s) not in expected(%s)" % current_state, allowable_states)
         raise AssertionError('Assertion failed for %s: %s not in %s' %  (
             self.config.name, current_state, allowable_states))
开发者ID:lifsong,项目名称:supervisor,代码行数:7,代码来源:process.py


示例2: _assertInState

 def _assertInState(self, *states):
     if self.state not in states:
         current_state = getProcessStateDescription(self.state)
         allowable_states = " ".join(map(getProcessStateDescription, states))
         raise AssertionError(
             "Assertion failed for %s: %s not in %s" % (self.config.name, current_state, allowable_states)
         )
开发者ID:fedosov,项目名称:supervisor,代码行数:7,代码来源:process.py


示例3: _assertInState

 def _assertInState(self, *states):
     if self.state not in states:
         current_state = getProcessStateDescription(self.state)
         allowable_states = ' '.join(map(getProcessStateDescription, states))
         processname = as_string(self.config.name)
         raise AssertionError('Assertion failed for %s: %s not in %s' %  (
             processname, current_state, allowable_states))
开发者ID:the5fire,项目名称:supervisor,代码行数:7,代码来源:process.py


示例4: payload

 def payload(self):
     groupname = ''
     if self.process.group is not None:
         groupname = self.process.group.config.name
     L = [('processname', self.process.config.name), ('groupname', groupname),
          ('from_state', getProcessStateDescription(self.from_state))]
     L.extend(self.extra_values)
     s = ' '.join( [ '%s:%s' % (name, val) for (name, val) in L ] )
     return s
开发者ID:Supervisor,项目名称:supervisor,代码行数:9,代码来源:events.py


示例5: __repr__

 def __repr__(self):
     # repr can't return anything other than a native string,
     # but the name might be unicode - a problem on Python 2.
     name = self.config.name
     if PY2:
         name = as_string(name).encode('unicode-escape')
     return '<Subprocess at %s with name %s in state %s>' % (
         id(self),
         name,
         getProcessStateDescription(self.get_state()))
开发者ID:the5fire,项目名称:supervisor,代码行数:10,代码来源:process.py


示例6: getProcessInfo

    def getProcessInfo(self, name):
        """ Get info about a process named name

        @param string name The name of the process (or 'group:name')
        @return struct result     A structure containing data about the process
        """
        self._update('getProcessInfo')

        group, process = self._getGroupAndProcess(name)

        if process is None:
            raise RPCError(Faults.BAD_NAME, name)

        # TODO timestamps are returned as xml-rpc integers for b/c but will
        # saturate the xml-rpc integer type in jan 2038 ("year 2038 problem").
        # future api versions should return timestamps as a different type.
        start = capped_int(process.laststart)
        stop = capped_int(process.laststop)
        now = capped_int(self._now())

        state = process.get_state()
        spawnerr = process.spawnerr or ''
        exitstatus = process.exitstatus or 0
        stdout_logfile = process.config.stdout_logfile or ''
        stderr_logfile = process.config.stderr_logfile or ''

        info = {
            'name':process.config.name,
            'group':group.config.name,
            'start':start,
            'stop':stop,
            'now':now,
            'state':state,
            'statename':getProcessStateDescription(state),
            'spawnerr':spawnerr,
            'exitstatus':exitstatus,
            'logfile':stdout_logfile, # b/c alias
            'stdout_logfile':stdout_logfile,
            'stderr_logfile':stderr_logfile,
            'pid':process.pid,
            }

        description = self._interpretProcessInfo(info)
        info['description'] = description
        return info
开发者ID:shendadi,项目名称:flaskauth,代码行数:45,代码来源:rpcinterface.py


示例7: shutdown_report

    def shutdown_report(self):
        unstopped = []

        for group in self.process_groups.values():
            unstopped.extend(group.get_unstopped_processes())

        if unstopped:
            # throttle 'waiting for x to die' reports
            now = time.time()
            if now > (self.lastshutdownreport + 3):  # every 3 secs
                names = [p.config.name for p in unstopped]
                namestr = ', '.join(names)
                self.options.logger.info('waiting for %s to die' % namestr)
                self.lastshutdownreport = now
                for proc in unstopped:
                    state = getProcessStateDescription(proc.get_state())
                    self.options.logger.blather('%s state: %s' % (proc.config.name, state))
        return unstopped
开发者ID:alexsilva,项目名称:supervisor,代码行数:18,代码来源:supervisord.py


示例8: getProcessInfo

    def getProcessInfo(self, name):
        """ Get info about a process named name

        :param name: The name of the process (or 'group:name')
        :type name: string
        :return: A structure containing data about the process
        :rtype: struct
        """
        self._update('getProcessInfo')

        group, process = self._getGroupAndProcess(name)

        if process is None:
            raise RPCError(Faults.BAD_NAME, name)

        start = int(process.laststart)
        stop = int(process.laststop)
        now = int(time.time())

        state = process.get_state()
        spawnerr = process.spawnerr or ''
        exitstatus = process.exitstatus or 0
        stdout_logfile = process.config.stdout_logfile or ''
        stderr_logfile = process.config.stderr_logfile or ''

        info = {
            'name':process.config.name,
            'group':group.config.name,
            'start':start,
            'stop':stop,
            'now':now,
            'state':state,
            'statename':getProcessStateDescription(state),
            'spawnerr':spawnerr,
            'exitstatus':exitstatus,
            'logfile':stdout_logfile, # b/c alias
            'stdout_logfile':stdout_logfile,
            'stderr_logfile':stderr_logfile,
            'pid':process.pid,
            }

        description = self._interpretProcessInfo(info)
        info['description'] = description
        return info
开发者ID:EvaSDK,项目名称:supervisor,代码行数:44,代码来源:rpcinterface.py


示例9: getProcessInfo

    def getProcessInfo(self, name):
        """ Get info about a process named name

        @param string name The name of the process (or 'group:name')
        @return struct result     A structure containing data about the process
        """
        self._update("getProcessInfo")

        group, process = self._getGroupAndProcess(name)

        if process is None:
            raise RPCError(Faults.BAD_NAME, name)

        start = int(process.laststart)
        stop = int(process.laststop)
        now = int(time.time())

        state = process.get_state()
        spawnerr = process.spawnerr or ""
        exitstatus = process.exitstatus or 0
        stdout_logfile = process.config.stdout_logfile or ""
        stderr_logfile = process.config.stderr_logfile or ""

        info = {
            "name": process.config.name,
            "group": group.config.name,
            "start": start,
            "stop": stop,
            "now": now,
            "state": state,
            "statename": getProcessStateDescription(state),
            "spawnerr": spawnerr,
            "exitstatus": exitstatus,
            "logfile": stdout_logfile,  # b/c alias
            "stdout_logfile": stdout_logfile,
            "stderr_logfile": stderr_logfile,
            "pid": process.pid,
        }

        description = self._interpretProcessInfo(info)
        info["description"] = description
        return info
开发者ID:red-crown,项目名称:supervisor,代码行数:42,代码来源:rpcinterface.py


示例10: getProcessInfo

    def getProcessInfo(self, name):
        """ Get info about a process named name

        @param string name The name of the process (or 'group:name')
        @return struct result     A structure containing data about the process
        """
        self._update('getProcessInfo')

        group, process = self._getGroupAndProcess(name)

        start = int(process.laststart)
        stop = int(process.laststop)
        now = int(time.time())
        
        state = process.get_state()
        spawnerr = process.spawnerr or ''
        exitstatus = process.exitstatus or 0
        stdout_logfile = process.config.stdout_logfile or ''
        stderr_logfile = process.config.stderr_logfile or ''

        info = {
            'name':process.config.name,
            'group':group.config.name,
            'start':start,
            'stop':stop,
            'now':now,
            'state':state,
            'statename':getProcessStateDescription(state),
            'spawnerr':spawnerr,
            'exitstatus':exitstatus,
            'logfile':stdout_logfile, # b/c alias
            'stdout_logfile':stdout_logfile,
            'stderr_logfile':stderr_logfile,
            'restartsignal': process.config.restartsignal,
            'pid':process.pid,
            }
        
        description = self._interpretProcessInfo(info)
        info['description'] = description
        return info
开发者ID:fedosov,项目名称:supervisor,代码行数:40,代码来源:rpcinterface.py


示例11: test_getProcessStateDescription_returns_None_when_not_found

 def test_getProcessStateDescription_returns_None_when_not_found(self):
     self.assertEqual(states.getProcessStateDescription(3.14159),
         None)
开发者ID:WLPhoenix,项目名称:supervisor-py3k,代码行数:3,代码来源:test_states.py


示例12: test_getProcessStateDescription_returns_string_when_found

 def test_getProcessStateDescription_returns_string_when_found(self):
     state = states.ProcessStates.STARTING
     self.assertEqual(states.getProcessStateDescription(state),
         'STARTING')
开发者ID:WLPhoenix,项目名称:supervisor-py3k,代码行数:4,代码来源:test_states.py


示例13: __repr__

 def __repr__(self):
     return '<Subprocess at %s with name %s in state %s>' % (
         id(self),
         self.config.name,
         getProcessStateDescription(self.get_state()))
开发者ID:JeremyGrosser,项目名称:supervisor,代码行数:5,代码来源:process.py


示例14: _get_state_desc

def _get_state_desc(state):
  desc = getProcessStateDescription(state)
  if desc:
    return desc
  return str(state)
开发者ID:jsipprell,项目名称:supervisor-restarter,代码行数:5,代码来源:restarter.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python states.getSupervisorStateDescription函数代码示例发布时间:2022-05-27
下一篇:
Python options.ClientOptions类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap