annotate python/apps/build.py @ 68:654c5ac4f2c5

Refactor of menus
author windel
date Sat, 13 Oct 2012 16:13:05 +0200
parents 361f7d13adea
children
rev   line source
68
654c5ac4f2c5 Refactor of menus
windel
parents: 65
diff changeset
1 import sys, os, argparse
64
4a27c28c7d0f File movage
windel
parents: 63
diff changeset
2 sys.path.insert(0, os.path.join('..','libs'))
65
361f7d13adea Fixes after movage
windel
parents: 64
diff changeset
3
15
de004f808e56 Fixup in multidocument area stuff
windel
parents:
diff changeset
4 # Compiler imports:
65
361f7d13adea Fixes after movage
windel
parents: 64
diff changeset
5 from compiler import Compiler
15
de004f808e56 Fixup in multidocument area stuff
windel
parents:
diff changeset
6 from project import Project
de004f808e56 Fixup in multidocument area stuff
windel
parents:
diff changeset
7
de004f808e56 Fixup in multidocument area stuff
windel
parents:
diff changeset
8 if __name__ == '__main__':
68
654c5ac4f2c5 Refactor of menus
windel
parents: 65
diff changeset
9 parser = argparse.ArgumentParser(description='Build tool to build projects')
654c5ac4f2c5 Refactor of menus
windel
parents: 65
diff changeset
10 parser.add_argument('project', type=str, help='the project to be build')
654c5ac4f2c5 Refactor of menus
windel
parents: 65
diff changeset
11 args = parser.parse_args()
654c5ac4f2c5 Refactor of menus
windel
parents: 65
diff changeset
12
654c5ac4f2c5 Refactor of menus
windel
parents: 65
diff changeset
13 try:
654c5ac4f2c5 Refactor of menus
windel
parents: 65
diff changeset
14 project = Project(args.project)
654c5ac4f2c5 Refactor of menus
windel
parents: 65
diff changeset
15 except IOError:
654c5ac4f2c5 Refactor of menus
windel
parents: 65
diff changeset
16 print('Failed to load {0}'.format(args.project))
654c5ac4f2c5 Refactor of menus
windel
parents: 65
diff changeset
17 sys.exit(3)
15
de004f808e56 Fixup in multidocument area stuff
windel
parents:
diff changeset
18 pc = Compiler()
de004f808e56 Fixup in multidocument area stuff
windel
parents:
diff changeset
19 pc.compileProject(project)
de004f808e56 Fixup in multidocument area stuff
windel
parents:
diff changeset
20