2014-01-20 10:09:13 -06:00
|
|
|
# Copyright (C) 2013, 2014 Red Hat, Inc.
|
2013-03-17 16:06:52 -05:00
|
|
|
#
|
2018-04-04 08:35:41 -05:00
|
|
|
# This work is licensed under the GNU GPLv2 or later.
|
2018-03-20 14:00:02 -05:00
|
|
|
# See the COPYING file in the top-level directory.
|
2013-03-17 16:06:52 -05:00
|
|
|
|
2019-06-07 16:50:58 -05:00
|
|
|
# pylint: disable=wrong-import-position
|
|
|
|
|
2019-06-07 16:45:21 -05:00
|
|
|
import gi
|
|
|
|
gi.require_version('Libosinfo', '1.0')
|
|
|
|
|
2019-06-14 15:34:00 -05:00
|
|
|
from virtinst.buildconfig import BuildConfig
|
2013-03-17 16:06:52 -05:00
|
|
|
|
|
|
|
|
2014-09-08 09:40:34 -05:00
|
|
|
def _setup_i18n():
|
|
|
|
import gettext
|
|
|
|
import locale
|
|
|
|
|
|
|
|
try:
|
|
|
|
locale.setlocale(locale.LC_ALL, '')
|
2019-06-10 13:15:50 -05:00
|
|
|
except Exception: # pragma: no cover
|
2014-09-08 09:40:34 -05:00
|
|
|
# Can happen if user passed a bogus LANG
|
|
|
|
pass
|
|
|
|
|
2020-07-14 02:41:56 -05:00
|
|
|
gettext.install("virt-manager", BuildConfig.gettext_dir,
|
|
|
|
names=["ngettext"])
|
2019-06-14 15:34:00 -05:00
|
|
|
gettext.bindtextdomain("virt-manager", BuildConfig.gettext_dir)
|
2014-09-08 09:40:34 -05:00
|
|
|
|
2019-06-07 15:56:57 -05:00
|
|
|
|
|
|
|
def _set_libvirt_error_handler():
|
|
|
|
"""
|
|
|
|
Ignore libvirt error reporting, we just use exceptions
|
|
|
|
"""
|
|
|
|
import libvirt
|
|
|
|
|
|
|
|
def libvirt_callback(userdata, err):
|
|
|
|
ignore = userdata
|
|
|
|
ignore = err
|
|
|
|
ctx = None
|
|
|
|
libvirt.registerErrorHandler(libvirt_callback, ctx)
|
|
|
|
|
|
|
|
|
2014-09-08 09:40:34 -05:00
|
|
|
_setup_i18n()
|
2019-06-07 15:56:57 -05:00
|
|
|
_set_libvirt_error_handler()
|
|
|
|
|
2014-09-08 09:40:34 -05:00
|
|
|
|
2019-06-07 17:21:24 -05:00
|
|
|
from virtinst import xmlutil
|
2015-09-06 09:36:17 -05:00
|
|
|
from virtinst.uri import URI
|
2015-04-04 11:04:11 -05:00
|
|
|
from virtinst.osdict import OSDB
|
2013-03-17 16:06:52 -05:00
|
|
|
|
2018-03-20 14:10:04 -05:00
|
|
|
from virtinst.domain import * # pylint: disable=wildcard-import
|
2013-08-08 20:42:44 -05:00
|
|
|
|
2015-04-03 11:40:16 -05:00
|
|
|
from virtinst.capabilities import Capabilities
|
2014-09-17 13:56:52 -05:00
|
|
|
from virtinst.domcapabilities import DomainCapabilities
|
2013-09-20 19:40:07 -05:00
|
|
|
from virtinst.network import Network
|
2013-09-22 17:13:24 -05:00
|
|
|
from virtinst.nodedev import NodeDevice
|
2013-09-20 19:40:07 -05:00
|
|
|
from virtinst.storage import StoragePool, StorageVolume
|
2013-08-08 20:42:44 -05:00
|
|
|
|
2018-03-20 11:27:37 -05:00
|
|
|
from virtinst.devices import * # pylint: disable=wildcard-import
|
2013-08-08 20:42:44 -05:00
|
|
|
|
2019-06-16 20:34:47 -05:00
|
|
|
from virtinst.install.installer import Installer
|
2013-08-08 19:47:17 -05:00
|
|
|
|
2019-02-07 16:36:10 -06:00
|
|
|
from virtinst.guest import Guest
|
2013-08-08 20:42:44 -05:00
|
|
|
from virtinst.cloner import Cloner
|
2013-08-05 16:20:35 -05:00
|
|
|
from virtinst.snapshot import DomainSnapshot
|
2013-08-08 19:47:17 -05:00
|
|
|
|
2018-03-20 11:18:35 -05:00
|
|
|
from virtinst.connection import VirtinstConnection
|
2019-06-16 20:12:39 -05:00
|
|
|
|
2019-12-11 16:34:03 -06:00
|
|
|
from virtinst.logger import log, reset_logging
|