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