Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-os
Diff: neo.py
- Revision:
- 10:dc8f1363b424
- Parent:
- 9:6066c45a1655
- Child:
- 11:ab6a9a482a1d
diff -r 6066c45a1655 -r dc8f1363b424 neo.py --- a/neo.py Wed Mar 30 00:46:39 2016 -0500 +++ b/neo.py Wed Mar 30 01:00:44 2016 -0500 @@ -8,6 +8,7 @@ import contextlib import collections import shutil +from itertools import * # Subparser handling parser = argparse.ArgumentParser() @@ -225,11 +226,17 @@ if not os.path.isfile('mbed_settings.py'): shutil.copy('mbed-os/tools/settings.py', 'mbed_settings.py') + if os.path.isfile('MACROS.txt'): + with open('MACROS.txt') as f: + macros = f.read().splitlines() + env = os.environ.copy() env['PYTHONPATH'] = '.' - popen(['python', 'mbed-os/tools/make.py', - '--source=%s' % cwd.path, - '--build=%s' % os.path.join(cwd.path, '.build')] + args, + popen(['python', 'mbed-os/tools/make.py'] + + list(chain.from_iterable(izip(repeat('-D'), macros))) + + ['--source=%s' % cwd.path, + '--build=%s' % os.path.join(cwd.path, '.build')] + + args, env=env) # Parse/run command