1
0
Fork 0
mirror of https://github.com/ldericher/fftcgtool synced 2025-01-15 15:02:59 +00:00
fftcgtool/main.py
2021-08-04 18:36:23 +02:00

46 lines
984 B
Python
Executable file

#!/usr/bin/env python3
import argparse
import logging
import os
from fftcg.opus import Opus
from fftcg.book import Book
def main():
# Setup CLI
parser = argparse.ArgumentParser(
description='Imports FFTCG cards for TT-Sim.')
parser.add_argument(
'opusid',
default="2",
metavar="OpusID",
nargs="?",
help='the Opus to import')
parser.add_argument(
'-n', '--num_threads',
type=int,
default=20,
metavar="COUNT",
help='maximum number of concurrent requests')
args = parser.parse_args()
# Setup logging
logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(threadName)s %(message)s')
opus = Opus(args.opusid)
# output directory
if not os.path.exists("out"):
os.mkdir("out")
os.chdir("out")
book = Book(opus, (7, 10), (429, 600), "eg", 16)
book.save(f"opus_{args.opusid}_{{}}.jpg")
if __name__ == '__main__':
main()