def file_validator(optdict, name, value): """validate and return a filepath for option of type 'file'""" return optparse.check_file(None, name, value)