(self, name, value_list, default = None)
return val
Return arg value or default; also check if value allowed.
Return arg value or default; also check if value allowed.
Return arg value or default ; also check if value allowed .
def get_arg (self, name, value_list, default = None):
        """ Return arg value or default; also check if value allowed. """
        default = default or value_list[0]
        val = type(default)(self.args.get(name, default))
        if val not in value_list:
            raise Exception('Bad argument %s value %r' % (name, val))
        return val
def get_arg ( self , name , value_list , default = None ) : default = default or value_list [ 0 ] val = type ( default ) ( self . args . get ( name , default ) ) if val not in value_list : raise Exception ( 'Bad argument %s value %r' % ( name , val ) ) return val