def doc_path(options, allow_default=True):
 doc_type = getattr(options, 'type', 'default')
 path = DOC_PATHS.get(doc_type)
 if ((doc_type == 'default') and (not allow_default)):
  print("You must specify a documentation type using '--type'.  Valid options are: {options}".format(options=valid_doc_types()))
  sys.exit(1)
 if (path is None):
  print("Invalid documentation type '{doc_type}'.  Valid options are: {options}".format(doc_type=doc_type, options=valid_doc_types()))
  sys.exit(1)
 else:
  return path

def doc_path ( options , allow_default = True ) : doc_type = getattr ( options , 'type' , 'default' ) path = DOC_PATHS . get ( doc_type ) if ( ( doc_type == 'default' ) and ( not allow_default ) ) : print ( "You must specify a documentation type using '--type'.  Valid options are: {options}" . format ( options = valid_doc_types ( ) ) ) sys . exit ( 1 ) if ( path is None ) : print ( "Invalid documentation type '{doc_type}'.  Valid options are: {options}" . format ( doc_type = doc_type , options = valid_doc_types ( ) ) ) sys . exit ( 1 ) else : return path
parse options to determine the path to the documentation directory .