def main():
    setup_pypath()

    import virtManager
    from virtManager import cli

    cli.setup_i18n(gettext_app, gettext_dir)

    # Need to do this before GTK strips args like --sync
    gtk_error = None
    origargs = " ".join(sys.argv[:])

    # Urgh, pygtk merely logs a warning when failing to open
    # the X11 display connection, and lets everything carry
    # on as if all were fine. Ultimately bad stuff happens,
    # so lets catch it here & get the hell out...
    import warnings
    warnings.filterwarnings('error', module='gtk', append=True)
    try:
        import gobject

        # Set program name for gnome shell (before importing gtk, which
        # seems to call set_prgname on its own)
        if hasattr(gobject, "set_prgname"):
            gobject.set_prgname(appname)

        import gtk
        globals()["gtk"] = gtk
    except Warning, e:
        # ...the risk is we catch too much though
        # Damned if we do, damned if we dont :-)(
        gtk_error = str(e)
Esempio n. 2
0
def main():
    setup_pypath()

    import virtManager
    from virtManager import cli

    cli.setup_i18n(gettext_app, gettext_dir)

    (options, ignore) = parse_commandline()
    cli.setup_logging(appname, options.debug)

    logging.debug("Launched as: %s", " ".join(sys.argv[:]))
    logging.debug("virtManager import: %s", str(virtManager))

    cli.check_virtinst_version(virtinst_str)

    import virtManager.guidiff
    virtManager.guidiff.is_gui(False)

    # Hack in the default URI for this instance of the tui
    if options.uri:
        import virtManagerTui.libvirtworker
        virtManagerTui.libvirtworker.default_url = options.uri

    # start the app
    from virtManagerTui.mainmenu import MainMenu
    MainMenu()
def main():
    setup_pypath()

    import virtManager
    from virtManager import cli

    cli.setup_i18n(gettext_app, gettext_dir)

    # Need to do this before GTK strips args like --sync
    gtk_error = None
    origargs = " ".join(sys.argv[:])

    # Urgh, pygtk merely logs a warning when failing to open
    # the X11 display connection, and lets everything carry
    # on as if all were fine. Ultimately bad stuff happens,
    # so lets catch it here & get the hell out...
    import warnings
    warnings.filterwarnings('error', module='gtk', append=True)
    try:
        import gobject

        # Set program name for gnome shell (before importing gtk, which
        # seems to call set_prgname on its own)
        if hasattr(gobject, "set_prgname"):
            gobject.set_prgname(appname)

        import gtk
        globals()["gtk"] = gtk
    except Warning, e:
        # ...the risk is we catch too much though
        # Damned if we do, damned if we dont :-)(
        gtk_error = str(e)
def main():
    setup_pypath()

    import virtManager
    from virtManager import cli

    cli.setup_i18n(gettext_app, gettext_dir)

    (options, ignore) = parse_commandline()
    cli.setup_logging(appname, options.debug)

    logging.debug("Launched as: %s", " ".join(sys.argv[:]))
    logging.debug("virtManager import: %s", str(virtManager))

    cli.check_virtinst_version(virtinst_str)

    import virtManager.guidiff
    virtManager.guidiff.is_gui(False)

    # Hack in the default URI for this instance of the tui
    if options.uri:
        import virtManagerTui.libvirtworker
        virtManagerTui.libvirtworker.default_url = options.uri

    # start the app
    from virtManagerTui.mainmenu import MainMenu
    MainMenu()