mirror of
https://github.com/gryf/wicd.git
synced 2026-01-03 20:34:17 +01:00
Move clients to the main wicd module.
This commit is contained in:
@@ -1167,7 +1167,7 @@ class appGUI():
|
||||
self.update_status()
|
||||
|
||||
|
||||
def main():
|
||||
def run():
|
||||
"""Main function."""
|
||||
global ui, dlogger
|
||||
# We are not python.
|
||||
@@ -1274,7 +1274,7 @@ def setup_dbus(force=True):
|
||||
setup_dbus()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
def main():
|
||||
try:
|
||||
parser = OptionParser(version="wicd-curses-%s (using wicd %s)" %
|
||||
(CURSES_REV, daemon.Hello()),
|
||||
@@ -1291,4 +1291,8 @@ if __name__ == '__main__':
|
||||
# help="enable logging of wicd-curses (currently does nothing)")
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
run()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""Scriptable command-line interface."""
|
||||
# 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
|
||||
@@ -324,4 +323,10 @@ if options.save and options.network > -1:
|
||||
if not op_performed:
|
||||
print("No operations performed.")
|
||||
|
||||
sys.exit(exit_status)
|
||||
|
||||
def main():
|
||||
sys.exit(exit_status)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1790,7 +1790,7 @@ def daemonize():
|
||||
os.dup2(0, 2)
|
||||
|
||||
|
||||
def main(argv):
|
||||
def run(argv):
|
||||
"""The main daemon program.
|
||||
|
||||
Keyword arguments:
|
||||
@@ -1962,7 +1962,7 @@ def on_exit(child_pid):
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
def main():
|
||||
if os.getuid() != 0:
|
||||
print("Root privileges are required for the daemon to run properly. "
|
||||
"Exiting.")
|
||||
@@ -1970,4 +1970,8 @@ if __name__ == '__main__':
|
||||
# No more needed since PyGObject 3.11, c.f.
|
||||
# https://wiki.gnome.org/PyGObject/Threading
|
||||
# gobject.threads_init()
|
||||
main(sys.argv)
|
||||
run(sys.argv)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user