Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gi.require_version('Gtk', '3.0')
_require('gi.repository.Gtk', 'gir1.2-gtk-3.0')
try:
import solaar.ui as ui
import solaar.listener as listener
listener.setup_scanner(ui.status_changed, ui.error_dialog)
import solaar.upower as _upower
if args.restart_on_wake_up:
_upower.watch(listener.start_all, listener.stop_all)
else:
_upower.watch(listener.ping_all)
# main UI event loop
ui.run_loop(listener.start_all, listener.stop_all)
except Exception as e:
import sys
sys.exit('%s: error: %s' % (NAME.lower(), e))