本文整理汇总了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)
示例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)
示例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)
示例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)
示例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)
示例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