1 #!/usr/bin/env python 2 3 from glob import glob 4 import MoinMoin.script 5 import os, shutil, sys 6 7 target_dir = os.path.split(MoinMoin.script.__file__)[0] 8 9 test = "--test" in sys.argv or "-n" in sys.argv 10 11 for script in glob(os.path.join("scripts", "*", "*.py")): 12 subdir = os.path.split(os.path.split(script)[0])[-1] 13 destination = os.path.join(target_dir, subdir) 14 print "Copying", script, "to", destination, "...", 15 if not test: 16 shutil.copy(script, destination) 17 print "done." 18 else: 19 print "not done (test only)." 20 21 # vim: tabstop=4 expandtab shiftwidth=4