#NEWLINE# def create_mirror( self , mirror_dir ) : #NEWLINE# #INDENT# "Create mirror of this package and it's dependencies.\n\n    Args:\n      mirror_dir: Directory where mirror will be stored.\n\n    Raises:\n      OSError: If this method fails to create mirror.\n    " #NEWLINE# ignore_git = shutil . ignore_patterns ( '.git' ) #NEWLINE# logging . debug ( 'Copying %s to %s' , self . path , mirror_dir ) #NEWLINE# shutil . copytree ( self . path , mirror_dir , ignore = ignore_git ) #NEWLINE# dependencies_dir = os . path . join ( mirror_dir , 'dependencies' ) #NEWLINE# logging . debug ( ( 'Creating ' + dependencies_dir ) ) #NEWLINE# os . mkdir ( dependencies_dir ) #NEWLINE# for dependency in mirror_dir . dependencies : #NEWLINE# #INDENT# mirrored_dependency = os . path . join ( dependencies_dir , dependency . name ) #NEWLINE# logging . debug ( 'Copying %s to %s ' , dependency . path , mirrored_dependency ) #NEWLINE# shutil . copytree ( dependency . path , mirrored_dependency , ignore = ignore_git )