From a7c3c201da2eee54c0950c4aa0d347e4af608ade Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Mon, 16 Apr 2012 11:47:54 +0200 Subject: build.py: supporto per diverse directory --- build.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'build.py') diff --git a/build.py b/build.py index 5c6ffd6..6fed879 100644 --- a/build.py +++ b/build.py @@ -69,20 +69,22 @@ def build_odt(srcdir,destdir): def main(): parser = argparse.ArgumentParser(description='building script') + parser.add_argument('directory',nargs='+',choices=['esempi','strumenti']) parser.add_argument('-H','--html',action='store_true') parser.add_argument('-l','--latex',action='store_true') parser.add_argument('-p','--pdf',action='store_true') parser.add_argument('-o','--odt',action='store_true') args = parser.parse_args() - if args.html: - build_html('esempi',os.path.join('build','html','esempi')) - if args.latex or args.pdf: - build_latex('esempi',os.path.join('build','latex','esempi')) - if args.pdf: - build_pdf(os.path.join('build','latex','esempi'), - os.path.join('build','pdf','esempi')) - if args.odt: - build_odt('esempi',os.path.join('build','odt','esempi')) + for dirname in args.directory: + if args.html: + build_html(dirname,os.path.join('build','html',dirname)) + if args.latex or args.pdf: + build_latex(dirname,os.path.join('build','latex',dirname)) + if args.pdf: + build_pdf(os.path.join('build','latex',dirname), + os.path.join('build','pdf',dirname)) + if args.odt: + build_odt(dirname,os.path.join('build','odt',dirname)) if __name__ == '__main__': main() -- cgit v1.2.3