From a36df58081abcfa4a0626e0650b3cd97cc6c3d29 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Tue, 29 Apr 2025 11:37:31 +0200 Subject: [PATCH] move seaweb from init to sewebman.py --- __init__.py | 23 ++++++----------------- sewebman.py | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 sewebman.py diff --git a/__init__.py b/__init__.py index d5e7461..ea1e857 100644 --- a/__init__.py +++ b/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # ***************************************************************************** # # This program is free software; you can redistribute it and/or modify it under @@ -27,30 +26,21 @@ this code is currently used: - from a script allowing to start/stop/list (and more) multiple frappy and nicos servers """ +import sys from servicemanager.base import ServiceManager, ServiceDown, UsageError, get_config from servicemanager.nicosman import NicosManager from servicemanager.seaman import SeaManager from servicemanager.frappyman import FrappyManager, Reconnect, Keep +from servicemanager.sewebman import SewebManager +#from servicemanager.racks import RackConfig -class SewebManager(ServiceManager): - group = 'seweb' - services = ('',) - USAGE = """ - Usage: - - seaweb list [instance] - seaweb start - seaweb restart - seaweb stop - - %s - """ - +#rack = RackConfig() all = NicosManager, FrappyManager, SeaManager, SewebManager KINDS = 'action', 'ins', 'service' + def run(group, arglist): try: parser = get_config() @@ -104,5 +94,4 @@ def run(group, arglist): except UsageError as e: serv.do_help() print('ERROR:', str(e)) - - + sys.exit(1) diff --git a/sewebman.py b/sewebman.py new file mode 100644 index 0000000..834dd27 --- /dev/null +++ b/sewebman.py @@ -0,0 +1,38 @@ +# ***************************************************************************** +# +# 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 2 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, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Module authors: +# Markus Zolliker +# +# ***************************************************************************** + +from servicemanager.base import ServiceManager + + +class SewebManager(ServiceManager): + group = 'seweb' + services = ('seweb',) + USAGE = """ + Usage: + + seweb start + seweb restart + seweb stop + seweb list [] + + %s + """ +