Skip to content

Commit

Permalink
Rename all packages and modules in mal_gui to abide to snake_case
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkickling committed Nov 20, 2024
1 parent 18d5999 commit d8b4b22
Show file tree
Hide file tree
Showing 32 changed files with 64 additions and 63 deletions.
2 changes: 1 addition & 1 deletion mal_gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
QFileDialog,
QMessageBox
)
from .MainWindow import MainWindow
from .main_window import MainWindow

class FileSelectionDialog(QDialog):
def __init__(self, parent=None):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
)
from PySide6.QtWidgets import QGraphicsItem

from ..ObjectExplorer.EditableTextItem import EditableTextItem
from .AssetsContainerRectangleBox import AssetsContainerRectangleBox
from ..object_explorer.editable_text_item import EditableTextItem
from .assets_container_rectangle_box import AssetsContainerRectangleBox

class AssetsContainer(QGraphicsItem):
# Starting Sequence Id with normal start at 100 (randomly taken)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from PySide6.QtWidgets import QWidget,QTableView,QVBoxLayout
from PySide6.QtGui import QStandardItemModel,QStandardItem

from .MainWindow import MainWindow
from .main_window import MainWindow
class AssociationDefinitions(QWidget):
def __init__(self, parent: MainWindow):
super().__init__(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
)

if TYPE_CHECKING:
from .ObjectExplorer.AssetBase import AssetBase
from .object_explorer.asset_base import AssetBase

class ConnectionDialog(QDialog):
def filter_items(self, text):
Expand Down
4 changes: 2 additions & 2 deletions mal_gui/ConnectionItem.py → mal_gui/connection_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
)

if TYPE_CHECKING:
from .ModelScene import ModelScene
from .ObjectExplorer.AssetBase import AssetBase
from .model_scene import ModelScene
from .object_explorer.asset_base import AssetBase

class IConnectionItem(QGraphicsLineItem):
"""'interface' for Connection Item"""
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
from PySide6.QtCore import QMimeData, QEvent
from PySide6.QtGui import QDrag, QIcon, QResizeEvent

from .StyleConfiguartion import (
from .style_configuration import (
Visibility,
CustomDialog,
CustomDialogGlobal,
)

if TYPE_CHECKING:
from ..ObjectExplorer.AssetBase import AssetBase
from ..object_explorer.asset_base import AssetBase

class DraggableTreeView(QTreeWidget):
def __init__(
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from PySide6.QtCore import Signal
from PySide6.QtGui import QColor

from ..ObjectExplorer.AssetBase import AssetBase
from ..object_explorer.asset_base import AssetBase

class Visibility(Enum):
HIDE = 1
Expand Down
24 changes: 12 additions & 12 deletions mal_gui/MainWindow.py → mal_gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@
from maltoolbox.language import LanguageGraph, LanguageClassesFactory
from maltoolbox.model import Model

from .ModelScene import ModelScene
from .ModelView import ModelView
from .ObjectExplorer.AssetBase import AssetBase
from .ObjectExplorer.AssetFactory import AssetFactory
from .AssetsContainer.AssetsContainer import AssetsContainer
from .ConnectionItem import AssociationConnectionItem

from .DockedWindows.DraggableTreeView import DraggableTreeView
from .DockedWindows.ItemDetailsWindow import ItemDetailsWindow
from .DockedWindows.PropertiesWindow import PropertiesWindow,EditableDelegate
from .DockedWindows.AttackStepsWindow import AttackStepsWindow
from .DockedWindows.AssetRelationsWindow import AssetRelationsWindow
from .model_scene import ModelScene
from .model_view import ModelView
from .object_explorer.asset_base import AssetBase
from .object_explorer.asset_factory import AssetFactory
from .assets_container.assets_container import AssetsContainer
from .connection_item import AssociationConnectionItem

from .docked_windows.draggable_tree_view import DraggableTreeView
from .docked_windows.item_details_window import ItemDetailsWindow
from .docked_windows.properties_window import PropertiesWindow,EditableDelegate
from .docked_windows.attack_steps_window import AttackStepsWindow
from .docked_windows.asset_relations_window import AssetRelationsWindow

from .file_utils import image_path

Expand Down
40 changes: 20 additions & 20 deletions mal_gui/ModelScene.py → mal_gui/model_scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@
from PySide6.QtGui import QTransform,QAction,QUndoStack,QPen
from PySide6.QtCore import QLineF, Qt, QPointF,QRectF

from .ConnectionItem import AssociationConnectionItem,EntrypointConnectionItem
from .ConnectionDialog import AssociationConnectionDialog,EntrypointConnectionDialog
from .ObjectExplorer.AssetBase import AssetBase
from .ObjectExplorer.EditableTextItem import EditableTextItem
from .AssetsContainer.AssetsContainer import AssetsContainer
from .AssetsContainer.AssetsContainerRectangleBox import AssetsContainerRectangleBox

from .UndoRedoCommands.CutCommand import CutCommand
from .UndoRedoCommands.CopyCommand import CopyCommand
from .UndoRedoCommands.PasteCommand import PasteCommand
from .UndoRedoCommands.DeleteCommand import DeleteCommand
from .UndoRedoCommands.MoveCommand import MoveCommand
from .UndoRedoCommands.DragDropCommand import DragDropCommand
from .UndoRedoCommands.CreateAssociationConnectionCommand import CreateAssociationConnectionCommand
from .UndoRedoCommands.CreateEntrypointConnectionCommand import CreateEntrypointConnectionCommand
from .UndoRedoCommands.DeleteConnectionCommand import DeleteConnectionCommand
from .UndoRedoCommands.ContainerizeAssetsCommand import ContainerizeAssetsCommand

from maltoolbox.model import Model, AttackerAttachment

from .connection_item import AssociationConnectionItem,EntrypointConnectionItem
from .connection_dialog import AssociationConnectionDialog,EntrypointConnectionDialog
from .object_explorer.asset_base import AssetBase
from .object_explorer.editable_text_item import EditableTextItem
from .assets_container.assets_container import AssetsContainer
from .assets_container.assets_container_rectangle_box import AssetsContainerRectangleBox

from .undo_redo_commands.cut_command import CutCommand
from .undo_redo_commands.copy_command import CopyCommand
from .undo_redo_commands.paste_command import PasteCommand
from .undo_redo_commands.delete_command import DeleteCommand
from .undo_redo_commands.move_command import MoveCommand
from .undo_redo_commands.drag_drop_command import DragDropCommand
from .undo_redo_commands.create_association_connection_command import CreateAssociationConnectionCommand
from .undo_redo_commands.create_entrypoint_connection_command import CreateEntrypointConnectionCommand
from .undo_redo_commands.delete_connection_command import DeleteConnectionCommand
from .undo_redo_commands.containerize_assets_command import ContainerizeAssetsCommand

if TYPE_CHECKING:
from .MainWindow import MainWindow
from .main_window import MainWindow
from maltoolbox.language import LanguageGraph
from .ConnectionItem import IConnectionItem
from .connection_item import IConnectionItem

class ModelScene(QGraphicsScene):
def __init__(
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
)
from PySide6.QtWidgets import QGraphicsItem

from .EditableTextItem import EditableTextItem
from .editable_text_item import EditableTextItem

if TYPE_CHECKING:
from ..ConnectionItem import IConnectionItem
from ..connection_item import IConnectionItem

class AssetBase(QGraphicsItem):
# Starting Sequence Id with normal start at 100 (randomly taken)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections import namedtuple
from .AssetBase import AssetBase
from .asset_base import AssetBase

class AssetFactory():
def __init__(self, parent=None):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from PySide6.QtGui import QUndoCommand
from PySide6.QtCore import QPointF, QTimer

from ..ObjectExplorer.AssetBase import AssetBase
from ..AssetsContainer.AssetsContainer import AssetsContainer
from ..object_explorer.asset_base import AssetBase
from ..assets_container.assets_container import AssetsContainer
from ..file_utils import image_path

if TYPE_CHECKING:
from ..ConnectionItem import IConnectionItem
from ..connection_item import IConnectionItem

class ContainerizeAssetsCommand(QUndoCommand):
def __init__(self, scene, items, parent=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from PySide6.QtGui import QUndoCommand

if TYPE_CHECKING:
from ..ModelScene import ModelScene
from ..ObjectExplorer.AssetBase import AssetBase
from ..model_scene import ModelScene
from ..object_explorer.asset_base import AssetBase

class CopyCommand(QUndoCommand):
def __init__(self, scene: ModelScene, items: list[AssetBase], clipboard, parent=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from PySide6.QtGui import QUndoCommand

if TYPE_CHECKING:
from ModelScene import ModelScene
from ..model_scene import ModelScene

class CreateAssociationConnectionCommand(QUndoCommand):
def __init__(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from PySide6.QtGui import QUndoCommand

if TYPE_CHECKING:
from ..ModelScene import ModelScene
from ..model_scene import ModelScene
class CreateEntrypointConnectionCommand(QUndoCommand):
def __init__(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from PySide6.QtGui import QUndoCommand

if TYPE_CHECKING:
from ..ModelScene import ModelScene
from ..ConnectionItem import IConnectionItem
from ..model_scene import ModelScene
from ..connection_item import IConnectionItem

class CutCommand(QUndoCommand):
def __init__(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from PySide6.QtGui import QUndoCommand

if TYPE_CHECKING:
from ..ModelScene import ModelScene
from ..ConnectionItem import IConnectionItem
from ..model_scene import ModelScene
from ..connection_item import IConnectionItem

class DeleteCommand(QUndoCommand):
def __init__(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from PySide6.QtGui import QUndoCommand

if TYPE_CHECKING:
from ..ConnectionItem import IConnectionItem
from ..ModelScene import ModelScene
from ..connection_item import IConnectionItem
from ..model_scene import ModelScene

class DeleteConnectionCommand(QUndoCommand):
def __init__(self, scene: ModelScene, item, parent=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from PySide6.QtGui import QUndoCommand

if TYPE_CHECKING:
from ModelScene import ModelScene
from mal_gui.model_scene import ModelScene

class DragDropCommand(QUndoCommand):
def __init__(self, scene: ModelScene, item, parent=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from PySide6.QtGui import QUndoCommand

if TYPE_CHECKING:
from ..ObjectExplorer.AssetBase import AssetBase
from ..ModelScene import ModelScene
from ..object_explorer.asset_base import AssetBase
from ..model_scene import ModelScene

class MoveCommand(QUndoCommand):
def __init__(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from PySide6.QtGui import QUndoCommand
from PySide6.QtCore import QPointF

from ..ConnectionItem import AssociationConnectionItem
from ..connection_item import AssociationConnectionItem

if TYPE_CHECKING:
from ..ModelScene import ModelScene
from ..model_scene import ModelScene

class PasteCommand(QUndoCommand):
def __init__(
Expand Down

0 comments on commit d8b4b22

Please sign in to comment.