LP-295: uncrustify
[librepilot.git] / flight / libraries / PyMite / tools / pmGenPmFeatures.py
blob6fc20a0abf672417c3ba48e6378ba53b24221f21
1 #!/usr/bin/env python
3 # This file is Copyright 2010 Dean Hall.
5 # This file is part of the Python-on-a-Chip program.
6 # Python-on-a-Chip is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
9 # Python-on-a-Chip is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 # A copy of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
13 # is seen in the file COPYING up one directory from this.
15 """
16 Generates C definitions on stdout for all features in the input set to True
18 Expects name of a pmfeatures.py file as the only argument.
19 """
22 import sys, time
25 execfile(sys.argv[1])
26 sys.stdout.write("/* Automatically generated by %s on %s. DO NOT EDIT. */\n"
27 % (sys.argv[0], time.ctime(time.time())))
28 map(sys.stdout.write,
29 ("#define %s\n" % s for s in PM_FEATURES.keys() if PM_FEATURES[s]))