本文整理汇总了Python中Tinker.value_error方法的典型用法代码示例。如果您正苦于以下问题:Python Tinker.value_error方法的具体用法?Python Tinker.value_error怎么用?Python Tinker.value_error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tinker
的用法示例。
在下文中一共展示了Tinker.value_error方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: verify
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import value_error [as 别名]
def verify(self):
"""
Verify that this object can implement the high level description
Arguments:
d -- A Description object, containing the complete description
of a the IP configuration
"""
if0 = self[self["interfaces"][0]]
if0.check_width(if0)
w = if0["width"]
if0.check_burst(if0)
b = if0["burst"]
for i in self["interfaces"]:
self[i].verify()
if(self[i]["width"] != w):
Tinker.value_error("width", self[i]["width"], str(w),
Tinker.tostr_dict(self))
if(self[i]["burst"] != b):
Tinker.value_error("burst", self[i]["burst"], str(b),
Tinker.tostr_dict(self))
self.check_size(self)
self.check_frequency(self)
self.check_roles(self)
self.check_interfaces(self)
self.check_role(self)
示例2: construct
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import value_error [as 别名]
def construct(t):
import GlobalMemoryInterface, HostInterface, KernelInterface
if(t == "GlobalMemory"):
return GlobalMemoryInterface.GlobalMemoryInterface
elif(t == "Host"):
return HostInterface.HostInterface
elif(t == "Kernel"):
return KernelInterface.KernelInterface
else:
Tinker.value_error("interfaces", str(t), str(Interface._C_INTERFACE_TYPES))
示例3: parse_interfaces
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import value_error [as 别名]
def parse_interfaces(cls, d):
ifs = d.get("interfaces",None)
if(ifs is None):
Tinker.key_error("interfaces",str(d))
if(isinstance(ifs, basestring)):
print "In description:"
Tinker.print_description(d)
Tinker.value_error("interfaces", str(ifs), "List")
for i in ifs:
if(ifs.count(i) > 1):
sys.exit("Error! Interface \"%s\" was not unique in list %s"
% (i, str(ifs)))
if(d.get(i,None) is None):
Tinker.key_error(i,str(d))
return ifs