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


Python Utils.fatalIfNotInstanceOf方法代码示例

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


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

示例1: __init__

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import fatalIfNotInstanceOf [as 别名]
    def __init__ (self, logger, keyPath, op, oldv, newv, subscriptionId):
        Utils.fatalIfNotInstanceOf(keyPath, KeyPath)
        Utils.fatalIfNotInstanceOf(op, pyconfdlib.ConfdIterOp)
        Utils.fatalIfNotInstanceOf(oldv, Value, allowNone=True)
        Utils.fatalIfNotInstanceOf(newv, Value, allowNone=True)
        Utils.fatalIfNotInstanceOf(subscriptionId, int)

        self._log=logger.createLogger("sys-blinky","trx-element")
        for logFunc in self._log('iterate-ctor').debug4Func(): logFunc('TrxElement Ctor - op=%s, keyPath=%s, newv=%s', str(op), str(keyPath), str(newv))
        self.myKeyPath=None
        if oldv:
            self.myOldVal = oldv
        else:
            self.myOldVal = None
        if newv:
            self.myNewVal = newv
        else:
            self.myNewVal = None
        self.myBlinkyNode=None
        self.myBlinkyNodeKeyDepth=0
        self.mySubscriptionId=subscriptionId
        # Create a list with 3 False values
        __pychecker__="no-local"   # x is not used
        self.myPreparePassed=[ False for x in range(TrxPhase.kBlinkyLast.getValue()) ]

        for logFunc in self._log("ctor").debug4Func(): logFunc("ctor. op=%s", op)
        self.myKeyPath=keyPath

        if op==pyconfdlib.MOP_CREATED:
            self.myOp=self.kCreate
            for logFunc in self._log("iterate-created").debug4Func(): logFunc("config node created")
        elif op==pyconfdlib.MOP_DELETED:
            self.myOp=self.kDelete
            for logFunc in self._log("iterate-deleted").debug4Func(): logFunc("config node deleted")
        elif op==pyconfdlib.MOP_VALUE_SET:
            self.myOp=self.kValueSet
            for logFunc in self._log("iterate-value-set").debug4Func(): logFunc("config node value set from %s to %s", oldv, newv)
        elif op==pyconfdlib.MOP_MODIFIED:
            pass
        elif op==pyconfdlib.MOP_MOVED_AFTER:
            self.myOp=self.kMovedAfter
            for logFunc in self._log("iterate-moved-after").debug4Func(): logFunc("config node moved-after")
            pass
        else:
            a.infra.process.processFatal("Got unexpected op %s in cdb_diff_iterate()" % op)

        for logFunc in self._log("ctor-ended").debug4Func(): logFunc("ctor-ended op=%s", op)
开发者ID:afeset,项目名称:miner2-tools,代码行数:49,代码来源:trx_element.py

示例2: copyFrom

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import fatalIfNotInstanceOf [as 别名]
 def copyFrom (self, other):
     Utils.fatalIfNotInstanceOf(other, TrxPhase)
     self.myConfdPhase=copy.deepcopy(other.myConfdPhase)
     self.myBlinkyPhase=copy.deepcopy(other.myBlinkyPhase)
开发者ID:afeset,项目名称:miner2-tools,代码行数:6,代码来源:trx_phase.py

示例3: __init__

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import fatalIfNotInstanceOf [as 别名]
 def __init__ (self, confdPhase, blinkyPhase):
     Utils.fatalIfNotInstanceOf(confdPhase, self.TrxConfdPhase)
     Utils.fatalIfNotInstanceOf(blinkyPhase, self.TrxBlinkyPhase)
     self.myConfdPhase=copy.deepcopy(confdPhase)
     self.myBlinkyPhase=copy.deepcopy(blinkyPhase)
开发者ID:afeset,项目名称:miner2-tools,代码行数:7,代码来源:trx_phase.py

示例4: copyFrom

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import fatalIfNotInstanceOf [as 别名]
 def copyFrom (self, other):
     Utils.fatalIfNotInstanceOf(other, TrxProgress)
     self.myProgressStage=copy.deepcopy(other.myProgressStage)
     self.myTrxPhase=copy.deepcopy(other.myTrxPhase)
开发者ID:afeset,项目名称:miner2-tools,代码行数:6,代码来源:trx_progress.py

示例5: __init__

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import fatalIfNotInstanceOf [as 别名]
 def __init__ (self, trxPhase, progressStage):
     Utils.fatalIfNotInstanceOf(progressStage, self.TrxProgressStages)
     self.myProgressStage=copy.deepcopy(progressStage)
     self.myTrxPhase=copy.deepcopy(trxPhase)
开发者ID:afeset,项目名称:miner2-tools,代码行数:6,代码来源:trx_progress.py

示例6: setBlinkyNode

# 需要导入模块: from utils import Utils [as 别名]
# 或者: from utils.Utils import fatalIfNotInstanceOf [as 别名]
 def setBlinkyNode(self, blinkyNode, blinkyNodeKeyDepth):
     for logFunc in self._log("set-blinky-node").debug4Func(): logFunc("setBlinkyNode(): called, blinkyNode=%s", blinkyNode)
     Utils.fatalIfNotInstanceOf(blinkyNodeKeyDepth, int)
     self.myBlinkyNode = blinkyNode
     self.myBlinkyNodeKeyDepth = blinkyNodeKeyDepth
开发者ID:afeset,项目名称:miner2-tools,代码行数:7,代码来源:trx_element.py


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