|
|
|
@ -34,29 +34,31 @@ def main():
|
|
|
|
|
DBUS_NAME, DBUS_METHOD_APP, DBusWidget, dbus_updater_hide_tray)
|
|
|
|
|
__builtin__.__dict__['_print'] = _print
|
|
|
|
|
host, port, args = None, None, None
|
|
|
|
|
if len(sys.argv) > 1:
|
|
|
|
|
parser = parse()
|
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
if args.help:
|
|
|
|
|
parser.print_help()
|
|
|
|
|
sys.exit(0)
|
|
|
|
|
if args.method:
|
|
|
|
|
app = QtGui.QApplication(sys.argv)
|
|
|
|
|
app.setQuitOnLastWindowClosed(True)
|
|
|
|
|
ex = SelectedMethodWgt(app, args)
|
|
|
|
|
if args.method == 'update':
|
|
|
|
|
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
|
|
|
|
|
session_bus = dbus.SessionBus()
|
|
|
|
|
# Export the service
|
|
|
|
|
name = dbus.service.BusName(DBUS_NAME, session_bus)
|
|
|
|
|
# Export the object
|
|
|
|
|
widget = DBusWidget(session_bus, DBUS_METHOD_APP % args.method,
|
|
|
|
|
ex)
|
|
|
|
|
sys.exit(app.exec_())
|
|
|
|
|
if args.host:
|
|
|
|
|
host = args.host
|
|
|
|
|
if args.port:
|
|
|
|
|
port = args.port
|
|
|
|
|
parser = parse()
|
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
if args.help:
|
|
|
|
|
parser.print_help()
|
|
|
|
|
sys.exit(0)
|
|
|
|
|
sym_link = os.path.basename(sys.argv[0])
|
|
|
|
|
if sym_link != 'cl-console-gui' and sym_link.startswith("cl-console-gui-"):
|
|
|
|
|
args.method = sym_link[len("cl-console-gui-"):].replace("-","_")
|
|
|
|
|
if args.method:
|
|
|
|
|
app = QtGui.QApplication(sys.argv)
|
|
|
|
|
app.setQuitOnLastWindowClosed(True)
|
|
|
|
|
ex = SelectedMethodWgt(app, args)
|
|
|
|
|
if args.method == 'update':
|
|
|
|
|
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
|
|
|
|
|
session_bus = dbus.SessionBus()
|
|
|
|
|
# Export the service
|
|
|
|
|
name = dbus.service.BusName(DBUS_NAME, session_bus)
|
|
|
|
|
# Export the object
|
|
|
|
|
widget = DBusWidget(session_bus, DBUS_METHOD_APP % args.method,
|
|
|
|
|
ex)
|
|
|
|
|
sys.exit(app.exec_())
|
|
|
|
|
if args.host:
|
|
|
|
|
host = args.host
|
|
|
|
|
if args.port:
|
|
|
|
|
port = args.port
|
|
|
|
|
|
|
|
|
|
# Enable glib main loop support
|
|
|
|
|
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
|
|
|
|
|