#NEWLINE# def add_option( self , name , type , default = None ) : #NEWLINE# #INDENT# "Adds an option to the spec\n\n        Keyword arguments:\n          name -- The name of the option to add to the spec.\n          type -- An object representing the option's type.\n          default -- Optionally, what the option should default to.\n\n        Raises:\n          ValueError -- If the option is not a string or type isn't a class.\n\n        " #NEWLINE# if ( not isinstance ( name , basestring ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Name must be a string' ) #NEWLINE# #UNINDENT# if ( not inspect . isclass ( type ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Type must be a class' ) #NEWLINE# #UNINDENT# name = name . encode ( 'utf-8' ) #NEWLINE# self . options [ self ] = ( type , default )