From 2cfa2d4b525582bb0bf4a060f8c7fb5807520bcb Mon Sep 17 00:00:00 2001 From: LDericher <40151420+ldericher@users.noreply.github.com> Date: Mon, 9 Aug 2021 07:01:25 +0200 Subject: [PATCH] PKG structure --- fftcg/__init__.py | 5 +++-- fftcg/book.py | 4 ++-- fftcg/cards.py | 2 +- fftcg/opus.py | 2 +- main.py | 6 +++--- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/fftcg/__init__.py b/fftcg/__init__.py index 9c9ce3d..96f71c1 100644 --- a/fftcg/__init__.py +++ b/fftcg/__init__.py @@ -1,3 +1,4 @@ -from book import Book -from opus import Opus +from .book import Book +from .opus import Opus +__all__ = ["Book", "Opus"] diff --git a/fftcg/book.py b/fftcg/book.py index 394d569..163e4d6 100644 --- a/fftcg/book.py +++ b/fftcg/book.py @@ -2,8 +2,8 @@ import logging from PIL import Image -from cards import Cards -from imageloader import ImageLoader +from .cards import Cards +from .imageloader import ImageLoader def chunks(whole: list[any], chunk_size) -> list: diff --git a/fftcg/cards.py b/fftcg/cards.py index da609ad..997c936 100644 --- a/fftcg/cards.py +++ b/fftcg/cards.py @@ -1,6 +1,6 @@ import requests -from card import Card +from .card import Card class Cards(list[Card]): diff --git a/fftcg/opus.py b/fftcg/opus.py index 3144d20..2c9aeda 100644 --- a/fftcg/opus.py +++ b/fftcg/opus.py @@ -2,7 +2,7 @@ import logging import roman -from cards import Cards +from .cards import Cards class Opus(Cards): diff --git a/main.py b/main.py index 6d0c743..bd95bd7 100755 --- a/main.py +++ b/main.py @@ -3,7 +3,7 @@ import argparse import logging import os -from fftcg import Book, Opus +import fftcg # constants GRID = 7, 10 # default in TTsim: 7 rows, 10 columns @@ -43,8 +43,8 @@ def main() -> None: os.chdir("out") # main program - opus = Opus(args.opus_id) - book = Book(opus, GRID, RESOLUTION, "eg", args.num_threads) + opus = fftcg.Opus(args.opus_id) + book = fftcg.Book(opus, GRID, RESOLUTION, "eg", args.num_threads) book.save(f"{opus.name}_{{}}.jpg") # bye