(self, generator_class, is_default=False)
Adds a new format->generator mapping to the collection

        args:
            generator_class: child class of .repeater_generators.BasePayloadGenerator

        kwargs:
            is_default: True if the format_name should be default format

        exceptions:
            raises DuplicateFormatException if format is added with is_default while other
            default exists
            raises DuplicateFormatException if format_name alread exists in the collection
Adds a new format->generator mapping to the collection
Adds a new format - > generator mapping to the collection
def add_new_format(self, generator_class, is_default=False):
        """Adds a new format->generator mapping to the collection

        args:
            generator_class: child class of .repeater_generators.BasePayloadGenerator

        kwargs:
            is_default: True if the format_name should be default format

        exceptions:
            raises DuplicateFormatException if format is added with is_default while other
            default exists
            raises DuplicateFormatException if format_name alread exists in the collection
        """

        if is_default and self.default_format:
            raise DuplicateFormatException("A default format already exists for this repeater.")
        elif is_default:
            self.default_format = generator_class.format_name
        if generator_class.format_name in self.format_generator_map:
            raise DuplicateFormatException("There is already a Generator with this format name.")

        self.format_generator_map[generator_class.format_name] = FormatInfo(
            name=generator_class.format_name,
            label=generator_class.format_label,
            generator_class=generator_class
        )
def add_new_format ( self , generator_class , is_default = False ) : if is_default and self . default_format : raise DuplicateFormatException ( "A default format already exists for this repeater." ) elif is_default : self . default_format = generator_class . format_name if generator_class . format_name in self . format_generator_map : raise DuplicateFormatException ( "There is already a Generator with this format name." ) self . format_generator_map [ generator_class . format_name ] = FormatInfo ( name = generator_class . format_name , label = generator_class . format_label , generator_class = generator_class )