Commit Graph

14 Commits

Author SHA1 Message Date
Julian Oes 9a96ca14be Tools: make Python import error more readable
The problem with printing the exception was that starting with
Python 3.6 the ImportError is yet another (sub) exception called
ModuleNotFoundError which can't be printed as a string and then triggers
another exception:

```
Traceback (most recent call last):
  File "/home/julianoes/src/Firmware/Tools/serial/generate_config.py", line 11, in <module>
    import jinja2
ModuleNotFoundError: No module named 'jinja2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/julianoes/src/Firmware/Tools/serial/generate_config.py", line 13, in <module>
    print("Failed to import jinja2: " + e)
TypeError: must be str, not ModuleNotFoundError
```

As per @bkueng's suggestion the easiest is to cast the exception to str
and that way prevent the second exception.
2020-02-14 11:40:05 +01:00
Julian Oes c77816aef2 cmake: move jinja2 check to Python modules
This removes the cmake check for jinja2 and moves it to the respective
Python scripts.
2020-01-16 16:25:26 +01:00
Julian Oes b04f68553e Tools: use Python 3, improve import checks
In more detail:
- Change shebang to Python 3.
- Suggest installation using pip3 as user.
2020-01-16 16:25:26 +01:00
Daniel Agar ce1e9762b0 deprecate df_hmc5883_wrapper and replace with in tree hmc5883
- deprecate DriverFramework hmc5883 driver (df_hmc5883_wrapper)
 - update aerotenna ocpoc and snapdragon flight eagle boards to use in tree hmc5883
2020-01-05 15:17:26 -05:00
garfieldG cc1d86bc0b @value will be printed with Whitespace in start of line for serial_config parameters 2019-10-02 10:34:10 +02:00
Beat Küng 5fe4c61b42 rc_input: add RC_PORT_CONFIG param to configure RC port
The parameter will only be available if the board defines an 'RC' serial
port in SERIAL_PORTS (in default.cmake).
2019-07-16 08:09:22 +02:00
Daniel Agar 471e1bc866
serial/generate_config.py specify full loader (#11667)
- fixes #11666
2019-03-16 11:19:01 -04:00
Matthias Grob bee1835831 Tools: fix style consistency in shell scripts "if [...]; then" 2019-02-24 11:20:38 -05:00
David Sidrane 11f9925b02 rcS,rc.serial.jinja:ensure proper unset hygiene
Delete auto generated vars, and others that were missed.
2018-12-12 15:14:11 -05:00
Beat Küng 37338e442f NuttX shell scripts: replace operator == with =
- NuttX supports both versions
- POSIX shell only supports '='
2018-09-27 23:39:20 +02:00
Daniel Agar 078f5ea198 serial generate config add 10 generic serial ports 2018-09-25 07:53:29 +02:00
Beat Küng 64912ed7f6 rc.serial.jinja: remove 'param touch' for baudrates
Can be reverted if needed later on...
2018-09-25 07:53:29 +02:00
Beat Küng dae292631c Tools/serial: use per-module serial port config params, instead of per-port 2018-09-25 07:53:29 +02:00
Beat Küng 5bb75a7ff8 Tools/serial: add script to generate ROMFS serial startup logic & serial parameters 2018-09-25 07:53:29 +02:00