Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ArduPilot/pymavlink
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 93dcec63ec538726e8c3bc5fd6c7cabc4d10a3ed
Choose a base ref
..
head repository: ArduPilot/pymavlink
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 554cc7d169463cc60e9e3db7ab16856444fe39ee
Choose a head ref
Showing with 9 additions and 14 deletions.
  1. +1 −7 README.md
  2. +8 −7 generator/mavgen_python.py
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -15,8 +15,6 @@ Examples can be found [in the repository](examples/) or in the [ArduSub book](ht

# Installation

Pymavlink supports both Python 2 and Python 3.

The following instructions assume you are using Python 3 and a Debian-based (like Ubuntu) installation.

.. note::
@@ -27,7 +25,7 @@ The following instructions assume you are using Python 3 and a Debian-based (lik

Pymavlink has several dependencies :

- [future](http://python-future.org/) : for Python 2 and Python 3 interoperability
- [future](http://python-future.org/) : for interoperability
- [lxml](http://lxml.de/installation.html) : for checking and parsing xml file

Optional :
@@ -39,10 +37,6 @@ Optional :

lxml has some additional dependencies that can be installed with your package manager (here with `apt-get`) :

.. note::

If you continue to use Python 2 you may need to change package names here (e.g. python3-numpy => python-numpy)

```bash
sudo apt-get install libxml2-dev libxslt-dev
```
15 changes: 8 additions & 7 deletions generator/mavgen_python.py
Original file line number Diff line number Diff line change
@@ -451,6 +451,14 @@ def generate_enums(outf, enums, enable_type_annotations):
# enums
class EnumEntry(object):
def __init__(self, name${type_str}, description${type_str})${type_none_ret}:
self.name = name
self.description = description
self.param${type_dict_int_to_str} = {}
self.has_location = False
class MavEnum(${type_dict_int_to_enumentry_cast}):
def __init__(self, bitmask${type_bool_default})${type_none_ret}:
super(MavEnum, self).__init__()
@@ -459,13 +467,6 @@ def __init__(self, bitmask${type_bool_default})${type_none_ret}:
def is_bitmask(self)${type_bool_ret}:
return self.bitmask
class EnumEntry(object):
def __init__(self, name${type_str}, description${type_str})${type_none_ret}:
self.name = name
self.description = description
self.param${type_dict_int_to_str} = {}
self.has_location = False
enums${type_dict_str_to_MavEnum} = {}
""",