[PATCH] examples: rework imports
yegorslists at googlemail.com
yegorslists at googlemail.com
Sat Feb 13 08:40:05 UTC 2021
From: Yegor Yefremov <yegorslists at googlemail.com>
Remove unused imports and fix import sorting using isort utility.
---
examples/modem-watcher-python/ModemWatcher.py | 6 +++---
examples/modem-watcher-python/modem-watcher-python | 6 ++++--
examples/network-scan-python/network-scan-python | 6 ++++--
examples/sms-python/sms-python | 6 ++++--
4 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/examples/modem-watcher-python/ModemWatcher.py b/examples/modem-watcher-python/ModemWatcher.py
index a18725b1..8091d9f3 100644
--- a/examples/modem-watcher-python/ModemWatcher.py
+++ b/examples/modem-watcher-python/ModemWatcher.py
@@ -18,10 +18,10 @@
# Copyright (C) 2014 Aleksander Morgado <aleksander at aleksander.es>
#
-import os, sys, gi
-
+import gi
gi.require_version('ModemManager', '1.0')
-from gi.repository import GLib, GObject, Gio, ModemManager
+from gi.repository import Gio, GLib, GObject, ModemManager
+
"""
The ModemWatcher class is responsible for monitoring ModemManager
diff --git a/examples/modem-watcher-python/modem-watcher-python b/examples/modem-watcher-python/modem-watcher-python
index 40998588..4884beef 100755
--- a/examples/modem-watcher-python/modem-watcher-python
+++ b/examples/modem-watcher-python/modem-watcher-python
@@ -18,10 +18,12 @@
# Copyright (C) 2014 Aleksander Morgado <aleksander at aleksander.es>
#
-import sys, signal
-import ModemWatcher
+import signal
+
from gi.repository import GLib
+import ModemWatcher
+
main_loop = None
watcher = None
diff --git a/examples/network-scan-python/network-scan-python b/examples/network-scan-python/network-scan-python
index ad377091..51b8077c 100755
--- a/examples/network-scan-python/network-scan-python
+++ b/examples/network-scan-python/network-scan-python
@@ -18,10 +18,12 @@
# Copyright (C) 2019 Aleksander Morgado <aleksander at aleksander.es>
#
-import sys, signal, gi
+import sys
+import gi
gi.require_version('ModemManager', '1.0')
-from gi.repository import GLib, GObject, Gio, ModemManager
+from gi.repository import Gio, GLib, GObject, ModemManager
+
if __name__ == "__main__":
diff --git a/examples/sms-python/sms-python b/examples/sms-python/sms-python
index 2d572f18..569db376 100755
--- a/examples/sms-python/sms-python
+++ b/examples/sms-python/sms-python
@@ -18,10 +18,12 @@
# Copyright (C) 2016 Aleksander Morgado <aleksander at aleksander.es>
#
-import sys, signal, gi
+import sys
+import gi
gi.require_version('ModemManager', '1.0')
-from gi.repository import GLib, GObject, Gio, ModemManager
+from gi.repository import Gio, GLib, GObject, ModemManager
+
if __name__ == "__main__":
--
2.17.0
More information about the ModemManager-devel
mailing list