Full 'code' widget refactor to utilize controllers and cross controller event signaling
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
Dasta Class Package
|
||||
DTO Class Package
|
||||
"""
|
||||
|
||||
from .event import Event
|
||||
27
src/libs/dto/code/__init__.py
Normal file
27
src/libs/dto/code/__init__.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""
|
||||
Code DTO Class Package
|
||||
"""
|
||||
|
||||
|
||||
from .code_event import CodeEvent
|
||||
from .get_command_system_event import GetCommandSystemEvent
|
||||
from .request_completion_event import RequestCompletionEvent
|
||||
from .cursor_moved_event import CursorMovedEvent
|
||||
from .modified_changed_event import ModifiedChangedEvent
|
||||
from .text_changed_event import TextChangedEvent
|
||||
from .text_inserted_event import TextInsertedEvent
|
||||
from .focused_view_event import FocusedViewEvent
|
||||
from .set_active_file_event import SetActiveFileEvent
|
||||
|
||||
from .file_path_set_event import FilePathSetEvent
|
||||
from .added_new_file_event import AddedNewFileEvent
|
||||
from .swapped_file_event import SwappedFileEvent
|
||||
from .popped_file_event import PoppedFileEvent
|
||||
from .removed_file_event import RemovedFileEvent
|
||||
|
||||
from .get_file_event import GetFileEvent
|
||||
from .get_swap_file_event import GetSwapFileEvent
|
||||
from .add_new_file_event import AddNewFileEvent
|
||||
from .swap_file_event import SwapFileEvent
|
||||
from .pop_file_event import PopFileEvent
|
||||
from .remove_file_event import RemoveFileEvent
|
||||
13
src/libs/dto/code/add_new_file_event.py
Normal file
13
src/libs/dto/code/add_new_file_event.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class AddNewFileEvent(CodeEvent):
|
||||
...
|
||||
13
src/libs/dto/code/added_new_file_event.py
Normal file
13
src/libs/dto/code/added_new_file_event.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class AddedNewFileEvent(CodeEvent):
|
||||
...
|
||||
@@ -4,15 +4,14 @@ from dataclasses import dataclass, field
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .observable_event import ObservableEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class CodeEvent(ObservableEvent):
|
||||
etype: str = ""
|
||||
class CodeEvent:
|
||||
ignore_focus: bool = False
|
||||
view: any = None
|
||||
file: any = None
|
||||
next_file: any = None
|
||||
buffer: any = None
|
||||
buffer: any = None
|
||||
response: any = None
|
||||
14
src/libs/dto/code/cursor_moved_event.py
Normal file
14
src/libs/dto/code/cursor_moved_event.py
Normal file
@@ -0,0 +1,14 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class CursorMovedEvent(CodeEvent):
|
||||
line: int = 0
|
||||
char: int = 0
|
||||
15
src/libs/dto/code/file_path_set_event.py
Normal file
15
src/libs/dto/code/file_path_set_event.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class FilePathSetEvent(CodeEvent):
|
||||
fname: str = ""
|
||||
fpath: str = ""
|
||||
ftype: str = ""
|
||||
14
src/libs/dto/code/focused_view_event.py
Normal file
14
src/libs/dto/code/focused_view_event.py
Normal file
@@ -0,0 +1,14 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class FocusedViewEvent(CodeEvent):
|
||||
left_view: any = False
|
||||
right_view: any = False
|
||||
13
src/libs/dto/code/get_command_system_event.py
Normal file
13
src/libs/dto/code/get_command_system_event.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class GetCommandSystemEvent(CodeEvent):
|
||||
...
|
||||
13
src/libs/dto/code/get_file_event.py
Normal file
13
src/libs/dto/code/get_file_event.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class GetFileEvent(CodeEvent):
|
||||
...
|
||||
13
src/libs/dto/code/get_swap_file_event.py
Normal file
13
src/libs/dto/code/get_swap_file_event.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class GetSwapFileEvent(CodeEvent):
|
||||
...
|
||||
15
src/libs/dto/code/modified_changed_event.py
Normal file
15
src/libs/dto/code/modified_changed_event.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class ModifiedChangedEvent(CodeEvent):
|
||||
line: int = 0
|
||||
char: int = 0
|
||||
value: str = ""
|
||||
13
src/libs/dto/code/pop_file_event.py
Normal file
13
src/libs/dto/code/pop_file_event.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class PopFileEvent(CodeEvent):
|
||||
...
|
||||
15
src/libs/dto/code/popped_file_event.py
Normal file
15
src/libs/dto/code/popped_file_event.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class PoppedFileEvent(CodeEvent):
|
||||
fname: str = ""
|
||||
fpath: str = ""
|
||||
ftype: str = ""
|
||||
13
src/libs/dto/code/remove_file_event.py
Normal file
13
src/libs/dto/code/remove_file_event.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class RemoveFileEvent(CodeEvent):
|
||||
...
|
||||
15
src/libs/dto/code/removed_file_event.py
Normal file
15
src/libs/dto/code/removed_file_event.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class RemovedFileEvent(CodeEvent):
|
||||
fname: str = ""
|
||||
fpath: str = ""
|
||||
ftype: str = ""
|
||||
13
src/libs/dto/code/request_completion_event.py
Normal file
13
src/libs/dto/code/request_completion_event.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class RequestCompletionEvent(CodeEvent):
|
||||
...
|
||||
13
src/libs/dto/code/set_active_file_event.py
Normal file
13
src/libs/dto/code/set_active_file_event.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class SetActiveFileEvent(CodeEvent):
|
||||
...
|
||||
13
src/libs/dto/code/swap_file_event.py
Normal file
13
src/libs/dto/code/swap_file_event.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class SwapFileEvent(CodeEvent):
|
||||
...
|
||||
13
src/libs/dto/code/swapped_file_event.py
Normal file
13
src/libs/dto/code/swapped_file_event.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class SwappedFileEvent(CodeEvent):
|
||||
...
|
||||
18
src/libs/dto/code/text_changed_event.py
Normal file
18
src/libs/dto/code/text_changed_event.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class TextChangedEvent(CodeEvent):
|
||||
has_selection: bool = False
|
||||
start_range: int = 0
|
||||
end_range: int = 0
|
||||
line: int = 0
|
||||
char: int = 0
|
||||
value: str = ""
|
||||
15
src/libs/dto/code/text_inserted_event.py
Normal file
15
src/libs/dto/code/text_inserted_event.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# Python imports
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from .code_event import CodeEvent
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class TextInsertedEvent(CodeEvent):
|
||||
line: int = 0
|
||||
char: int = 0
|
||||
value: str = ""
|
||||
Reference in New Issue
Block a user