def opt_factory(name, default_value, desc, _type, help='', tabid=''):
 option_klasses = {BOOL: BoolOption, INT: IntegerOption, POSITIVE_INT: PositiveIntegerOption, FLOAT: FloatOption, STRING: StringOption, URL: URLOption, URL_LIST: URLListOption, IPPORT: IPPortOption, LIST: ListOption, REGEX: RegexOption, COMBO: ComboOption, INPUT_FILE: InputFileOption, OUTPUT_FILE: OutputFileOption, PORT: PortOption, IP: IPOption}
 return option_klasses[_type](name, default_value, desc, _help=help, tabid=tabid)

def opt_factory ( name , default_value , desc , _type , help = '' , tabid = '' ) : option_klasses = { BOOL : BoolOption , INT : IntegerOption , POSITIVE_INT : PositiveIntegerOption , FLOAT : FloatOption , STRING : StringOption , URL : URLOption , URL_LIST : URLListOption , IPPORT : IPPortOption , LIST : ListOption , REGEX : RegexOption , COMBO : ComboOption , INPUT_FILE : InputFileOption , OUTPUT_FILE : OutputFileOption , PORT : PortOption , IP : IPOption } return option_klasses [ _type ] ( name , default_value , desc , _help = help , tabid = tabid )
a factory function which will generate one of the option objects based on the _type passed as parameter .