mirror of
https://github.com/ldericher/fftcgtool
synced 2025-01-15 15:02:59 +00:00
multi deck import
This commit is contained in:
parent
0f6c7be504
commit
3cf2994297
1 changed files with 10 additions and 5 deletions
15
main.py
15
main.py
|
@ -29,13 +29,17 @@ def opus_decks(args: argparse.Namespace) -> list[fftcg.TTSDeck]:
|
||||||
return decks
|
return decks
|
||||||
|
|
||||||
|
|
||||||
def ffdecks_deck(args: argparse.Namespace) -> list[fftcg.TTSDeck]:
|
def ffdecks_decks(args: argparse.Namespace) -> list[fftcg.TTSDeck]:
|
||||||
# load the current carddb
|
# load the current carddb
|
||||||
carddb = fftcg.CardDB.get()
|
carddb = fftcg.CardDB.get()
|
||||||
carddb.load()
|
carddb.load()
|
||||||
|
|
||||||
|
decks: list[fftcg.TTSDeck] = []
|
||||||
|
for deck_id in args.deck_ids:
|
||||||
|
decks.append(fftcg.TTSDeck.from_ffdecks_deck(deck_id))
|
||||||
|
|
||||||
# import a deck
|
# import a deck
|
||||||
return [fftcg.TTSDeck.from_ffdecks_deck(args.deck_id)]
|
return decks
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
|
@ -101,14 +105,15 @@ def main() -> None:
|
||||||
)
|
)
|
||||||
|
|
||||||
deck_parser.set_defaults(
|
deck_parser.set_defaults(
|
||||||
func=ffdecks_deck
|
func=ffdecks_decks
|
||||||
)
|
)
|
||||||
|
|
||||||
deck_parser.add_argument(
|
deck_parser.add_argument(
|
||||||
"deck_id",
|
"deck_ids",
|
||||||
type=str,
|
type=str,
|
||||||
|
nargs="+",
|
||||||
metavar="Deck_ID",
|
metavar="Deck_ID",
|
||||||
help="the Deck to import",
|
help="the Decks to import",
|
||||||
)
|
)
|
||||||
|
|
||||||
# parse arguments
|
# parse arguments
|
||||||
|
|
Loading…
Reference in a new issue