install: updates to support building deb/rpm packages that contain python wheels and install core from a single file, updates to core to install scripts by way of python directly

This commit is contained in:
Blake Harnden 2022-07-27 16:00:10 -07:00
parent cd6bb319ad
commit fcf6f30302
54 changed files with 528 additions and 187 deletions

View file

@ -1,50 +0,0 @@
#!/usr/bin/env python3
import argparse
import logging
import sys
from pathlib import Path
from core.player import CorePlayer
logger = logging.getLogger(__name__)
def path_type(value: str) -> Path:
file_path = Path(value)
if not file_path.is_file():
raise argparse.ArgumentTypeError(f"file does not exist: {value}")
return file_path
def parse_args() -> argparse.Namespace:
"""
Setup and parse command line arguments.
:return: parsed arguments
"""
parser = argparse.ArgumentParser(
description="core player runs files that can move nodes and send commands",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument(
"-f", "--file", required=True, type=path_type, help="core file to play"
)
parser.add_argument(
"-s", "--session", type=int, help="session to play to, first found session otherwise"
)
return parser.parse_args()
def main() -> None:
logging.basicConfig(level=logging.INFO)
args = parse_args()
player = CorePlayer(args.file)
result = player.init(args.session)
if not result:
sys.exit(1)
player.start()
if __name__ == "__main__":
main()