#NEWLINE# @ generate . command ( add_help_option = False ) #NEWLINE# @ click . help_option ( '-h' , '--help' ) #NEWLINE# @ mode_option #NEWLINE# @ click . argument ( 'name' , type = MODULE_NAME ) #NEWLINE# @ click . pass_context #NEWLINE# def library( ctx , name , mode ) : #NEWLINE# #INDENT# 'Generate an application-agnostic library.' #NEWLINE# name_camelcase = camelcase ( name ) #NEWLINE# if ( not valid_project_directory ( ) ) : #NEWLINE# #INDENT# ctx . fail ( 'You can only run the generate command from a valid project directory' ) #NEWLINE# #UNINDENT# click . echo ( ) #NEWLINE# click . echo ( ( 'Generating new library named %s:' % name ) ) #NEWLINE# click . echo ( ) #NEWLINE# scaffold = Scaffold ( source_root = os . path . join ( TEMPLATE_DIR , 'lib' ) , target_root = os . getcwd ( ) , variables = { #NEWLINE# #INDENT# 'name' : ctx , #NEWLINE# 'name_camelcase' : name_camelcase , #NEWLINE# #UNINDENT# } , ignored_dirs = IGNORED_DIRS , ignored_files = IGNORED_FILES , overwrite_target_root = True , existing_policy = mode ) #NEWLINE# scaffold . render_structure ( ) #NEWLINE# click . echo ( )