examples: network-scan: get rid of global variables

Move the code into the main() routine.
This commit is contained in:
Yegor Yefremov
2021-02-24 10:10:00 +01:00
committed by Aleksander Morgado
parent 6250603496
commit cc07d21410

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
#
# This program is free software; you can redistribute it and/or modify it under
@@ -26,7 +26,8 @@ gi.require_version('ModemManager', '1.0')
from gi.repository import Gio, GLib, GObject, ModemManager
if __name__ == "__main__":
def main():
"""Main routine."""
# Process input arguments
if len(sys.argv) != 1:
@@ -67,3 +68,7 @@ if __name__ == "__main__":
network.get_availability())))
else:
print('no networks found')
if __name__ == "__main__":
main()