move seaweb from init to sewebman.py

This commit is contained in:
2025-04-29 11:37:31 +02:00
parent 18c693d800
commit a36df58081
2 changed files with 44 additions and 17 deletions

View File

@ -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 <instance>
seaweb restart <instance>
seaweb stop <instance>
%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)

38
sewebman.py Normal file
View File

@ -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 <markus.zolliker@psi.ch>
#
# *****************************************************************************
from servicemanager.base import ServiceManager
class SewebManager(ServiceManager):
group = 'seweb'
services = ('seweb',)
USAGE = """
Usage:
seweb start <instance>
seweb restart <instance>
seweb stop <instance>
seweb list [<instance>]
%s
"""