From: Michael Tremer Date: Mon, 6 Dec 2021 18:03:00 +0000 (+0000) Subject: backend: Move main class into __init__.py X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=663b23c309be1187ad3fea3f42cb8efbe8a02d42;p=people%2Fms%2Fwestferry.git backend: Move main class into __init__.py Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 2f4983b..5d2d4d3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -102,7 +102,6 @@ westferry_backend_PYTHON = \ src/westferry/backend/__version__.py \ src/westferry/backend/base.py \ src/westferry/backend/graphs.py \ - src/westferry/backend/main.py \ src/westferry/backend/system.py westferry_backenddir = $(pythondir)/westferry/backend diff --git a/src/westferry/backend/__init__.py b/src/westferry/backend/__init__.py index cad0eb3..3e99836 100644 --- a/src/westferry/backend/__init__.py +++ b/src/westferry/backend/__init__.py @@ -19,4 +19,16 @@ # # ############################################################################### -from .main import Backend +from .__version__ import VERSION + +from . import graphs +from . import system + +class Backend(object): + version = VERSION + + def __init__(self, debug=False): + self.debug = True + + self.graphs = graphs.GraphsBackend(self) + self.system = system.SystemBackend(self) diff --git a/src/westferry/backend/main.py b/src/westferry/backend/main.py deleted file mode 100644 index fa05a13..0000000 --- a/src/westferry/backend/main.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/python3 -############################################################################### -# # -# Westferry - The IPFire web user interface # -# Copyright (C) 2015 IPFire development team # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with this program. If not, see . # -# # -############################################################################### - -from .__version__ import VERSION - -from . import graphs -from . import system - -class Backend(object): - version = VERSION - - def __init__(self): - self.graphs = graphs.GraphsBackend(self) - self.system = system.SystemBackend(self)