From 3d2692656a077977f2960c76eff2acd93cfbc3a2 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 4 Jun 2023 13:19:48 +0200 Subject: [PATCH] directory re-organization: lib as osmocom.lpmgd module --- lib/osmo-lpmgd.py => osmo-lpmgd.py | 8 ++++---- {lib => osmocom/lpmgd}/avail_always.py | 2 +- {lib => osmocom/lpmgd}/avail_ping.py | 2 +- {lib => osmocom/lpmgd}/model.py | 0 {lib => osmocom/lpmgd}/rest_server.py | 2 +- {lib => osmocom/lpmgd}/switcher_dummy.py | 2 +- {lib => osmocom/lpmgd}/switcher_intellinet.py | 2 +- {lib => osmocom/lpmgd}/switcher_sispm.py | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) rename lib/osmo-lpmgd.py => osmo-lpmgd.py (86%) rename {lib => osmocom/lpmgd}/avail_always.py (80%) rename {lib => osmocom/lpmgd}/avail_ping.py (88%) rename {lib => osmocom/lpmgd}/model.py (100%) rename {lib => osmocom/lpmgd}/rest_server.py (98%) rename {lib => osmocom/lpmgd}/switcher_dummy.py (89%) rename {lib => osmocom/lpmgd}/switcher_intellinet.py (98%) rename {lib => osmocom/lpmgd}/switcher_sispm.py (98%) diff --git a/lib/osmo-lpmgd.py b/osmo-lpmgd.py similarity index 86% rename from lib/osmo-lpmgd.py rename to osmo-lpmgd.py index f48dcf7..95f7343 100755 --- a/lib/osmo-lpmgd.py +++ b/osmo-lpmgd.py @@ -22,10 +22,10 @@ import argparse from klein import Klein -from model import Resource, SwitcherGroup -from rest_server import PwrMgmtRestServer -from switcher_dummy import DummySwitcher -from avail_always import AlwaysAvailChecker +from osmocom.lpmgd.model import Resource, SwitcherGroup +from osmocom.lpmgd.rest_server import PwrMgmtRestServer +from osmocom.lpmgd.switcher_dummy import DummySwitcher +from osmocom.lpmgd.avail_always import AlwaysAvailChecker def main(argv): diff --git a/lib/avail_always.py b/osmocom/lpmgd/avail_always.py similarity index 80% rename from lib/avail_always.py rename to osmocom/lpmgd/avail_always.py index 91d2621..5f71964 100644 --- a/lib/avail_always.py +++ b/osmocom/lpmgd/avail_always.py @@ -1,6 +1,6 @@ import icmplib -from model import AvailabilityChecker +from osmocom.lpmgd.model import AvailabilityChecker class AlwaysAvailChecker(AvailabilityChecker): """A dummy AvailabilityChecker implementation of a resource that's always available.""" diff --git a/lib/avail_ping.py b/osmocom/lpmgd/avail_ping.py similarity index 88% rename from lib/avail_ping.py rename to osmocom/lpmgd/avail_ping.py index 0d93c42..4626ce6 100644 --- a/lib/avail_ping.py +++ b/osmocom/lpmgd/avail_ping.py @@ -1,6 +1,6 @@ import icmplib -from model import AvailabilityChecker +from osmocom.lpmgd.model import AvailabilityChecker class IcmpAvailChecker(AvailabilityChecker): diff --git a/lib/model.py b/osmocom/lpmgd/model.py similarity index 100% rename from lib/model.py rename to osmocom/lpmgd/model.py diff --git a/lib/rest_server.py b/osmocom/lpmgd/rest_server.py similarity index 98% rename from lib/rest_server.py rename to osmocom/lpmgd/rest_server.py index abc8996..8b0c867 100644 --- a/lib/rest_server.py +++ b/osmocom/lpmgd/rest_server.py @@ -18,7 +18,7 @@ import json from typing import List from klein import Klein -import model +import osmocom.lpmgd.model as model def set_headers(request): request.setHeader('Content-Type', 'application/json') diff --git a/lib/switcher_dummy.py b/osmocom/lpmgd/switcher_dummy.py similarity index 89% rename from lib/switcher_dummy.py rename to osmocom/lpmgd/switcher_dummy.py index 874689d..aa54634 100644 --- a/lib/switcher_dummy.py +++ b/osmocom/lpmgd/switcher_dummy.py @@ -1,5 +1,5 @@ -from model import Switcher, SwitcherGroup +from osmocom.lpmgd.model import Switcher, SwitcherGroup class DummySwitcher(Switcher): def __init__(self, group: SwitcherGroup, name: str, conf): diff --git a/lib/switcher_intellinet.py b/osmocom/lpmgd/switcher_intellinet.py similarity index 98% rename from lib/switcher_intellinet.py rename to osmocom/lpmgd/switcher_intellinet.py index 1c81a11..ffb69f5 100644 --- a/lib/switcher_intellinet.py +++ b/osmocom/lpmgd/switcher_intellinet.py @@ -24,7 +24,7 @@ import logging import urllib.request import xml.etree.ElementTree as ET -from model import Switcher +from osmocom.lpmgd.model import Switcher logger = logging.getLogger(__name__) diff --git a/lib/switcher_sispm.py b/osmocom/lpmgd/switcher_sispm.py similarity index 98% rename from lib/switcher_sispm.py rename to osmocom/lpmgd/switcher_sispm.py index 9fc76f2..a4d4041 100644 --- a/lib/switcher_sispm.py +++ b/osmocom/lpmgd/switcher_sispm.py @@ -23,7 +23,7 @@ import logging import pysispm -from model import Switcher, SwitcherGroup +from osmocom.lpmgd.model import Switcher, SwitcherGroup logger = logging.getLogger(__name__)