Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working 3.10 install #52

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,8 @@ venv.bak/
dmypy.json

# Pyre type checker
.pyre/
.pyre/

# Ignore protobuf stuff
.protobuf/
google/
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true
}
]
}
27 changes: 27 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build protobuf files",
"type": "shell",
"command": "${workspaceFolder}/.protobuf/bin/protoc",
"args": [
"--proto_path=${workspaceFolder}",
"--python_out=${workspaceFolder}",
"${workspaceFolder}/anki_vector/messaging/*.proto"
],
"options": {
"cwd": "${workspaceFolder}/.protobuf"
},
"problemMatcher": []
},
{
"label": "echo",
"type": "shell",
"command": "echo ${workspaceFolder}",
"problemMatcher": []
}
]
}
10 changes: 5 additions & 5 deletions anki_vector/annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
except SyntaxError:
sys.exit("SyntaxError: possible if accidentally importing old Python 2 version of PIL")

from . import faces
from . import objects
from . import util
from anki_vector import faces
from anki_vector import objects
from anki_vector import util


DEFAULT_OBJECT_COLORS = {
Expand All @@ -61,9 +61,9 @@
}

#: Fastest resampling mode, use nearest pixel
RESAMPLE_MODE_NEAREST = Image.NEAREST
RESAMPLE_MODE_NEAREST = Image.Resampling.NEAREST
#: Slower, but smoother, resampling mode - linear interpolation from 2x2 grid of pixels
RESAMPLE_MODE_BILINEAR = Image.BILINEAR
RESAMPLE_MODE_BILINEAR = Image.Resampling.BILINEAR


class AnnotationPosition(Enum):
Expand Down
8 changes: 4 additions & 4 deletions anki_vector/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ class _ControlEventManager:
"""

def __init__(self, loop: asyncio.BaseEventLoop = None, priority: ControlPriorityLevel = None):
self._granted_event = asyncio.Event(loop=loop)
self._lost_event = asyncio.Event(loop=loop)
self._request_event = asyncio.Event(loop=loop)
self._granted_event = asyncio.Event()
self._lost_event = asyncio.Event()
self._request_event = asyncio.Event()
self._has_control = False
self._priority = priority
self._is_shutdown = False
Expand Down Expand Up @@ -613,7 +613,7 @@ async def play_animation():
self._control_events.shutdown()
if self._control_stream_task:
self._control_stream_task.cancel()
self.run_coroutine(self._control_stream_task).result()
asyncio.gather(self._control_stream_task, return_exceptions=True)
self._cancel_active()
if self._channel:
self.run_coroutine(self._channel.close()).result()
Expand Down
2 changes: 1 addition & 1 deletion anki_vector/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def _run_thread(self):
try:
self._loop = asyncio.new_event_loop()
asyncio.set_event_loop(self._loop)
self._done_signal = asyncio.Event(loop=self._loop)
self._done_signal = asyncio.Event()
# create an event stream handler on the connection thread
self.event_future = asyncio.run_coroutine_threadsafe(self._handle_event_stream(), self._conn.loop)

Expand Down
25 changes: 9 additions & 16 deletions anki_vector/messaging/alexa_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading