#NEWLINE# def main( ) : #NEWLINE# #INDENT# parser = optparse . OptionParser ( 'usage: %prog [options] /path/to/existing/venv /path/to/cloned/venv' ) #NEWLINE# parser . add_option ( '-v' , action = 'count' , dest = 'verbose' , default = False , help = 'verbosity' ) #NEWLINE# ( options , args ) = parser . parse_args ( ) #NEWLINE# try : #NEWLINE# #INDENT# ( old_dir , new_dir ) = args #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# print ( 'virtualenv-clone {}' . format ( __version__ ) ) #NEWLINE# parser . error ( 'not enough arguments given.' ) #NEWLINE# #UNINDENT# old_dir = os . path . normpath ( os . path . abspath ( old_dir ) ) #NEWLINE# new_dir = os . path . normpath ( os . path . abspath ( new_dir ) ) #NEWLINE# loglevel = ( logging . WARNING , logging . INFO , logging . DEBUG ) [ min ( 2 , options . verbose ) ] #NEWLINE# logging . basicConfig ( level = loglevel , format = '%(message)s' ) #NEWLINE# try : #NEWLINE# #INDENT# clone_virtualenv ( args , new_dir ) #NEWLINE# #UNINDENT# except UserError : #NEWLINE# #INDENT# e = sys . exc_info ( ) [ 1 ] #NEWLINE# parser . error ( str ( e ) )