aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <elena.valhalla@gmail.com>2012-04-16 11:47:54 +0200
committerElena ``of Valhalla'' Grandi <elena.valhalla@gmail.com>2012-04-16 11:47:54 +0200
commita7c3c201da2eee54c0950c4aa0d347e4af608ade (patch)
treef1a1c2fb78a6febbe3feeebad10b1df00c45e2db
parent5fb85e5dd77c245bbd1169f006f58c9811e8cf76 (diff)
build.py: supporto per diverse directory
-rw-r--r--build.py20
1 files changed, 11 insertions, 9 deletions
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()