def trait_metadata(self, traitname, key):
try:<EOL><INDENT>trait = getattr(self.__class__, traitname)<EOL><DEDENT>except AttributeError:<EOL><INDENT>raise TraitError("<STR_LIT>" %<EOL>(self.__class__.__name__, traitname))<EOL><DEDENT>else:<EOL><INDENT>return trait.get_metadata(key)<EOL><DEDENT>
Get metadata values for trait by key.