本文整理匯總了Python中pygccxml.declarations.templates.split方法的典型用法代碼示例。如果您正苦於以下問題:Python templates.split方法的具體用法?Python templates.split怎麽用?Python templates.split使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pygccxml.declarations.templates
的用法示例。
在下文中一共展示了templates.split方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_ns3_relative_path
# 需要導入模塊: from pygccxml.declarations import templates [as 別名]
# 或者: from pygccxml.declarations.templates import split [as 別名]
def get_ns3_relative_path(path):
l = []
head = path
while head:
head, tail = os.path.split(head)
if tail == 'ns3':
return os.path.join(*l)
l.insert(0, tail)
raise AssertionError("is the path %r inside ns3?!" % path)
示例2: scan_callback_classes
# 需要導入模塊: from pygccxml.declarations import templates [as 別名]
# 或者: from pygccxml.declarations.templates import split [as 別名]
def scan_callback_classes(module_parser, callback_classes_file):
callback_classes_file.write("callback_classes = [\n")
for cls in module_parser.module_namespace.classes(function=module_parser.location_filter,
recursive=False):
if not cls.name.startswith("Callback<"):
continue
assert templates.is_instantiation(cls.decl_string), "%s is not a template instantiation" % cls
dummy_cls_name, template_parameters = templates.split(cls.decl_string)
callback_classes_file.write(" %r,\n" % template_parameters)
callback_classes_file.write("]\n")
示例3: get_ns3_relative_path
# 需要導入模塊: from pygccxml.declarations import templates [as 別名]
# 或者: from pygccxml.declarations.templates import split [as 別名]
def get_ns3_relative_path(path):
l = []
head = path
while head:
new_head, tail = os.path.split(head)
if new_head == head:
raise ValueError
head = new_head
if tail == 'ns3':
return os.path.join(*l)
l.insert(0, tail)
raise AssertionError("is the path %r inside ns3?!" % path)
示例4: _get_annotation_exceptions
# 需要導入模塊: from pygccxml.declarations import templates [as 別名]
# 或者: from pygccxml.declarations.templates import split [as 別名]
def _get_annotation_exceptions(self, annotation):
retval = []
for exc_name in annotation.split(','):
traits = ctypeparser.TypeTraits(normalize_name(exc_name))
if traits.type_is_reference:
name = str(traits.target)
else:
name = str(traits.ctype)
exc = self.type_registry.root_module.get(name, None)
if isinstance(exc, CppException):
retval.append(exc)
else:
raise ValueError("Thrown exception '%s' is not a CppException object: %r"
% (normalize_name(name), exc))
return retval
示例5: get_ns3_relative_path
# 需要導入模塊: from pygccxml.declarations import templates [as 別名]
# 或者: from pygccxml.declarations.templates import split [as 別名]
def get_ns3_relative_path(path):
l = []
head = path
if not path:
return
while head:
new_head, tail = os.path.split(head)
if new_head == head:
raise ValueError
head = new_head
if tail == 'ns3':
return os.path.join(*l)
l.insert(0, tail)
raise AssertionError("is the path %r inside ns3?!" % path)