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