本文整理汇总了Python中dxtbx.format.Registry.Registry.add方法的典型用法代码示例。如果您正苦于以下问题:Python Registry.add方法的具体用法?Python Registry.add怎么用?Python Registry.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dxtbx.format.Registry.Registry
的用法示例。
在下文中一共展示了Registry.add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from dxtbx.format.Registry import Registry [as 别名]
# 或者: from dxtbx.format.Registry.Registry import add [as 别名]
def __init__(self, name, bases, attributes):
super(_MetaFormat, self).__init__(name, bases, attributes)
# Do-nothing until the Format module, defining the base class,
# has been loaded.
try:
sys.modules[Format.__module__]
except NameError:
return
# Add the class to the registry if it is directly derived from
# Format.
self._children = []
if Format in bases:
from dxtbx.format.Registry import Registry
Registry.add(self)
return
# Add the class to the list of children of its superclasses.
for base in bases:
base._children.append(self)
return