Commit Graph

5 Commits

Author SHA1 Message Date
Aleksander Morgado
dd3310132f examples,python: fix undefined NameError in modem watcher example
$ ./modem-watcher-python
  [ModemWatcher] ModemManager 1.15.0 service is available in bus
  [ModemWatcher] QUALCOMM INCORPORATED (0) modem managed by ModemManager [863974040050058]: /org/freedesktop/ModemManager1/Modem/0
  [ModemWatcher] Sierra Wireless Inc. (Sierra Wireless EM7345 4G LTE) modem managed by ModemManager [013937003110648]: /org/freedesktop/ModemManager1/Modem/1
  Traceback (most recent call last):
    File "/home/aleksander/Development/foss/ModemManager/examples/modem-watcher-python/./modem-watcher-python", line 35, in <module>
      watcher = ModemWatcher.ModemWatcher()
    File "/home/aleksander/Development/foss/ModemManager/examples/modem-watcher-python/ModemWatcher.py", line 48, in __init__
      self.on_name_owner(self.manager, None)
    File "/home/aleksander/Development/foss/ModemManager/examples/modem-watcher-python/ModemWatcher.py", line 85, in on_name_owner
      self.set_available()
    File "/home/aleksander/Development/foss/ModemManager/examples/modem-watcher-python/ModemWatcher.py", line 64, in set_available
      self.on_object_added(self.manager, obj)
    File "/home/aleksander/Development/foss/ModemManager/examples/modem-watcher-python/ModemWatcher.py", line 101, in on_object_added
      modem_index(obj.get_object_path()))
  NameError: name 'modem_index' is not defined
2021-02-13 11:12:49 +01:00
Yegor Yefremov
16d1cf3318 examples: rework imports
Remove unused imports and fix import sorting using isort utility.
2021-02-13 11:09:59 +01:00
Aleksander Morgado
479590412e examples,watcher: print runtime MM version 2019-01-13 17:36:14 +01:00
Aleksander Morgado
dbb05afba8 examples: avoid warning in modem-watcher-python example
PyGIWarning: ModemManager was imported without specifying a version first. Use gi.require_version('ModemManager', '1.0') before import to ensure that the right version gets loaded.
2016-07-25 13:17:48 +02:00
Aleksander Morgado
ebff76cfaa examples: add modem watcher example in python 2014-04-11 10:31:01 +02:00