this is a not-so-easy problem of timing change includes a 'start_frappy' script, which gets port and cfg from the box config file. so install does no longer need to be executed when cfg or port is changed
19 lines
427 B
Python
Executable File
19 lines
427 B
Python
Executable File
#!/usr/bin/env python
|
|
import os
|
|
import time
|
|
from pathlib import Path
|
|
from utils import BoxInfo
|
|
|
|
box = BoxInfo()
|
|
|
|
def start_frappy(cfg, port=None):
|
|
# os.chdir(Path('~/frappy').expanduser())
|
|
if port is None:
|
|
portarg = ''
|
|
else:
|
|
portarg = f'-p {port} '
|
|
os.system(f"{str(Path('~').expanduser() / 'frappy/bin/frappy-server')} {portarg}{cfg}")
|
|
|
|
time.sleep(10)
|
|
start_frappy(**box.read_config('FRAPPY'))
|