Source code for fussy.linktree

"""Link all files in a distribution from relative location on the hard disk"""
import os, logging
from optparse import OptionParser

log = logging.getLogger( __name__ )


[docs]def get_options(): """Creates the OptionParser used in :func:`main` """ parser = OptionParser() parser.add_option( '-d','--directory', dest = 'directory', default = None, help="Directory to which to link", ) parser.add_option( '-t','--target', dest = 'target', default = None, help="Directory in which to create the links", ) return parser
def main(): logging.basicConfig( level=logging.INFO ) options,args = get_options().parse_args() if args: if not options.directory: options.directory = args[0] args = args[1:] if args and not options.target: options.target = args[0] args = args[1:] link_tree( options.directory, options.target ) return 0

Project Versions