Includes library modifications to allow access to AIN_4 (AIN_0 / 5)

Committer:
bryantaylor
Date:
Tue Sep 20 21:26:12 2016 +0000
Revision:
0:eafc3fd41f75
hackathon

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bryantaylor 0:eafc3fd41f75 1 """
bryantaylor 0:eafc3fd41f75 2 This module defines the attributes of the
bryantaylor 0:eafc3fd41f75 3 PyPI package for the Mbed SDK
bryantaylor 0:eafc3fd41f75 4 """
bryantaylor 0:eafc3fd41f75 5
bryantaylor 0:eafc3fd41f75 6 from shutil import copyfileobj
bryantaylor 0:eafc3fd41f75 7 from os.path import isfile, join
bryantaylor 0:eafc3fd41f75 8 from tempfile import TemporaryFile
bryantaylor 0:eafc3fd41f75 9 from setuptools import find_packages
bryantaylor 0:eafc3fd41f75 10 from distutils.core import setup
bryantaylor 0:eafc3fd41f75 11
bryantaylor 0:eafc3fd41f75 12 LICENSE = open('LICENSE').read()
bryantaylor 0:eafc3fd41f75 13 DESCRIPTION = """A set of Python scripts that can be used to compile programs written on top of the `mbed framework`_. It can also be used to export mbed projects to other build systems and IDEs (uVision, IAR, makefiles).
bryantaylor 0:eafc3fd41f75 14
bryantaylor 0:eafc3fd41f75 15 .. _mbed framework: http://mbed.org"""
bryantaylor 0:eafc3fd41f75 16 OWNER_NAMES = 'emilmont, bogdanm'
bryantaylor 0:eafc3fd41f75 17 OWNER_EMAILS = 'Emilio.Monti@arm.com, Bogdan.Marinescu@arm.com'
bryantaylor 0:eafc3fd41f75 18
bryantaylor 0:eafc3fd41f75 19 # If mbed_settings.py exists in tools, read it in a temporary file
bryantaylor 0:eafc3fd41f75 20 # so it can be restored later
bryantaylor 0:eafc3fd41f75 21 mbed_settings = join('mbed_settings.py')
bryantaylor 0:eafc3fd41f75 22 backup = None
bryantaylor 0:eafc3fd41f75 23 if isfile(mbed_settings):
bryantaylor 0:eafc3fd41f75 24 backup = TemporaryFile()
bryantaylor 0:eafc3fd41f75 25 with open(mbed_settings, "rb") as f:
bryantaylor 0:eafc3fd41f75 26 copyfileobj(f, backup)
bryantaylor 0:eafc3fd41f75 27
bryantaylor 0:eafc3fd41f75 28 # Create the correct mbed_settings.py for the distribution
bryantaylor 0:eafc3fd41f75 29 with open(mbed_settings, "wt") as f:
bryantaylor 0:eafc3fd41f75 30 f.write("from mbed_settings import *\n")
bryantaylor 0:eafc3fd41f75 31
bryantaylor 0:eafc3fd41f75 32 setup(name='mbed-tools',
bryantaylor 0:eafc3fd41f75 33 version='0.1.14',
bryantaylor 0:eafc3fd41f75 34 description='Build and test system for mbed',
bryantaylor 0:eafc3fd41f75 35 long_description=DESCRIPTION,
bryantaylor 0:eafc3fd41f75 36 author=OWNER_NAMES,
bryantaylor 0:eafc3fd41f75 37 author_email=OWNER_EMAILS,
bryantaylor 0:eafc3fd41f75 38 maintainer=OWNER_NAMES,
bryantaylor 0:eafc3fd41f75 39 maintainer_email=OWNER_EMAILS,
bryantaylor 0:eafc3fd41f75 40 url='https://github.com/mbedmicro/mbed',
bryantaylor 0:eafc3fd41f75 41 packages=find_packages(),
bryantaylor 0:eafc3fd41f75 42 license=LICENSE,
bryantaylor 0:eafc3fd41f75 43 install_requires=["PrettyTable>=0.7.2", "PySerial>=2.7", "IntelHex>=1.3", "colorama>=0.3.3", "Jinja2>=2.7.3", "project-generator>=0.9.3,<0.10.0", "project-generator-definitions>=0.2.26,<0.3.0", "junit-xml", "requests", "pyYAML"])
bryantaylor 0:eafc3fd41f75 44
bryantaylor 0:eafc3fd41f75 45 # Restore previous mbed_settings if needed
bryantaylor 0:eafc3fd41f75 46 if backup:
bryantaylor 0:eafc3fd41f75 47 backup.seek(0)
bryantaylor 0:eafc3fd41f75 48 with open(mbed_settings, "wb") as f:
bryantaylor 0:eafc3fd41f75 49 copyfileobj(backup, f)