Beispiel #1
0
 def __new__(mcs, name, bases, attrs):
     cls = StructType.__new__(mcs, name, bases, attrs)
     if 'tagid' in attrs:
         tagid = attrs['tagid']
         assert tagid not in tag_models
         tag_models[tagid] = cls
     return cls
Beispiel #2
0
 def __new__(mcs, name, bases, attrs):
     cls = StructType.__new__(mcs, name, bases, attrs)
     if 'tagid' in attrs:
         tagid = attrs['tagid']
         assert tagid not in tag_models
         tag_models[tagid] = cls
     return cls
Beispiel #3
0
def LanguageStruct(name, basetype):
    ''' 표 29 글꼴에 대한 언어 '''
    def attributes():
        for lang in ('ko', 'en', 'cn', 'jp', 'other', 'symbol', 'user'):
            yield basetype, lang
    attributes = staticmethod(attributes)
    return StructType(name, (Struct,), dict(basetype=basetype,
                                            attributes=attributes))