本文整理汇总了Python中Tinker.value_error_xml方法的典型用法代码示例。如果您正苦于以下问题:Python Tinker.value_error_xml方法的具体用法?Python Tinker.value_error_xml怎么用?Python Tinker.value_error_xml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tinker
的用法示例。
在下文中一共展示了Tinker.value_error_xml方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parse_oct_pins
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import value_error_xml [as 别名]
def parse_oct_pins(cls, e):
pins = parse_list(e, "oct_pins")
for p in pins:
if(not Tinker.is_valid_verilog_name(p)):
Tinker.value_error_xml("oct_pins", p, "Valid Verilog Names",
ET.tostring(e))
return pins
示例2: parse_grouping
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import value_error_xml [as 别名]
def parse_grouping(cls, e):
ids = parse_list(e, "grouping")
for i in ids:
if(not Tinker.is_id(i)):
Tinker.value_error_xml("grouping", i, "Alphabetic Characters",
ET.tostring(e))
return ids
示例3: check_ratio
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import value_error_xml [as 别名]
def check_ratio(cls, d):
ratio = d.get("ratio")
if(ratio is None):
Tinker.key_error("ratio", Tinker.tostr_dict(d))
if(ratio not in cls._C_CLOCK_RATIOS):
Tinker.value_error_xml("ratio", ratio, str(list(cls._C_CLOCK_RATIOS)),
Tinker.tostr_dict(d))
示例4: parse_macros
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import value_error_xml [as 别名]
def parse_macros(e):
macros = parse_list(e, "macros")
for m in macros:
if(not Tinker.is_valid_verilog_name(m)):
Tinker.value_error_xml("macros", m, "Valid Verilog Names",
ET.tostring(e))
return macros
示例5: parse_string
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import value_error_xml [as 别名]
def parse_string(e, k):
s = e.get(k)
if(s is None):
Tinker.key_error(k, ET.tostring(e))
elif(not Tinker.is_string(s)):
Tinker.value_error_xml(k, s, "Strings", ET.tostring(e))
return s
示例6: check_ports
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import value_error_xml [as 别名]
def check_ports(cls, d):
ports = d.get("ports")
if(ports is None):
Tinker.key_error("ports", Tinker.tostr_dict(d))
for p in ports:
if(p not in cls._C_PORT_TYPES):
Tinker.value_error_xml("ports", p, str(list(cls._C_PORT_TYPES)),
Tinker.tostr_dict(d))
示例7: check_role
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import value_error_xml [as 别名]
def check_role(cls, d):
role = d.get("role")
roles = d.get("roles")
if(role is None):
Tinker.key_error("role", Tinker.tostr_dict(d))
if(roles is None):
Tinker.key_error("roles", Tinker.tostr_dict(d))
if(role not in cls._C_ROLES):
Tinker.value_error_xml("role", role, str(list(cls._C_ROLES)),
Tinker.tostr_dict(d))
if(role not in roles):
Tinker.value_error_map("role", role, str(roles),
Tinker.tostr_dict(d))
示例8: parse_roles
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import value_error_xml [as 别名]
def parse_roles(cls, e):
roles = parse_list(e, "roles")
for mr in roles:
if(mr not in cls._C_ROLES):
Tinker.value_error_xml("roles", mr, str(roles), ET.tostring(e))
return roles
示例9: parse_ratios
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import value_error_xml [as 别名]
def parse_ratios(cls, e):
mem_ratios = parse_list(e, "ratios")
for mr in mem_ratios:
if(mr not in cls._C_RATIOS):
Tinker.value_error_xml("ratios", mr, str(ratios), ET.tostring(e))
return mem_ratios
示例10: parse_ports
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import value_error_xml [as 别名]
def parse_ports(cls, e):
mem_ports = parse_list(e,"ports")
for mp in mem_ports:
if(mp not in cls._C_PORT_TYPES):
Tinker.value_error_xml("ports", mp, str(ports), ET.tostring(e))
return mem_ports
示例11: check_master
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import value_error_xml [as 别名]
def check_master(cls, d):
id = d.get("master")
if(not id.isalpha()):
Tinker.value_error_xml("master", id, "Alphabetic strings",
ET.tostring(e))
示例12: parse_int
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import value_error_xml [as 别名]
def parse_int(e, key):
s = parse_string(e, key)
try:
return int(s)
except ValueError:
Tinker.value_error_xml(ks, s, "Integers", ET.tostring(e))
示例13: parse_float
# 需要导入模块: import Tinker [as 别名]
# 或者: from Tinker import value_error_xml [as 别名]
def parse_float(e, key):
s = parse_string(e, key)
try:
return float(s)
except ValueError:
Tinker.value_error_xml(ks, s, "Real Numbers", ET.tostring(e))