Blame libnmstate/__init__.py

Packit b9ca78
#
Packit b9ca78
# Copyright (c) 2018-2020 Red Hat, Inc.
Packit b9ca78
#
Packit b9ca78
# This file is part of nmstate
Packit b9ca78
#
Packit b9ca78
# This program is free software: you can redistribute it and/or modify
Packit b9ca78
# it under the terms of the GNU Lesser General Public License as published by
Packit b9ca78
# the Free Software Foundation, either version 2.1 of the License, or
Packit b9ca78
# (at your option) any later version.
Packit b9ca78
#
Packit b9ca78
# This program is distributed in the hope that it will be useful,
Packit b9ca78
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit b9ca78
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit b9ca78
# GNU Lesser General Public License for more details.
Packit b9ca78
#
Packit b9ca78
# You should have received a copy of the GNU Lesser General Public License
Packit b9ca78
# along with this program. If not, see <https://www.gnu.org/licenses/>.
Packit b9ca78
#
Packit b9ca78
Packit b9ca78
import os
Packit b9ca78
Packit b9ca78
from . import error
Packit b9ca78
from . import schema
Packit b9ca78
Packit b9ca78
from .netapplier import apply
Packit b9ca78
from .netapplier import commit
Packit b9ca78
from .netapplier import rollback
Packit b9ca78
from .netinfo import show
Packit b9ca78
Packit b9ca78
from .prettystate import PrettyState
Packit b9ca78
Packit b9ca78
Packit b9ca78
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
Packit b9ca78
Packit b9ca78
__all__ = [
Packit b9ca78
    "show",
Packit b9ca78
    "apply",
Packit b9ca78
    "commit",
Packit b9ca78
    "rollback",
Packit b9ca78
    "error",
Packit b9ca78
    "schema",
Packit b9ca78
    "PrettyState",
Packit b9ca78
]
Packit b9ca78
Packit b9ca78
Packit b9ca78
def _get_version():
Packit b9ca78
    with open(os.path.join(ROOT_DIR, "VERSION")) as f:
Packit b9ca78
        version = f.read().strip()
Packit b9ca78
    return version
Packit b9ca78
Packit b9ca78
Packit b9ca78
__version__ = _get_version()