diff --git a/.travis.yml b/.travis.yml index 99ed7bb..533e122 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ language: python python: - "2.7" - - "3.5" + - "3.6" install: - pip install tox-travis diff --git a/AUTHORS.rst b/AUTHORS.rst index 4635298..46c8eaa 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -11,5 +11,6 @@ Other contributions from: * Jason M. (@DaddyTheRunner) * Adam Neumann (@noizwaves) * Stephen Doyle (@stevedoyle) +* Loïs Taulelle (@ltaulell) Thank you! diff --git a/CHANGES.rst b/CHANGES.rst index eeb6eec..df4f300 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,12 @@ CHANGES ======= +v1.0.0, 2018-12-15 +------------------ + +* Add support for Notes field + + v0.8.0, 2018-04-27 ------------------ diff --git a/LICENSE b/LICENSE index af273dd..65aa8cb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013-8, Vinod Kurup +Copyright (c) 2013-9, Vinod Kurup All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/README.rst b/README.rst index 8efc5ab..853d243 100644 --- a/README.rst +++ b/README.rst @@ -77,7 +77,7 @@ Basic usage example:: Compatibility ------------- -* Python 2.7 or 3.5+ +* Python 2.7 or 3.7+ License ------- diff --git a/setup.py b/setup.py index a0a877c..cab635b 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -__version__ = '0.8.0' +__version__ = '1.0.0' setup( name='python-tcxparser', @@ -24,7 +24,7 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Topic :: Software Development :: Libraries :: Python Modules', ], install_requires=[ diff --git a/tcxparser/tcxparser.py b/tcxparser/tcxparser.py index bafefb3..f89d6ec 100644 --- a/tcxparser/tcxparser.py +++ b/tcxparser/tcxparser.py @@ -136,3 +136,8 @@ def cadence_max(self): """Returns max cadence of workout""" cadence_data = self.cadence_values() return max(cadence_data) + + @property + def activity_notes(self): + """Return contents of Activity/Notes field if it exists.""" + return getattr(self.activity, 'Notes', '') diff --git a/tests/files/test.tcx b/tests/files/test.tcx index 969a026..cf230b6 100644 --- a/tests/files/test.tcx +++ b/tests/files/test.tcx @@ -3,6 +3,7 @@ 2012-12-26T21:29:53Z + Aerobics 608.47 1609.34399414 diff --git a/tests/test_tcxparser.py b/tests/test_tcxparser.py index d856f4d..f9a9f61 100644 --- a/tests/test_tcxparser.py +++ b/tests/test_tcxparser.py @@ -78,6 +78,9 @@ def test_ascent_is_correct(self): def test_descent_is_correct(self): self.assertAlmostEqual(self.tcx.descent, 166.307128903) + def test_activity_notes_is_correct(self): + self.assertEqual(self.tcx.activity_notes, 'Aerobics') + class BugTest(TestCase): diff --git a/tox.ini b/tox.ini index 3706fd5..7ae484a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,9 @@ [tox] -envlist = py27, py35, flake8, coverage +envlist = py27, py36, flake8, coverage [travis] python = - 3.5: py35, flake8, coverage + 3.6: py36, flake8, coverage 2.7: py27 [testenv:flake8]