From abeae7f3c84f8fa43478b5cd48c8c4c703ebf33b Mon Sep 17 00:00:00 2001 From: Lynn Date: Tue, 7 Feb 2023 23:56:17 +0100 Subject: [PATCH] Fixed imports --- pillow_layout/__init__.py | 5 +---- pillow_layout/box.py | 3 +-- pillow_layout/container.py | 2 +- pillow_layout/document.py | 5 ++--- pillow_layout/flex.py | 3 +-- pillow_layout/image.py | 5 ++--- pillow_layout/internal/flexlayouter.py | 2 +- pillow_layout/internal/textlayouter.py | 2 +- pillow_layout/layout.py | 3 +-- pillow_layout/text.py | 4 ++-- 10 files changed, 13 insertions(+), 21 deletions(-) diff --git a/pillow_layout/__init__.py b/pillow_layout/__init__.py index c31dfc9..ccb6582 100644 --- a/pillow_layout/__init__.py +++ b/pillow_layout/__init__.py @@ -1,8 +1,5 @@ -from .enums import FlexDirection, FlexWrap, FlexJustify, FlexAlignItems, FlexAlignContent, TextAlign, \ - TextVerticalAlign, TextWrap, ImageMode, ImageAnchor, BoxTitleAnchor - from .layout import Layout - +from .enums import * from .document import Document from .box import Box from .container import Container diff --git a/pillow_layout/box.py b/pillow_layout/box.py index 7beb394..f4b72c1 100644 --- a/pillow_layout/box.py +++ b/pillow_layout/box.py @@ -1,7 +1,6 @@ -from . import Layout from PIL import ImageDraw -from .enums import BoxTitleAnchor +from . import Layout, BoxTitleAnchor class Box(Layout): diff --git a/pillow_layout/container.py b/pillow_layout/container.py index c66d591..17aa5e9 100644 --- a/pillow_layout/container.py +++ b/pillow_layout/container.py @@ -1,6 +1,6 @@ -from . import Layout from PIL import ImageDraw +from . import Layout from .internal.helpers import min_with_none, max_with_none diff --git a/pillow_layout/document.py b/pillow_layout/document.py index c60ef33..a2b9c0e 100644 --- a/pillow_layout/document.py +++ b/pillow_layout/document.py @@ -1,8 +1,7 @@ from PIL import Image, ImageFont -from layout.enums import ColorMode -from layout.internal.helpers import max_with_none, min_with_none -from layout.layout import Layout +from . import Layout, ColorMode +from .internal.helpers import max_with_none, min_with_none class Document(Layout): diff --git a/pillow_layout/flex.py b/pillow_layout/flex.py index 9a204e2..7c7b564 100644 --- a/pillow_layout/flex.py +++ b/pillow_layout/flex.py @@ -1,7 +1,6 @@ -from . import Layout +from . import Layout, FlexDirection, FlexWrap, FlexJustify, FlexAlignItems, FlexAlignContent from .internal.flexlayouter import FlexLayouter from .internal.helpers import min_with_none, max_with_none -from .enums import FlexDirection, FlexWrap, FlexJustify, FlexAlignItems, FlexAlignContent class Flex(Layout): diff --git a/pillow_layout/image.py b/pillow_layout/image.py index 651a8c0..08e1f29 100644 --- a/pillow_layout/image.py +++ b/pillow_layout/image.py @@ -1,8 +1,7 @@ from PIL import ImageDraw, Image as PilImage -from layout import Layout -from layout.enums import ImageMode, ImageAnchor -from layout.internal.helpers import max_with_none, min_with_none +from . import Layout, ImageMode, ImageAnchor +from .internal.helpers import max_with_none, min_with_none class Image(Layout): diff --git a/pillow_layout/internal/flexlayouter.py b/pillow_layout/internal/flexlayouter.py index 3062216..24a5ed4 100644 --- a/pillow_layout/internal/flexlayouter.py +++ b/pillow_layout/internal/flexlayouter.py @@ -1,4 +1,4 @@ -from ..enums import FlexDirection, FlexWrap, FlexJustify, FlexAlignItems, FlexAlignContent +from .. import FlexDirection, FlexWrap, FlexJustify, FlexAlignItems, FlexAlignContent from .helpers import min_with_none, max_with_none diff --git a/pillow_layout/internal/textlayouter.py b/pillow_layout/internal/textlayouter.py index 1df5531..ffdffd9 100644 --- a/pillow_layout/internal/textlayouter.py +++ b/pillow_layout/internal/textlayouter.py @@ -1,6 +1,6 @@ import unicodedata -from layout.enums import TextWrap, TextVerticalAlign, TextAlign +from .. import TextWrap, TextVerticalAlign, TextAlign class TextLayouter(): diff --git a/pillow_layout/layout.py b/pillow_layout/layout.py index 3f728d6..7ad7324 100644 --- a/pillow_layout/layout.py +++ b/pillow_layout/layout.py @@ -2,8 +2,7 @@ import math from PIL import Image, ImageDraw -import layout -from layout.internal.helpers import line_intersection +from .internal.helpers import line_intersection class Layout: diff --git a/pillow_layout/text.py b/pillow_layout/text.py index f318ffa..4d3b603 100644 --- a/pillow_layout/text.py +++ b/pillow_layout/text.py @@ -1,8 +1,8 @@ from PIL import ImageDraw, ImageFont -from . import Layout + +from . import Layout, TextAlign, TextVerticalAlign, TextWrap from .internal.textlayouter import TextLayouter from .internal.helpers import min_with_none, max_with_none, get_line_height -from .enums import TextAlign, TextVerticalAlign, TextWrap class Text(Layout):