diff --git a/HISTORY.md b/HISTORY.md index 731591b..261d1e1 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -17,6 +17,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it - Add: Add phony target to run pre-build hook script (https://github.com/jrid) - Fix: Add BOOTLOADER_PARENT to `arduino-mk-vars.md` and fixed BOOTLOADER_PATH example. (https://github.com/sej7278) - Tweak: Replace perl reset script with Python script. (https://github.com/sej7278) +- Tweak: Made choice of Python2/3 interpreter up to the OS. (https://github.com/peplin) ### 1.3.1 (2014-02-04) - Fix: BUNDLED_AVR_TOOLS_DIR is now set properly when using only arduino-core and not the whole arduino package. (https://github.com/sej7278) diff --git a/bin/ard-reset-arduino b/bin/ard-reset-arduino index ec23023..ed22a63 100755 --- a/bin/ard-reset-arduino +++ b/bin/ard-reset-arduino @@ -1,5 +1,6 @@ -#!/usr/bin/python +#!/usr/bin/env python +from __future__ import print_function import serial import os.path import argparse @@ -13,7 +14,7 @@ parser.add_argument('port', nargs=1, help='Serial device e.g. /dev/ttyACM0') args = parser.parse_args() if args.caterina: - if args.verbose: print 'Forcing reset using 1200bps open/close on port %s' % args.port[0] + if args.verbose: print('Forcing reset using 1200bps open/close on port %s' % args.port[0]) ser = serial.Serial(args.port[0], 57600) ser.close() ser.open() @@ -24,12 +25,12 @@ if args.caterina: sleep(1) while not os.path.exists(args.port[0]): - if args.verbose: print 'Waiting for %s to come back' % args.port[0] + if args.verbose: print('Waiting for %s to come back' % args.port[0]) sleep(1) - if args.verbose: print '%s has come back after reset' % args.port[0] + if args.verbose: print('%s has come back after reset' % args.port[0]) else: - if args.verbose: print 'Setting DTR high on %s for %ss' % (args.port[0],args.period) + if args.verbose: print('Setting DTR high on %s for %ss' % (args.port[0],args.period)) ser = serial.Serial(args.port[0], 115200) ser.setDTR(False) sleep(args.period) diff --git a/packaging/debian/README.md b/packaging/debian/README.md index c89bb43..6385780 100644 --- a/packaging/debian/README.md +++ b/packaging/debian/README.md @@ -7,7 +7,7 @@ or [Ubuntu](https://launchpad.net/ubuntu/+source/arduino-mk) or use apt. First install the dependencies for building/running the package, as root: apt-get build-dep arduino-mk - apt-get install arduino-core build-essential dpkg-dev fakeroot devscripts python-serial + apt-get install arduino-core build-essential dpkg-dev fakeroot devscripts python-serial python3-serial Fetch the Debian source: diff --git a/packaging/fedora/README.md b/packaging/fedora/README.md index 37219cb..63117f9 100644 --- a/packaging/fedora/README.md +++ b/packaging/fedora/README.md @@ -2,7 +2,7 @@ First install the dependencies as root: - yum install arduino-core rpm-build pyserial + yum install arduino-core rpm-build pyserial python3-pyserial From the top-level Arduino-Makefile directory you've checked out of github, run the following (as unprivileged user) to create a compressed tarball using the naming conventions required by rpmbuild: diff --git a/packaging/fedora/arduino-mk.spec b/packaging/fedora/arduino-mk.spec index 88f4083..4958515 100644 --- a/packaging/fedora/arduino-mk.spec +++ b/packaging/fedora/arduino-mk.spec @@ -10,7 +10,7 @@ License: LGPLv2+ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch Requires: arduino-core pyserial -BuildRequires: arduino-core pyserial +BuildRequires: arduino-core pyserial python3-pyserial %description Arduino is an open-source electronics prototyping platform based on @@ -49,6 +49,8 @@ rm -rf %{buildroot} %{_docdir}/%{name}/examples %changelog +* Wed Apr 02 2014 Simon John +- Added BuildRequires of python3-pyserial. Need to look into Requires. * Mon Mar 24 2014 Simon John - Replaced perl/help2man with pyserial for reset script. * Tue Feb 04 2014 Simon John