1
0
mirror of https://github.com/gryf/wicd.git synced 2026-02-18 16:05:46 +01:00

Move clients to the main wicd module.

This commit is contained in:
2020-08-05 18:25:46 +02:00
parent 24117dbf81
commit fe0cb5ad40
8 changed files with 20 additions and 7 deletions

View File

@@ -1167,7 +1167,7 @@ class appGUI():
self.update_status() self.update_status()
def main(): def run():
"""Main function.""" """Main function."""
global ui, dlogger global ui, dlogger
# We are not python. # We are not python.
@@ -1274,7 +1274,7 @@ def setup_dbus(force=True):
setup_dbus() setup_dbus()
if __name__ == '__main__': def main():
try: try:
parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % parser = OptionParser(version="wicd-curses-%s (using wicd %s)" %
(CURSES_REV, daemon.Hello()), (CURSES_REV, daemon.Hello()),
@@ -1291,4 +1291,8 @@ if __name__ == '__main__':
# help="enable logging of wicd-curses (currently does nothing)") # help="enable logging of wicd-curses (currently does nothing)")
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
run()
if __name__ == "__main__":
main() main()

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
"""Scriptable command-line interface.""" """Scriptable command-line interface."""
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -324,4 +323,10 @@ if options.save and options.network > -1:
if not op_performed: if not op_performed:
print("No operations performed.") print("No operations performed.")
sys.exit(exit_status)
def main():
sys.exit(exit_status)
if __name__ == "__main__":
main()

View File

@@ -1790,7 +1790,7 @@ def daemonize():
os.dup2(0, 2) os.dup2(0, 2)
def main(argv): def run(argv):
"""The main daemon program. """The main daemon program.
Keyword arguments: Keyword arguments:
@@ -1962,7 +1962,7 @@ def on_exit(child_pid):
sys.exit(0) sys.exit(0)
if __name__ == '__main__': def main():
if os.getuid() != 0: if os.getuid() != 0:
print("Root privileges are required for the daemon to run properly. " print("Root privileges are required for the daemon to run properly. "
"Exiting.") "Exiting.")
@@ -1970,4 +1970,8 @@ if __name__ == '__main__':
# No more needed since PyGObject 3.11, c.f. # No more needed since PyGObject 3.11, c.f.
# https://wiki.gnome.org/PyGObject/Threading # https://wiki.gnome.org/PyGObject/Threading
# gobject.threads_init() # gobject.threads_init()
main(sys.argv) run(sys.argv)
if __name__ == '__main__':
main()