From ec52f6f8586ff3114e1e4301dd8e61971be7fbdb Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Tue, 29 Apr 2025 11:16:42 +0200 Subject: [PATCH] add getsestuff related stuff --- cfg/hrpt_servicemanager.cfg | 7 +++++++ cfg/servicemanager.cfg | 29 +++++++++++++++++++++++++++++ cfg/zebra_servicemanager.cfg | 7 +++++++ getsestuff | 23 +++++++++++++++++++---- 4 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 cfg/hrpt_servicemanager.cfg create mode 100644 cfg/servicemanager.cfg create mode 100644 cfg/zebra_servicemanager.cfg diff --git a/cfg/hrpt_servicemanager.cfg b/cfg/hrpt_servicemanager.cfg new file mode 100644 index 0000000..5d85025 --- /dev/null +++ b/cfg/hrpt_servicemanager.cfg @@ -0,0 +1,7 @@ + +[hrpt2] +SEA_SEA_PORT = 8642 +SEA_GRAPH_PORT = 8742 +sea_command = ./SeaServer %(serv)s_%(ins)s.tcl +sea = 2 + diff --git a/cfg/servicemanager.cfg b/cfg/servicemanager.cfg new file mode 100644 index 0000000..f53be36 --- /dev/null +++ b/cfg/servicemanager.cfg @@ -0,0 +1,29 @@ +[DEFAULT] +VENV = /home/nicos/nicos/nicosenv/bin/ +FRAPPY_MAIN_PORT = 151nr +FRAPPY_STICK_PORT = 152nr +FRAPPY_ADDONS_PORT = 153nr +FRAPPY_ROOT = ~/frappy +#FRAPPY_HISTORY = ~/frappy/history/ +FRAPPY_CONFDIR = ~/frappy/cfg/:~/frappy/cfg/develop +FRAPPY_LOGDIR = ~/frappylog +FRAPPY_PIDDIR = ~/frappylog/pid +FRAPPY_SEA_DIR = ~/frappy/cfg/sea +FRAPPY_CALIB_PATH = ~/calcurves +frappy_command = bin/frappy-server %(ins)s_%(serv)s -p=%(port)s -c=%(cfg)s + +SEA_SEA_PORT = 8641 +SEA_GRAPH_PORT = 8741 +SEA_ROOT = ~/sea +sea_command = ./SeaServer %(serv)s.tcl + +SEWEB_ROOT = ~/seweb +SEWEB_PORT = 8941 +SEWEB_HISTORY = ~/seweb/history +seweb_command = python3 seweb.py frappy ins=%(ins)s port=%(port)s + +PYTHONPATH = ~ + +[MAIN] +frappy = 1 +sea = 1 diff --git a/cfg/zebra_servicemanager.cfg b/cfg/zebra_servicemanager.cfg new file mode 100644 index 0000000..f5306ab --- /dev/null +++ b/cfg/zebra_servicemanager.cfg @@ -0,0 +1,7 @@ + +[zebra2] +SEA_SEA_PORT = 8642 +SEA_GRAPH_PORT = 8742 +sea_command = ./SeaServer %(serv)s_%(ins)s.tcl +sea = 2 + diff --git a/getsestuff b/getsestuff index 608dd5c..2c62f20 100755 --- a/getsestuff +++ b/getsestuff @@ -12,8 +12,8 @@ from socket import gethostname instruments = ['amor', 'camea', 'dmc', 'eiger', 'focus', 'hrpt', 'morpheus', 'sans', 'tasp', 'zebra'] # boa -stuffsrc = realpath(join(sys.modules['__main__'].__file__, '..', '..', 'lib', 'servicemanager')) -# this should be equivalent to /afs/psi.ch/project/sinq/common/lib/servicemanager/ +stuffsrc = '/afs/psi.ch/project/sinq/common/lib/servicemanager/' + doit = True # False: check only sim = False # True: show what to do action = '' @@ -23,6 +23,21 @@ home = expanduser('~') hostname = gethostname().split('.')[0] remote = hostname not in instruments +if home.endswith('zolliker'): + chdir(expanduser('~/servicemanager/')) + cfg_fil = '/afs/psi.ch/project/sinq/common/stow/markus/lib/servicemanager/', glob('cfg/*.cfg') + bin_dst = '/afs/psi.ch/project/sinq/common/stow/markus/bin/', ['getsestuff'] + diff = False + for dstdir, files in cfg_fil, bin_dst: + for src in files: + diff = os.system(f'diff {src} {dstdir}') + if diff and os.system(f'cp {src} {dstdir}'): + print('can not copy', src, 'to', dstdir) + if diff: + print('updated getsestuff, please do again') + sys.exit(0) + + if remote: instrument = '' nicosroot = '' @@ -125,9 +140,9 @@ def check_repo(root, repo, url=None, branch=None): pull = False if (doit or sim) and not created: todo.add(action) - short = reponame.rpartition('/')[2] + short = repo.rpartition('/')[2] if exists(repo): - chdir(join(root, repo)) + chdir(repo) gitconfig = {} for line in doget('git config --list'): key, _, value = line.partition('=')