Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 10ea6fb

Browse files
committedApr 3, 2014
Merge pull request #183 from sej7278/master
python3 compatibility
2 parents 392a6b9 + c080fb2 commit 10ea6fb

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed
 

‎HISTORY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it
1717
- Add: Add phony target to run pre-build hook script (https://github.com/jrid)
1818
- Fix: Add BOOTLOADER_PARENT to `arduino-mk-vars.md` and fixed BOOTLOADER_PATH example. (https://github.com/sej7278)
1919
- Tweak: Replace perl reset script with Python script. (https://github.com/sej7278)
20+
- Tweak: Made choice of Python2/3 interpreter up to the OS. (https://github.com/peplin)
2021

2122
### 1.3.1 (2014-02-04)
2223
- Fix: BUNDLED_AVR_TOOLS_DIR is now set properly when using only arduino-core and not the whole arduino package. (https://github.com/sej7278)

‎bin/ard-reset-arduino

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python
22

3+
from __future__ import print_function
34
import serial
45
import os.path
56
import argparse
@@ -13,7 +14,7 @@ parser.add_argument('port', nargs=1, help='Serial device e.g. /dev/ttyACM0')
1314
args = parser.parse_args()
1415

1516
if args.caterina:
16-
if args.verbose: print 'Forcing reset using 1200bps open/close on port %s' % args.port[0]
17+
if args.verbose: print('Forcing reset using 1200bps open/close on port %s' % args.port[0])
1718
ser = serial.Serial(args.port[0], 57600)
1819
ser.close()
1920
ser.open()
@@ -24,12 +25,12 @@ if args.caterina:
2425
sleep(1)
2526

2627
while not os.path.exists(args.port[0]):
27-
if args.verbose: print 'Waiting for %s to come back' % args.port[0]
28+
if args.verbose: print('Waiting for %s to come back' % args.port[0])
2829
sleep(1)
2930

30-
if args.verbose: print '%s has come back after reset' % args.port[0]
31+
if args.verbose: print('%s has come back after reset' % args.port[0])
3132
else:
32-
if args.verbose: print 'Setting DTR high on %s for %ss' % (args.port[0],args.period)
33+
if args.verbose: print('Setting DTR high on %s for %ss' % (args.port[0],args.period))
3334
ser = serial.Serial(args.port[0], 115200)
3435
ser.setDTR(False)
3536
sleep(args.period)

‎packaging/debian/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ or [Ubuntu](https://launchpad.net/ubuntu/+source/arduino-mk) or use apt.
77
First install the dependencies for building/running the package, as root:
88

99
apt-get build-dep arduino-mk
10-
apt-get install arduino-core build-essential dpkg-dev fakeroot devscripts python-serial
10+
apt-get install arduino-core build-essential dpkg-dev fakeroot devscripts python-serial python3-serial
1111

1212
Fetch the Debian source:
1313

‎packaging/fedora/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
First install the dependencies as root:
44

5-
yum install arduino-core rpm-build pyserial
5+
yum install arduino-core rpm-build pyserial python3-pyserial
66

77
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:
88

‎packaging/fedora/arduino-mk.spec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ License: LGPLv2+
1010
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
1111
BuildArch: noarch
1212
Requires: arduino-core pyserial
13-
BuildRequires: arduino-core pyserial
13+
BuildRequires: arduino-core pyserial python3-pyserial
1414

1515
%description
1616
Arduino is an open-source electronics prototyping platform based on
@@ -49,6 +49,8 @@ rm -rf %{buildroot}
4949
%{_docdir}/%{name}/examples
5050

5151
%changelog
52+
* Wed Apr 02 2014 Simon John <git@the-jedi.co.uk>
53+
- Added BuildRequires of python3-pyserial. Need to look into Requires.
5254
* Mon Mar 24 2014 Simon John <git@the-jedi.co.uk>
5355
- Replaced perl/help2man with pyserial for reset script.
5456
* Tue Feb 04 2014 Simon John <git@the-jedi.co.uk>

1 commit comments

Comments
 (1)

sej7278 commented on Apr 4, 2014

@sej7278
Collaborator

i've got some tweaks to do to the debian packaging. python-serial and python3-serial aren't actually build-dep's.

similarly for fedora, BuildRequires doesn't actually need pyserial or python3-pyserial - only Requires.

Please sign in to comment.