Skip to content

Commit 179f612

Browse files
committed
Make it possible to import classes from subpackages directly
1 parent d8b4b22 commit 179f612

File tree

6 files changed

+84
-25
lines changed

6 files changed

+84
-25
lines changed

mal_gui/assets_container/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from .assets_container_rectangle_box import AssetsContainerRectangleBox
2+
from .assets_container import AssetsContainer
3+
4+
__all__ = [
5+
"AssetsContainerRectangleBox",
6+
"AssetsContainer"
7+
]

mal_gui/docked_windows/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from .asset_relations_window import AssetRelationsWindow
2+
from .attack_steps_window import AttackStepsWindow
3+
from .draggable_tree_view import DraggableTreeView
4+
from .item_details_window import ItemDetailsWindow
5+
from .properties_window import PropertiesWindow, EditableDelegate
6+
from .style_configuration import CustomDialog, CustomDialogGlobal, Visibility
7+
8+
__all__ = [
9+
"AssetRelationsWindow",
10+
"AttackStepsWindow",
11+
"DraggableTreeView",
12+
"ItemDetailsWindow",
13+
"PropertiesWindow",
14+
"EditableDelegate",
15+
"CustomDialog",
16+
"CustomDialogGlobal",
17+
"Visibility"
18+
]

mal_gui/main_window.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@
2626
from maltoolbox.language import LanguageGraph, LanguageClassesFactory
2727
from maltoolbox.model import Model
2828

29+
from .file_utils import image_path
2930
from .model_scene import ModelScene
3031
from .model_view import ModelView
31-
from .object_explorer.asset_base import AssetBase
32-
from .object_explorer.asset_factory import AssetFactory
32+
from .object_explorer import AssetBase, AssetFactory
3333
from .assets_container.assets_container import AssetsContainer
3434
from .connection_item import AssociationConnectionItem
35-
36-
from .docked_windows.draggable_tree_view import DraggableTreeView
37-
from .docked_windows.item_details_window import ItemDetailsWindow
38-
from .docked_windows.properties_window import PropertiesWindow,EditableDelegate
39-
from .docked_windows.attack_steps_window import AttackStepsWindow
40-
from .docked_windows.asset_relations_window import AssetRelationsWindow
41-
42-
from .file_utils import image_path
35+
from .docked_windows import (
36+
DraggableTreeView,
37+
ItemDetailsWindow,
38+
PropertiesWindow,
39+
EditableDelegate,
40+
AttackStepsWindow,
41+
AssetRelationsWindow
42+
)
4343

4444
# Used to create absolute paths of assets
4545
PACKAGE_DIR = Path(__file__).resolve().parent

mal_gui/model_scene.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@
1919

2020
from .connection_item import AssociationConnectionItem,EntrypointConnectionItem
2121
from .connection_dialog import AssociationConnectionDialog,EntrypointConnectionDialog
22-
from .object_explorer.asset_base import AssetBase
23-
from .object_explorer.editable_text_item import EditableTextItem
24-
from .assets_container.assets_container import AssetsContainer
25-
from .assets_container.assets_container_rectangle_box import AssetsContainerRectangleBox
26-
27-
from .undo_redo_commands.cut_command import CutCommand
28-
from .undo_redo_commands.copy_command import CopyCommand
29-
from .undo_redo_commands.paste_command import PasteCommand
30-
from .undo_redo_commands.delete_command import DeleteCommand
31-
from .undo_redo_commands.move_command import MoveCommand
32-
from .undo_redo_commands.drag_drop_command import DragDropCommand
33-
from .undo_redo_commands.create_association_connection_command import CreateAssociationConnectionCommand
34-
from .undo_redo_commands.create_entrypoint_connection_command import CreateEntrypointConnectionCommand
35-
from .undo_redo_commands.delete_connection_command import DeleteConnectionCommand
36-
from .undo_redo_commands.containerize_assets_command import ContainerizeAssetsCommand
22+
from .object_explorer import AssetBase, EditableTextItem
23+
from .assets_container import AssetsContainer, AssetsContainerRectangleBox
24+
25+
from .undo_redo_commands import (
26+
CutCommand,
27+
CopyCommand,
28+
PasteCommand,
29+
DeleteCommand,
30+
MoveCommand,
31+
DragDropCommand,
32+
CreateAssociationConnectionCommand,
33+
CreateEntrypointConnectionCommand,
34+
DeleteConnectionCommand,
35+
ContainerizeAssetsCommand
36+
)
3737

3838
if TYPE_CHECKING:
3939
from .main_window import MainWindow

mal_gui/object_explorer/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from .asset_base import AssetBase
2+
from .asset_factory import AssetFactory
3+
from .editable_text_item import EditableTextItem
4+
5+
__all__ = [
6+
"AssetBase",
7+
"AssetFactory",
8+
"EditableTextItem"
9+
]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from .containerize_assets_command import ContainerizeAssetsCommand
2+
from .copy_command import CopyCommand
3+
from .create_association_connection_command import \
4+
CreateAssociationConnectionCommand
5+
from .create_entrypoint_connection_command import \
6+
CreateEntrypointConnectionCommand
7+
from .cut_command import CutCommand
8+
from .delete_command import DeleteCommand
9+
from .delete_connection_command import DeleteConnectionCommand
10+
from .drag_drop_command import DragDropCommand
11+
from .move_command import MoveCommand
12+
from .paste_command import PasteCommand
13+
14+
__all__ = [
15+
"ContainerizeAssetsCommand",
16+
"CopyCommand",
17+
"CreateAssociationConnectionCommand",
18+
"CreateEntrypointConnectionCommand",
19+
"CutCommand",
20+
"DeleteCommand",
21+
"DeleteConnectionCommand",
22+
"DragDropCommand",
23+
"MoveCommand",
24+
"PasteCommand"
25+
]

0 commit comments

Comments
 (0)