#NEWLINE# def create_package_xml( path , version = '0.1.0' ) : #NEWLINE# #INDENT# path = os . path . abspath ( path ) #NEWLINE# os . makedirs ( path ) #NEWLINE# template = '<?xml version="1.0"?>\n<package>\n  <name>{0}</name>\n  <version>{1}</version>\n  <description>Package {0}</description>\n  <license>BSD</license>\n\n  <maintainer email="foo@bar.com">Foo Bar</maintainer>\n</package>\n' . format ( path . split ( '/' ) [ ( - 1 ) ] , version ) #NEWLINE# with open ( os . path . join ( path , 'package.xml' ) , 'w+' ) as f : #NEWLINE# #INDENT# f . write ( template )