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

Fixed Errors! #1209

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
6 changes: 3 additions & 3 deletions dronekit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,10 +816,10 @@ def __len__(self):
def _update_channel(self, channel, value):
# If we have channels on different ports, we expand the Channels
# object to support them.
channel = int(channel)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is strange

self._readonly = False
self[channel] = value
self._readonly = True
channel = int(channel)
self._count = max(self._count, channel)

@property
Expand Down Expand Up @@ -1309,7 +1309,7 @@ def listener(self, name, msg):
self.notify_attribute_listeners('commands', self.commands)

# Waypoint send to master
@self.on_message(['WAYPOINT_REQUEST', 'MISSION_REQUEST'])
@self.on_message(['WAYPOINT_REQUEST', 'MISSION_REQUEST_INT'])
def listener(self, name, msg):
if self._wp_uploaded is not None:
wp = self._wploader.wp(msg.seq)
Expand Down Expand Up @@ -2917,7 +2917,7 @@ def decorated_thr_min_callback(self, attr_name, value):
return super(Parameters, self).on_attribute(attr_name, *args, **kwargs)


class Command(mavutil.mavlink.MAVLink_mission_item_message):
class Command(mavutil.mavlink.MAVLink_mission_item_int_message):
"""
A waypoint object.

Expand Down
8 changes: 6 additions & 2 deletions dronekit/mavlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ def recv(self, n=None):
if e.errno in [errno.EAGAIN, errno.EWOULDBLOCK, errno.ECONNREFUSED]:
return ""
if self.udp_server:
self.addresses.add(new_addr)
try:
self.addresses.add(new_addr)
except:
return ""
ShafiqSadat marked this conversation as resolved.
Show resolved Hide resolved
elif self.broadcast:
self.addresses = {new_addr}
return data
Expand Down Expand Up @@ -245,7 +248,8 @@ def mavlink_thread_in():
)

except APIException as e:
self._logger.exception('Exception in MAVLink input loop')
#self._logger.exception('Exception in MAVLink input loop')
self._logger.warning('%s' % str(e))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks wrong

self._alive = False
self.master.close()
self._death_error = e
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import setuptools
import os

version = '2.9.2'
version = '2.9.3.1'

with open(os.path.join(os.path.dirname(__file__), 'README.md')) as f:
with open(os.path.join(os.path.dirname(__file__), 'README.md'), encoding="utf-8") as f:
LongDescription = f.read()

setuptools.setup(
Expand Down