xtuml/meta.py
def define_class(self, kind, attributes, doc=''):
        '''
        Define a new class in the metamodel, and return its metaclass.
        '''
        ukind = kind.upper()
        if ukind in self.metaclasses:
            raise MetaModelException('A class with the name %s is already defined' % kind)

        metaclass = MetaClass(kind, self)
        for name, ty in attributes:
            metaclass.append_attribute(name, ty)
            
        self.metaclasses[ukind] = metaclass
        
        return metaclass
def define_class(self, kind, attributes, doc=''):
        '''
        Define a new class in the metamodel, and return its metaclass.
        '''
        ukind = kind.upper()
        if ukind in self.metaclasses:
            raise MetaModelException('A class with the name %s is already defined' % kind)

        metaclass = MetaClass(kind, self)
        for name, ty in attributes:
            metaclass.append_attribute(name, ty)
            
        self.metaclasses[ukind] = metaclass
        
        return metaclass
def define_class ( self , kind , attributes , doc = '' ) : ukind = kind . upper ( ) if ukind in self . metaclasses : raise MetaModelException ( 'A class with the name %s is already defined' % kind ) metaclass = MetaClass ( kind , self ) for name , ty in attributes : metaclass . append_attribute ( name , ty ) self . metaclasses [ ukind ] = metaclass return metaclass
Define a new class in the metamodel, and return its metaclass.
Define a new class in the metamodel and return its metaclass .