46 lines
No EOL
1.2 KiB
Python
46 lines
No EOL
1.2 KiB
Python
from hugvey.client import Hugvey
|
|
import logging
|
|
import logging.handlers
|
|
import coloredlogs
|
|
import argparse
|
|
from urllib.parse import urlparse
|
|
from hugvey.tools import Toolbox
|
|
|
|
if __name__ == '__main__':
|
|
argParser = argparse.ArgumentParser(description='Start up a Hugvey pillow. Mic stream becomes available on TCP Socket, and starts listening + emitting events')
|
|
argParser.add_argument(
|
|
'--config',
|
|
'-c',
|
|
required=True,
|
|
type=str,
|
|
help='The yaml config file to load'
|
|
)
|
|
argParser.add_argument(
|
|
'--files',
|
|
action='store_true',
|
|
help="Add/remove new & unused file"
|
|
)
|
|
|
|
argParser.add_argument(
|
|
'--story',
|
|
default=None,
|
|
help="Find/restore issues with the story file",
|
|
metavar="LANG_CODE"
|
|
)
|
|
|
|
args = argParser.parse_args()
|
|
|
|
coloredlogs.install(
|
|
level=logging.DEBUG
|
|
)
|
|
|
|
logger = logging.getLogger("toolbox")
|
|
# logger.setLevel(1) # to send all records to cutelog
|
|
|
|
|
|
tools = Toolbox(args.config)
|
|
if args.files:
|
|
logger.info("Filenames")
|
|
tools.clean_audio_files()
|
|
if args.story:
|
|
tools.fix_story_file(args.story) |