Ejemplo n.º 1
0
def main():
    from xpra.os_util import set_application_name, set_prgname
    set_prgname("OSX Shadow Test")
    set_application_name("OSX Shadow Test")

    defaults = make_defaults_struct()
    for x in ("daemon", "clipboard", "mmap", "speaker", "microphone",
              "cursors", "bell", "notifications", "system_tray", "sharing",
              "delay_tray", "opengl"):
        setattr(defaults, x, False)

    loop_exit = gtk.main_quit
    loop_run = gtk.main

    XPRA_DISPLAY = ":10"
    sp = "~/.xpra/%s-%s" % (socket.gethostname(), XPRA_DISPLAY[1:])
    sockpath = os.path.expanduser(sp)

    listener = socket.socket(socket.AF_UNIX)
    listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    listener.setblocking(1)
    listener.bind(sockpath)
    sockets = [listener]

    ss = ShadowServer()
    ss.init(sockets, defaults)
    ss.run()

    gobject.timeout_add(1000 * 120, loop_exit)
    loop_run()
Ejemplo n.º 2
0
def main():
    from xpra.os_util import set_application_name, set_prgname
    set_prgname("OSX Shadow Test")
    set_application_name("OSX Shadow Test")

    defaults = make_defaults_struct()
    for x in ("daemon", "clipboard", "mmap", "speaker", "microphone",
              "cursors", "bell", "notifications",
              "system_tray", "sharing",
              "delay_tray", "opengl"):
        setattr(defaults, x, False)

    loop_exit = gtk.main_quit
    loop_run = gtk.main


    XPRA_DISPLAY = ":10"
    sp = "~/.xpra/%s-%s" % (socket.gethostname(), XPRA_DISPLAY[1:])
    sockpath = os.path.expanduser(sp)

    listener = socket.socket(socket.AF_UNIX)
    listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    listener.setblocking(1)
    listener.bind(sockpath)
    sockets = [listener]

    ss = ShadowServer()
    ss.init(sockets, defaults)
    ss.run()

    gobject.timeout_add(1000*120, loop_exit)
    loop_run()
Ejemplo n.º 3
0
def main():
    if sys.platform.startswith("win"):
        from xpra.platform.win32 import set_log_filename
        set_log_filename("Xpra-Launcher.log")
    set_prgname("Xpra-Launcher")
    platform_init()
    gui_init()

    #logging init:
    from xpra.scripts.main import parse_cmdline
    _, options, args = parse_cmdline(sys.argv)
    import logging
    logging.basicConfig(format="%(asctime)s %(message)s")
    if options.debug:
        logging.root.setLevel(logging.DEBUG)
    else:
        logging.root.setLevel(logging.INFO)

    app = ApplicationWindow()

    def app_signal(signum, frame):
        print("")
        log("got signal %s" % SIGNAMES.get(signum, signum))

        def show_signal():
            app.show()
            app.client.cleanup()
            gobject.timeout_add(1000, app.set_info_text,
                                "got signal %s" % SIGNAMES.get(signum, signum))
            gobject.timeout_add(1000, app.set_info_color, True)

        #call from UI thread:
        gobject.idle_add(show_signal)

    signal.signal(signal.SIGINT, app_signal)
    signal.signal(signal.SIGTERM, app_signal)
    has_file = len(args) == 1
    if has_file:
        app.update_options_from_file(args[0])
    if app.config.debug:
        logging.root.setLevel(logging.DEBUG)
    app.create_window()
    try:
        app.update_gui_from_config()
        if app.config.autoconnect:
            #file says we should connect,
            #do that only (not showing UI unless something goes wrong):
            gobject.idle_add(app.do_connect)
        if not has_file:
            app.reset_errors()
        gui_ready()
        if not app.config.autoconnect or app.config.debug:
            app.show()
        app.run()
    except KeyboardInterrupt:
        pass
    return 0
Ejemplo n.º 4
0
def main():
    from xpra.os_util import set_application_name, set_prgname
    if sys.platform.startswith("win"):
        from xpra.platform.win32 import set_redirect_output, set_log_filename
        set_redirect_output(True)
        set_log_filename("Keyboard_Test.log")
    init()
    set_prgname("Keyboard Test Tool")
    set_application_name("Keyboard Test Tool")
    KeyboardStateInfoWindow()
    gtk.main()
Ejemplo n.º 5
0
def main():
    if sys.platform.startswith("win"):
        from xpra.platform.win32 import set_log_filename
        set_log_filename("Xpra-Launcher.log")
    set_prgname("Xpra-Launcher")
    platform_init()
    gui_init()

    #logging init:
    from xpra.scripts.main import parse_cmdline
    _, options, args = parse_cmdline(sys.argv)
    import logging
    logging.basicConfig(format="%(asctime)s %(message)s")
    if options.debug:
        logging.root.setLevel(logging.DEBUG)
    else:
        logging.root.setLevel(logging.INFO)

    app = ApplicationWindow()
    def app_signal(signum, frame):
        print("")
        log("got signal %s" % SIGNAMES.get(signum, signum))
        def show_signal():
            app.show()
            app.client.cleanup()
            gobject.timeout_add(1000, app.set_info_text, "got signal %s" % SIGNAMES.get(signum, signum))
            gobject.timeout_add(1000, app.set_info_color, True)
        #call from UI thread:
        gobject.idle_add(show_signal)
    signal.signal(signal.SIGINT, app_signal)
    signal.signal(signal.SIGTERM, app_signal)
    has_file = len(args) == 1
    if has_file:
        app.update_options_from_file(args[0])
    if app.config.debug:
        logging.root.setLevel(logging.DEBUG)
    app.create_window()
    try:
        app.update_gui_from_config()
        if app.config.autoconnect:
            #file says we should connect,
            #do that only (not showing UI unless something goes wrong):
            gobject.idle_add(app.do_connect)
        if not has_file:
            app.reset_errors()
        gui_ready()
        if not app.config.autoconnect or app.config.debug:
            app.show()
        app.run()
    except KeyboardInterrupt:
        pass
    return 0
Ejemplo n.º 6
0
def main():	
	logging.basicConfig(format="%(asctime)s %(message)s")
	logging.root.setLevel(logging.DEBUG)

	from xpra.os_util import set_application_name, set_prgname
	set_prgname("Primary Clipboard Test Tool")
	set_application_name("Primary Clipboard Test Tool")
	if sys.platform.startswith("win"):
		from xpra.platform.win32 import set_redirect_output, set_log_filename
		set_redirect_output(True)
		set_log_filename("Primary_Clipboard_Test.log")
	init()

	frc = FakeRemoteClipboard()
	gobject.timeout_add(1000, frc.fake_token)
	#gobject.timeout_add(1200, fake_target, 0)
	#gobject.timeout_add(1400, fake_target, 1)
	#gobject.timeout_add(1600, fake_target, 2)
	#gobject.timeout_add(1800, fake_data, 2)
	#gobject.timeout_add(2500, fake_data, 3)
	#gobject.timeout_add(3500, fake_data, 5)
	gtk.main()
Ejemplo n.º 7
0
def main():
    logging.basicConfig(format="%(asctime)s %(message)s")
    logging.root.setLevel(logging.DEBUG)

    from xpra.os_util import set_application_name, set_prgname
    set_prgname("Primary Clipboard Test Tool")
    set_application_name("Primary Clipboard Test Tool")
    if sys.platform.startswith("win"):
        from xpra.platform.win32 import set_redirect_output, set_log_filename
        set_redirect_output(True)
        set_log_filename("Primary_Clipboard_Test.log")
    init()

    frc = FakeRemoteClipboard()
    gobject.timeout_add(1000, frc.fake_token)
    #gobject.timeout_add(1200, fake_target, 0)
    #gobject.timeout_add(1400, fake_target, 1)
    #gobject.timeout_add(1600, fake_target, 2)
    #gobject.timeout_add(1800, fake_data, 2)
    #gobject.timeout_add(2500, fake_data, 3)
    #gobject.timeout_add(3500, fake_data, 5)
    gtk.main()
Ejemplo n.º 8
0
def init_main(prgname):
    logging.basicConfig(format="%(asctime)s %(message)s")
    logging.root.setLevel(logging.DEBUG)
    from xpra.os_util import set_application_name, set_prgname
    set_prgname(prgname)
    set_application_name(prgname)
Ejemplo n.º 9
0
def init_main(prgname):
    logging.basicConfig(format="%(asctime)s %(message)s")
    logging.root.setLevel(logging.DEBUG)
    from xpra.os_util import set_application_name, set_prgname
    set_prgname(prgname)
    set_application_name(prgname)