#NEWLINE# @ cli . command ( 'project-info' , short_help = 'Shows the info about a project.' ) #NEWLINE# @ click . option ( 'as_json' , '--json' , is_flag = True , help = 'Prints out the data as json.' ) #NEWLINE# @ click . option ( 'ops' , '--name' , is_flag = True , multiple = True , flag_value = 'name' , help = 'Print the project name' ) #NEWLINE# @ click . option ( 'ops' , '--project-file' , is_flag = True , multiple = True , flag_value = 'project_file' , help = 'Print the path to the project file.' ) #NEWLINE# @ click . option ( 'ops' , '--tree' , is_flag = True , multiple = True , flag_value = 'tree' , help = 'Print the path to the tree.' ) #NEWLINE# @ click . option ( 'ops' , '--output-path' , is_flag = True , multiple = True , flag_value = 'default_output_path' , help = 'Print the path to the default output path.' ) #NEWLINE# @ pass_context #NEWLINE# def project_info_cmd( ctx , as_json , ops ) : #NEWLINE# #INDENT# 'Prints out information about the project.  This is particular\n    useful for script usage or for discovering information about a\n    Lektor project that is not immediately obvious (like the paths\n    to the default output folder).\n    ' #NEWLINE# project = ctx . get_project ( ) #NEWLINE# if as_json : #NEWLINE# #INDENT# echo_json ( project . to_json ( ) ) #NEWLINE# return #NEWLINE# #UNINDENT# if ops : #NEWLINE# #INDENT# data = project . to_json ( ) #NEWLINE# for op in ops : #NEWLINE# #INDENT# click . echo ( data . get ( op , '' ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# click . echo ( ( 'Name: %s' % project . name ) ) #NEWLINE# click . echo ( ( 'File: %s' % project . project_file ) ) #NEWLINE# click . echo ( ( 'Tree: %s' % project . tree ) ) #NEWLINE# click . echo ( ( 'Output: %s' % project . get_output_path ( ) ) )