Skip to content

Commit 754c0bc

Browse files
committed
examples/*: Convert to python 3.
Also bump copyright year.
1 parent c9ce92b commit 754c0bc

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

examples/hotplug.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
# Copyright (C) 2013-2018 Vincent Pelletier <plr.vincent@gmail.com>
2+
# Copyright (C) 2013-2021 Vincent Pelletier <plr.vincent@gmail.com>
33
#
44
# This library is free software; you can redistribute it and/or
55
# modify it under the terms of the GNU Lesser General Public
@@ -14,7 +14,7 @@
1414
# You should have received a copy of the GNU Lesser General Public
1515
# License along with this library; if not, write to the Free Software
1616
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17-
from __future__ import print_function
17+
1818
import usb1
1919

2020
def hotplug_callback(context, device, event):

examples/hotplug_advanced.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
# Copyright (C) 2013-2018 Vincent Pelletier <plr.vincent@gmail.com>
2+
# Copyright (C) 2013-2021 Vincent Pelletier <plr.vincent@gmail.com>
33
#
44
# This library is free software; you can redistribute it and/or
55
# modify it under the terms of the GNU Lesser General Public
@@ -18,7 +18,7 @@
1818
Advanced hotplug examples.
1919
Presents ways of integrating hotplug into your userland USB driver.
2020
"""
21-
from __future__ import print_function
21+
2222
import select
2323
import sys
2424
import usb1
@@ -58,12 +58,12 @@ def poll(self, timeout=None):
5858
for fd_list, happened_flag in zip(
5959
select.select(*([[
6060
fd
61-
for fd, events in self._fd_dict.iteritems() if events & flag
61+
for fd, events in self._fd_dict.items() if events & flag
6262
] for flag in flag_list] + [timeout])),
6363
flag_list,
6464
):
6565
result[fd] = result.get(fd, 0) | happened_flag
66-
return result.items()
66+
return list(result.items())
6767
# (end of demonstration helpers)
6868

6969
class AwesomeDevice(object):

examples/listdevs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
# Copyright (C) 2013-2018 Vincent Pelletier <plr.vincent@gmail.com>
2+
# Copyright (C) 2013-2021 Vincent Pelletier <plr.vincent@gmail.com>
33
#
44
# This library is free software; you can redistribute it and/or
55
# modify it under the terms of the GNU Lesser General Public
@@ -14,7 +14,7 @@
1414
# You should have received a copy of the GNU Lesser General Public
1515
# License along with this library; if not, write to the Free Software
1616
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17-
from __future__ import print_function
17+
1818
import usb1
1919

2020
def main():

0 commit comments

Comments
 (0)