A small script to demonstrate the usage of the mbed build service.
Example for using the mbed compile API
Prerequisites
- An account at developer.mbed.org (you will be asked for your password in order to compile) Get an account
- Python
- Python requests
On MacOS X you can install python requests as follows
install python requests on OS X
sudo easy_install requests
Usage
usage example for mbed API
python mbedapi.py --repo http://developer.mbed.org/users/dan/code/pubtest/ --user JonnyA --api http://developer.mbed.org --platform mbed-LPC1768 --destdir /tmp/ --debug 2
Diff: mbedapi.py
- Revision:
- 3:b71ebe79e1a5
- Parent:
- 2:09e9170d8a4e
--- a/mbedapi.py Mon Mar 02 15:25:34 2015 +0000 +++ b/mbedapi.py Fri Jul 03 15:58:46 2015 +0100 @@ -76,7 +76,11 @@ #now download if success: logging.info("Downloading your binary") - params = {'repomode': True, 'program': response['result']['data']['program'], 'binary': response['result']['data']['binary'] } + params = { + 'repomode': True, + 'program': response['result']['data']['program'], + 'binary': response['result']['data']['binary'], + 'task_id': uuid } r = requests.get(args.api + "/api/v2/tasks/compiler/bin/", params=params, auth=auth) destination = os.path.join(args.destdir, response['result']['data']['binary'])