[PATCH] examples: rework imports

Aleksander Morgado aleksander at aleksander.es
Sat Feb 13 10:14:17 UTC 2021


On Sat, Feb 13, 2021 at 9:40 AM <yegorslists at googlemail.com> wrote:
>
> 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(-)
>

Merged, thanks!

> 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
>
> _______________________________________________
> ModemManager-devel mailing list
> ModemManager-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel



-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list