#NEWLINE# def create_package_files( target_path , package_template , rosdistro , newfiles = None , meta = False ) : #NEWLINE# #INDENT# '\n    creates several files from templates to start a new package.\n\n    :param target_path: parent folder where to create the package\n    :param package_template: contains the required information\n    :param rosdistro: name of the distro to look up respective template\n    :param newfiles: dict {filepath: contents} for additional files to write\n    ' #NEWLINE# if ( newfiles is None ) : #NEWLINE# #INDENT# newfiles = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# manifest_path = os . path . join ( target_path , PACKAGE_MANIFEST_FILENAME ) #NEWLINE# if ( manifest_path not in newfiles ) : #NEWLINE# #INDENT# newfiles [ manifest_path ] = create_package_xml ( package_template , rosdistro , meta = meta ) #NEWLINE# #UNINDENT# cmake_path = os . path . join ( target_path , 'CMakeLists.txt' ) #NEWLINE# if ( not ( cmake_path in newfiles ) ) : #NEWLINE# #INDENT# newfiles [ cmake_path ] = create_cmakelists ( package_template , rosdistro , meta = meta ) #NEWLINE# #UNINDENT# _safe_write_files ( newfiles , target_path ) #NEWLINE# if ( 'roscpp' in package_template . catkin_deps ) : #NEWLINE# #INDENT# fname = os . path . join ( target_path , 'include' , package_template . name ) #NEWLINE# os . makedirs ( fname ) #NEWLINE# print ( ( 'Created folder %s' % os . path . relpath ( fname , os . path . dirname ( target_path ) ) ) ) #NEWLINE# #UNINDENT# if ( ( 'roscpp' in package_template . catkin_deps ) or ( 'rospy' in package_template . catkin_deps ) ) : #NEWLINE# #INDENT# fname = os . path . join ( target_path , 'src' ) #NEWLINE# os . makedirs ( fname ) #NEWLINE# print ( ( 'Created folder %s' % os . path . relpath ( fname , os . path . dirname ( target_path ) ) ) )