restrict printing of help more

+ remove some disabled code
This commit is contained in:
2025-05-08 09:56:29 +02:00
parent 5685b01ec7
commit 512c3ae80f

View File

@ -152,19 +152,6 @@ def check_repo(root, repo, url=None, branch=None):
print(gitconfig.get('remote.origin.url'), 'does not match', url) print(gitconfig.get('remote.origin.url'), 'does not match', url)
print(f'{join(root, repo)} exists already') print(f'{join(root, repo)} exists already')
return False return False
# if repo == 'sea':
# do('mkdir seagit')
# if sim:
# print('> cd seagit')
# else:
# chdir('seagit')
# do('git clone %s' % url)
# do(f'mv sea/.git ../sea/.git')
# if sim:
# print('> cd ..')
# else:
# chdir('..')
# do(f'rm -rf seagit')
else: else:
do('git clone %s' % url) do('git clone %s' % url)
pull = True pull = True
@ -519,11 +506,6 @@ def remove_line(file, content):
todo.add(action) todo.add(action)
print('remove above') print('remove above')
#def do_monit():
# """remove monit support for sea / graph"""
# remove_line('%s/monitconfig' % home, 'sea')
# remove_line('%s/monitconfig' % home, 'graph')
selected_instruments = None selected_instruments = None
action_arg = '' action_arg = ''
@ -572,6 +554,8 @@ for a in actions:
def print_help(): def print_help():
if not help:
return
if remote: if remote:
inst = "<instrument> " inst = "<instrument> "
else: else:
@ -603,10 +587,12 @@ if remote:
docmd(f'sshpass -e ssh {inst}@{inst} getsestuff {action_arg} nohelp') docmd(f'sshpass -e ssh {inst}@{inst} getsestuff {action_arg} nohelp')
sys.exit(0) sys.exit(0)
def su_action(action): def su_action(action):
os.environ['SSHPASS'] = scramble('P[d20+2:1eh') os.environ['SSHPASS'] = scramble('P[d20+2:1eh')
docmd(f'sshpass -e ssh nicos@localhost {sys.argv[0]} {action} nohelp') docmd(f'sshpass -e ssh nicos@localhost {sys.argv[0]} {action} nohelp')
if with_su: if with_su:
su_action(action_arg) su_action(action_arg)
sys.exit(0) sys.exit(0)
@ -635,7 +621,6 @@ if action_arg in ('', 'all', 'sim') and nc_actions:
print_help() print_help()
sys.exit(0) sys.exit(0)
if help:
print_help() print_help()
if sim or not action_arg and todo: if sim or not action_arg and todo:
print('needs updates: %s' % ' '.join(todo)) print('needs updates: %s' % ' '.join(todo))