31 lines
620 B
Python
Executable File
31 lines
620 B
Python
Executable File
#!/usr/bin/env python3
|
|
import sys
|
|
sys.path.append('/home/l_samenv/frappy')
|
|
import time
|
|
from frappy.lib import generalConfig
|
|
from frappy.logging import logger
|
|
from frappy.server import Server
|
|
from frappy.client.interactive import init, interact
|
|
from utils import BoxInfo
|
|
|
|
box = BoxInfo()
|
|
|
|
def main(cfg, port=None, **_):
|
|
generalConfig.init()
|
|
logger.init('info')
|
|
srv = Server(cfg, logger.log, cfgfiles=None, interface=port)
|
|
srv.run()
|
|
|
|
def cli(cfg, port, **_):
|
|
init(f'localhost:{port}')
|
|
interact()
|
|
|
|
cfg = box.read_config('FRAPPY')
|
|
|
|
if sys.argv[1:2] == ['cli']:
|
|
cli(**cfg)
|
|
else:
|
|
main(**cfg)
|
|
|
|
|