[riot-notifications] [RIOT-OS/RIOT] dist/pythonlibs/riotctrl_shell: add loramac shell (#16403)

Martine Lenders notifications at github.com
Mon May 3 11:41:31 CEST 2021


@miri64 requested changes on this pull request.



> +        return self.loramac_cmd(args=("save"), timeout=timeout, async_=async_)
+
+    def loramac_eeprom_erase(self, timeout=-1, async_=False):
+        return self.loramac_cmd(args=("erase"), timeout=timeout, async_=async_)
+
+    def loramac_help(self, timeout=-1, async_=False):
+        return self.loramac_cmd(args=("help"), timeout=timeout, async_=async_)

This will not work. `args` is expected to be a sequence, so `loramac_cmd` will make this e.g. `loramac s a v e`. Please use a 1-tuple instead of a (parenthesized) string, as per my original suggestion (note the comma after the string; the devil is in the detail here ;-)).

```suggestion
        return self.loramac_cmd(args=("save",), timeout=timeout, async_=async_)

    def loramac_eeprom_erase(self, timeout=-1, async_=False):
        return self.loramac_cmd(args=("erase",), timeout=timeout, async_=async_)

    def loramac_help(self, timeout=-1, async_=False):
        return self.loramac_cmd(args=("help",), timeout=timeout, async_=async_)
```

Alternatively, if you are not comfortable with 1-tuples, use lists:

```suggestion
        return self.loramac_cmd(args=["save"], timeout=timeout, async_=async_)

    def loramac_eeprom_erase(self, timeout=-1, async_=False):
        return self.loramac_cmd(args=["erase"], timeout=timeout, async_=async_)

    def loramac_help(self, timeout=-1, async_=False):
        return self.loramac_cmd(args=["help"], timeout=timeout, async_=async_)
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16403#pullrequestreview-650212996
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210503/cd727150/attachment.htm>


More information about the notifications mailing list