#NEWLINE# def create_from_parser( parser , source_path , **kwargs ) : #NEWLINE# #INDENT# auto_start = kwargs . get ( 'auto_start' , False ) #NEWLINE# if hasattr ( sys , 'frozen' ) : #NEWLINE# #INDENT# run_cmd = quote ( source_path ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# run_cmd = '{} -u {}' . format ( quote ( sys . executable ) , quote ( source_path ) ) #NEWLINE# #UNINDENT# build_spec = { #NEWLINE# #INDENT# 'language' : kwargs . get ( 'language' , 'english' ) , #NEWLINE# 'target' : run_cmd , #NEWLINE# 'program_name' : ( kwargs . get ( 'program_name' ) or os . path . basename ( sys . argv [ 0 ] ) . replace ( '.py' , '' ) ) , #NEWLINE# 'program_description' : kwargs . get ( 'program_description' , '' ) , #NEWLINE# 'auto_start' : kwargs . get ( 'auto_start' , False ) , #NEWLINE# 'show_advanced' : kwargs . get ( 'advanced' , True ) , #NEWLINE# 'default_size' : kwargs . get ( 'default_size' , ( 610 , 530 ) ) , #NEWLINE# 'num_required_cols' : kwargs . get ( 'required_cols' , 1 ) , #NEWLINE# 'num_optional_cols' : kwargs . get ( 'optional_cols' , 3 ) , #NEWLINE# 'manual_start' : False , #NEWLINE# 'layout_type' : 'flat' , #NEWLINE# 'monospace_display' : kwargs . get ( 'monospace_display' , False ) , #NEWLINE# 'image_dir' : kwargs . get ( 'image_dir' ) , #NEWLINE# 'language_dir' : kwargs . get ( 'language_dir' ) , #NEWLINE# 'progress_regex' : kwargs . get ( 'progress_regex' ) , #NEWLINE# 'progress_expr' : kwargs . get ( 'progress_expr' ) , #NEWLINE# 'disable_progress_bar_animation' : kwargs . get ( 'disable_progress_bar_animation' ) , #NEWLINE# 'disable_stop_button' : kwargs . get ( 'disable_stop_button' ) , #NEWLINE# 'group_by_type' : kwargs . get ( 'group_by_type' , True ) , #NEWLINE# #UNINDENT# } #NEWLINE# if ( not auto_start ) : #NEWLINE# #INDENT# build_spec [ 'program_description' ] = ( parser . description or build_spec [ 'program_description' ] ) #NEWLINE# layout_data = ( argparse_to_json . convert ( parser ) if build_spec [ 'show_advanced' ] else layouts . basic_config . items ( ) ) #NEWLINE# build_spec . update ( layout_data ) #NEWLINE# #UNINDENT# return build_spec