fix export & add emojis (#1004)

This commit is contained in:
Andreas Köpf
2023-01-29 23:28:47 +01:00
committed by GitHub
parent 29b540a1d8
commit eda275bef1
2 changed files with 31 additions and 23 deletions
+15 -6
View File
@@ -318,34 +318,43 @@ def main():
parser.add_argument(
"--print-openapi-schema",
default=False,
help="Dumps the openapi schema to stdout",
action=argparse.BooleanOptionalAction,
action="store_true",
)
parser.add_argument("--host", help="The host to run the server", default="0.0.0.0")
parser.add_argument("--port", help="The port to run the server", default=8080)
parser.add_argument(
"--export", help="Export all trees which are ready for exporting.", action=argparse.BooleanOptionalAction
"--export",
default=False,
help="Export all trees which are ready for exporting.",
action="store_true",
)
parser.add_argument(
"--export-file",
type=str,
help="Name of file to export trees to. If not provided when exporting, output will be send to STDOUT",
)
parser.add_argument(
"--retry-scoring",
default=False,
help="Retry scoring failed message trees",
action=argparse.BooleanOptionalAction,
action="store_true",
)
args = parser.parse_args()
if args.print_openapi_schema:
print(get_openapi_schema())
elif args.export:
if args.export:
use_compression: bool = ".gz" in args.export_file
export_ready_trees(file=args.export_file, use_compression=use_compression)
elif args.retry_scoring:
if args.retry_scoring:
retry_scoring_failed_message_trees()
else:
if not (args.export or args.print_openapi_schema or args.retry_scoring):
uvicorn.run(app, host=args.host, port=args.port)