Created
February 4, 2013 09:34
-
-
Save reterVision/4705844 to your computer and use it in GitHub Desktop.
A Python Script doing auto symbolic link for you.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import subprocess | |
import argparse | |
parser = argparse.ArgumentParser(description='Do the symbolic for you.') | |
parser.add_argument('--source', dest='folder', | |
help='Your code directory') | |
parser.add_argument('--virtual', dest='vfolder', | |
help='Your code directory') | |
folder, vfolder = (None, None) | |
args = parser.parse_args() | |
globals().update(vars(args)) | |
print "Your source code is in", folder | |
print "And your virtualenv lib directory is in", vfolder | |
ok = raw_input("Do you want to continue(Y/N)?") | |
if ok != 'Y': | |
exit(0) | |
print "Start make symbolic links...." | |
LIBS = ["Your Libraries Here"] | |
for lib in LIBS: | |
command = "ln -sfn {0}{1} {2}".format(folder, | |
lib, | |
vfolder) | |
print command | |
subprocess.call(command, shell=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment