(self, names, info_dict)
return [name
                for name in names
                if is_required(name)]
Check each element name in the supplied dictionary and remove it if not
        required by the generator.

        This will allow some operations to take place before endFile no matter the order of generation.
Check each element name in the supplied dictionary and remove it if not
        required by the generator.
Check each element name in the supplied dictionary and remove it if not required by the generator .
def keepOnlyRequired(self, names, info_dict):
        """Check each element name in the supplied dictionary and remove it if not
        required by the generator.

        This will allow some operations to take place before endFile no matter the order of generation."""
        # TODO Unpleasantly breaks encapsulation. Should be a method in the registry class

        def is_required(name):
            info = self.registry.lookupElementInfo(name, info_dict)
            if info is None:
                return False
            if not info.required:
                self.logMsg('diag', 'keepOnlyRequired: element',
                            name, 'IS NOT required, skipping')
            return info.required

        return [name
                for name in names
                if is_required(name)]
def keepOnlyRequired ( self , names , info_dict ) : # TODO Unpleasantly breaks encapsulation. Should be a method in the registry class def is_required ( name ) : info = self . registry . lookupElementInfo ( name , info_dict ) if info is None : return False if not info . required : self . logMsg ( 'diag' , 'keepOnlyRequired: element' , name , 'IS NOT required, skipping' ) return info . required return [ name for name in names if is_required ( name ) ]